i am trying to do some signal manipulation but i keep getting errors
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I am having some issues with the project and I was hoping that you could help. I keep getting an error when I try to run this code. the code creates two different fecieved signals and the book says that the pam command creates a random sequence of symbols drawn from the alphabet +- 1, +-3 and then uses hamming to create a pulse shape.
N=10000; % # symbols, oversampling factor
M=20; % # symbols, oversampling factor
Ts=.0001; % # symbols, oversampling factor
time=Ts*N*M; % sampling interval & time vector
t=Ts:Ts:time; % sampling interval & time vector
m=pam(N,4,5); % 4-level signal of length N
mup=zeros(1,N*M);
mup(1:M:N*M)=m; % oversample by integer length M
ps=hamming(M); % blip pulse of width M
s=filter(ps,1,mup); % convolve pulse shape with data
fc=1000; % carrier freq
phoff=-1.0; % carrier phase
c=cos(2*pi*fc*t+phoff); % construct carrier
rsc=s.*c; % modulated signal (small Carrier)
rlc=(s+1).*c; % modulated signal (large carrier
I keep getting an error that pam(N,4,5) does not exist but this code is strait from the book. Could anyone offer any help?
0 commentaires
Réponses (1)
Walter Roberson
le 9 Mar 2019
pam() is from the BioInformatics Toolbox, and cannot be invoked with three integer parameters.
For signal processing Pulse Amplitude Modulation, the Mathworks routine is pammod . The third parameter to that is the initial phase, and it seems unlikely that you would be using an initial phase of 5 radians.
I would suggest that it is likely that "the book" supplied its own pam() routine.
3 commentaires
Arrian Farahani
le 29 Oct 2020
there is a pam.m script in the github file for the book. Run this as a function and it will call it when running this script
Voir également
Catégories
En savoir plus sur Modulation dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!