This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Pulse amplitude demodulation


z = pamdemod(y,M)
z = pamdemod(y,M,ini_phase)
z = pamdemod(y,M,ini_phase,symbol_order)


z = pamdemod(y,M) demodulates the complex envelope y of a pulse amplitude modulated signal. M is the alphabet size. The ideal modulated signal should have a minimum Euclidean distance of 2.

z = pamdemod(y,M,ini_phase) specifies the initial phase of the modulated signal in radians.

z = pamdemod(y,M,ini_phase,symbol_order) specifies how the function assigns binary words to corresponding integers. If symbol_order is set to 'bin' (default), the function uses a natural binary-coded ordering. If symbol_order is set to 'gray', it uses a Gray-coded ordering.


collapse all

Modulate and demodulate random integers using pulse amplitude modulation. Verify that the output data matches the original data.

Set the modulation order and generate 100 M-ary data symbols.

M = 12;
dataIn = randi([0 M-1],100,1);

Perform modulation and demodulation operations.

modData = pammod(dataIn,M);
dataOut = pamdemod(modData,M);

Compare the first five symbols.

[dataIn(1:5) dataOut(1:5)]
ans = 5×2

     9     9
    10    10
     1     1
    10    10
     7     7

Verify that there are no symbol errors in the entire sequence.

symErrors = symerr(dataIn,dataOut)
symErrors = 0

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Introduced before R2006a