i am trying to do some signal manipulation but i keep getting errors

5 次查看(过去 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?

回答(1 个)

Walter Roberson
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 个评论
justin stephens
justin stephens 2019-3-10
i am very sorry that the photo is in this orientation....... i have scoured the software reciever design book for a proprietary function of pam(). That is why i am so confused about this because pam() is part of a bio library.
Arrian Farahani
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 CenterFile Exchange 中查找有关 Filter Banks 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by