i am trying to do some signal manipulation but i keep getting errors
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
Walter Roberson
2019-3-9
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 个评论
Arrian Farahani
2020-10-29
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
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Modulation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!