Communications Toolbox | ![]() ![]() |
Syntax
z = ddemod(y,Fc,Fd,Fs,'
ask
/opt
'
,M,num,den); z = ddemod(y,Fc,Fd,Fs,'
fsk
/opt
'
,M); z = ddemod(y,Fc,Fd,Fs,'
msk
'
); z = ddemod(y,Fc,Fd,Fs,'
psk
/opt
'
,M,num,den); z = ddemod(y,Fc,Fd,Fs,'
qask
/opt
'
,M,num,den); z = ddemod(y,Fc,Fd,Fs,'
qask/arb
/opt
'
,inphase,quadr,num,den); z = ddemod(y,Fc,Fd,Fs,'
qask/cir
/opt
'
,numsig,amp,phs,num,den); z = ddemod(y,Fc,Fd,[Fs initphase],...
);
Optional Inputs
Description
The function ddemod
performs digital passband demodulation. The corresponding modulation function is dmod
. The table below lists the demodulation schemes that ddemod
supports.
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:
y
is a vector of length n*Fs/Fd
, then z
is a column vector of length n. Otherwise, if y
is (n*Fs/Fd
)-by-m, then z
is n-by-m and each column of y
is processed separately.
y
is (n*Fs/Fd
)-by-m, then z
is n-by-2m. The odd-numbered columns in z
represent in-phase components and the even-numbered columns represent quadrature components. Each column of y
is processed separately.
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,
implements '
ask
'
,M)
M
-ary amplitude shift keying demodulation. Each entry of z
is in the range [0, M
-1].
z = ddemod(y,Fc,Fd,Fs,
is the same as the syntax above, except that the algorithm includes a Costas loop.'
ask/costas
'
,M)
z = ddemod(y,Fc,Fd,Fs,
implements coherent '
fsk
'
,M,tone)
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,
is the same as the syntax above, except that it uses noncoherent demodulation. '
fsk/noncoherence
'
,M,tone)
z = ddemod(y,Fc,Fd,Fs,
implements minimum shift keying demodulation. Each entry of '
msk
'
)
z
is either 0 or 1. The separation between the two frequencies is Fd/2
.
z = ddemod(y,Fc,Fd,Fs,
implements '
psk
'
,M)
M
-ary correlation phase shift keying demodulation. Each entry of z
is in the range [0, M
-1].
z = ddemod(y,Fc,Fd,Fs,
implements '
qask
'
,M)
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 |
Note
To see how symbols are mapped to the constellation points, generate a square constellation plot using qaskenco (M) .
|
z = ddemod(y,Fc,Fd,Fs,
implements quadrature amplitude shift keying demodulation, with a signal constellation that you define using the vectors '
qask/arb
'
,inphase,quadr)
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,
implements quadrature amplitude shift keying demodulation with a circular signal constellation. '
qask/cir
'
,numsig,amp,phs)
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)]
.
Note
To see how symbols are mapped to the constellation points, generate a labeled circle constellation plot using apkconst (numsig,amp,phs,'n') .
|
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
.
M = 16; % Use 16-ary modulation. Fc = 10; % Carrier signal frequency is 10 Hz. Fd = 1; % Sampling rates of original and modulated signals Fs = 50; % are 1 and 50, respectively (samples per second). x = randint(100,1,M); % Random digital message % Use M-ary PSK modulation to produce y. y = dmod(x,Fc,Fd,Fs,'ask',M); % Add some Gaussian noise. ynoisy = y + .01*randn(Fs/Fd*100,1); % Demodulate y to recover the message. z = ddemod(ynoisy,Fc,Fd,Fs,'ask',M); s = symerr(x,z) % Check symbol error rate. s = 0
See Also
dmod
, amod
, ademod
, dmodce
, ddemodce
, demodmap
, modmap
, eyediagram
, scatterplot
![]() | cyclpoly | ddemodce | ![]() |