Clear Filters
Clear Filters

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

3 views (last 30 days)
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?

Answers (1)

Walter Roberson
Walter Roberson on 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 Comments
justin stephens
justin stephens on 10 Mar 2019
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 on 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

Sign in to comment.

Categories

Find more on Filter Banks in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!