Communications Toolbox    
ddemod

Digital passband demodulator

Syntax

Optional Inputs

Input
Default Value, or Default Behavior If Input Is Omitted
opt
ddemod demaps after demodulating. If the method is ASK, then the algorithm does not use a Costas loop. If the method is FSK, then demodulation is coherent.
num, den
Omitting these arguments prevents ddemod from using a filter.
amp
[1:length(numsig)]
phs
numsig*0

Description

The function ddemod performs digital passband demodulation. The corresponding modulation function is dmod. The table below lists the demodulation schemes that ddemod supports.

Demodulation Scheme
Fifth Input Argument
Where /opt Can Contain
M-ary amplitude shift keying
'ask/opt'
/nomap; /costas
M-ary frequency shift keying
'fsk/opt'
/noncoherence
Minimum shift keying
'msk'

M-ary phase shift keying
'psk/opt'
/nomap
Quadrature amplitude shift keying
'qask/opt', 'qask/arb/opt', or 'qask/cir/opt'
/nomap

The second column of the table indicates in bold type the required portion of the fifth input argument for ddemod. The third column indicates optional flags that you can append to the fifth argument. The order of optional flags does not matter.

To Demodulate Without Demapping (ASK, PSK, QASK only)

Ordinarily, the ddemod function first demodulates the analog signal it receives and then demaps the demodulated signal in order to recover the digital message signal. The optional /nomap flag, appended to the fifth input argument, prevents ddemod from demapping. The output is then an analog signal x whose sampling rate is Fs. You can use the demodmap function to perform the demapping step. The /nomap option is not available for FSK or MSK demodulation.

To Demodulate a Digital Signal (General Information)

The generic syntax z = ddemod(y,Fc,Fd,Fs,...) demodulates the digital message signal z from a received analog signal y. After measuring the distance from the received signal to all possible digits in the coding scheme, ddemod returns the nearest digit.

y and z are real matrices whose sizes depend on the demodulation method:

The carrier frequency in hertz is Fc. The sampling rates in hertz of y and z, respectively, are Fs and Fd. (Thus 1/Fs represents the time interval between two consecutive samples in y, and similarly for z.) The ratio Fs/Fd must be a positive integer. The time interval between two decision points is 1/Fd.

The generic syntax z = ddemod(y,Fc,Fd,[Fs initphase],...) is the same, except that the fourth input argument is a two-element vector instead of a scalar. The first entry, Fs, is the sampling rate as described in the paragraph above. The second entry, initphase, is the initial phase of the carrier signal, measured in radians.

ddemod can use a lowpass filter with sample time 1/Fs while demodulating, in order to filter out the carrier signal. To specify the lowpass filter, include num and den in the list of input arguments. num and den are row vectors that give the coefficients, in descending order, of the numerator and denominator of the filter's transfer function. If num is empty, zero, or absent, then the function does not use a filter.

To Demodulate a Digital Signal (Specific Syntax Information)

z = ddemod(y,Fc,Fd,Fs,'ask',M) implements M-ary amplitude shift keying demodulation. Each entry of z is in the range [0, M-1].

z = ddemod(y,Fc,Fd,Fs,'ask/costas',M) is the same as the syntax above, except that the algorithm includes a Costas loop.

z = ddemod(y,Fc,Fd,Fs,'fsk',M,tone) implements coherent M-ary frequency shift keying demodulation. The optional argument tone is the separation between successive frequencies in the modulated signal z. The default value of tone is Fd. Each entry of z is in the range [0, M-1].

z = ddemod(y,Fc,Fd,Fs,'fsk/noncoherence',M,tone) is the same as the syntax above, except that it uses noncoherent demodulation.

z = ddemod(y,Fc,Fd,Fs,'msk') implements minimum shift keying demodulation. Each entry of z is either 0 or 1. The separation between the two frequencies is Fd/2.

z = ddemod(y,Fc,Fd,Fs,'psk',M) implements M-ary correlation phase shift keying demodulation. Each entry of z is in the range [0, M-1].

z = ddemod(y,Fc,Fd,Fs,'qask',M) implements M-ary quadrature amplitude shift keying demodulation with a square signal constellation. The table below shows the maximum among in-phase and quadrature coordinates of constellation points, for several small values of M.

M
Maximum of Coordinates of Constellation Points
M
Maximum of Coordinates of Constellation Points
2
1
32
5
4
1
64
7
8
3 (quadrature maximum is 1)
128
11
16
3
256
15

z = ddemod(y,Fc,Fd,Fs,'qask/arb',inphase,quadr) implements quadrature amplitude shift keying demodulation, with a signal constellation that you define using the vectors inphase and quadr. The signal constellation point for the kth message has in-phase component inphase(k+1) and quadrature component quadr(k+1).

z = ddemod(y,Fc,Fd,Fs,'qask/cir',numsig,amp,phs) implements quadrature amplitude shift keying demodulation with a circular signal constellation. numsig, amp, and phs are vectors of the same length. The entries in numsig and amp must be positive. If k is an integer in the range [1, length(numsig)], then amp(k) is the radius of the kth circle, numsig(k) is the number of constellation points on the kth circle, and phs(k) is the phase of the first constellation point plotted on the kth circle. All points on the kth circle are evenly spaced. If you omit phs, then its default value is numsig*0. If you omit amp, then its default value is [1:length(numsig)].

Examples

This example mimics the one in Simple Digital Modulation Example but uses passband simulation. It generates a random digital signal, modulates it using dmod, and adds noise. Then it demodulates the noisy signal and computes the symbol error rate. The ddemod function demodulates the analog signal y and then demaps to produce the digital signal z.

Important differences between this example and the original baseband example are the explicit reference to the carrier signal frequency Fc and the fact that y and ynoisy are real, not complex. For variety, this example uses ASK instead of PSK, as well as a different sampling rate Fd.

See Also

dmod, amod, ademod, dmodce, ddemodce, demodmap, modmap, eyediagram, scatterplot


  cyclpoly ddemodce