Help Center
Pulse amplitude demodulation
Z = pamdemod(Y,M)
Z = pamdemod(Y,M,initphase)
Z = pamdemod(Y,M,initphase,symorder)
Z = pamdemod(Y,M) applies pulse amplitude demodulation to the pulse amplitude modulated signal, Y, of order M and returns the demodulated input signal.
Z
Y
M
example
Z = pamdemod(Y,M,initphase) specifies the initial phase of the modulated signal in radians.
initphase
Z = pamdemod(Y,M,initphase,symorder) specifies the symbol mapping order for the demodulation.
symorder
collapse all
Demodulate a noiseless pulse amplitude modulated signal of order 8. Verify that the input data symbols match the demodulated symbols.
Generate random 8-ary data symbols.
M = 8; dataIn = randi([0 M-1],100,1);
Apply pulse amplitude modulation (PAM) to the generated data.
modData = pammod(dataIn,M);
Apply pulse amplitude demodulation to the modulated data.
demodData = pamdemod(modData,M);
Compare the first five symbols.
[dataIn(1:5) demodData(1:5)]
ans = 5×2 6 6 7 7 1 1 7 7 5 5
Determine the number of symbol errors in the demodulated data.
symErrors = symerr(dataIn,demodData)
symErrors = 0
Demodulate a noisy pulse amplitude modulated signal of order 8.
M = 8; dataIn = randi([0 M-1],1000,1);
Apply pulse amplitude modulation (PAM) to the generated data. Employ a Gray-coded symbol mapping order for the modulation.
modData = pammod(dataIn,M,0,"gray");
Pass the modulated data through an additive white Gaussian noise channel. Set the signal-to-noise ratio to 8 dB.
noisyData = awgn(modData,M);
Display the noisy PAM constellation.
scatterplot(noisyData)
Apply pulse amplitude demodulation to the noisy modulated data.
demodData = pamdemod(noisyData,M,0,"gray");
symErrors = 1
Pulse amplitude modulated signal, specified as a scalar, vector, or matrix. If Y is a matrix, the function processes the columns independently.
Data Types: single | double Complex Number Support: Yes
single
double
Modulation order, specified as a positive integer power of two.
Data Types: single | double
0
[]
Initial phase of the modulated signal in radians, specified as a scalar.
"bin"
"gray"
Symbol mapping order for the demodulation, specified as one of these options.
"bin" — Use a binary-coded mapping order.
"gray" — Use a Gray-coded mapping order.
The symorder argument specifies how the function assigns binary vectors to corresponding integers.
Data Types: char | string
char
string
Demodulated input signal, returned as a scalar, vector, or matrix of integers in the range [0, M–1]. Z is of the same length as Y.
Data Types: double | single
Introduced before R2006a
pammod
qamdemod
qammod
pskmod
pskdemod
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other bat365 country sites are not optimized for visits from your location.
Americas
Europe
Asia Pacific
Contact your local office