Communications Toolbox | ![]() ![]() |
Demap a digital message from a demodulated signal
Syntax
z = demodmap(y,Fd,Fs,'
ask
'
,M); z = demodmap(y,Fd,Fs,'
fsk
'
,M,tone); z = demodmap(y,Fd,Fs,'
msk
'
); z = demodmap(y,Fd,Fs,'
psk
'
,M); z = demodmap(y,Fd,Fs,'
qask
'
,M); z = demodmap(y,Fd,Fs,'
qask/arb
'
,inphase,quadr); z = demodmap(y,Fd,Fs,'
qask/cir
'
,numsig,amp,phs); z = demodmap(y,[Fd offset],Fs,...)
Optional Inputs
Input |
Default Value |
tone |
Fd |
amp |
[1:length(numsig)] |
phs |
numsig*0 |
Description
The digital demodulation process consists of two steps: demodulating an analog signal and demapping the demodulated signal to a digital signal. You can perform the first step using ademod
, ademodce
, or your own custom demodulator. The function demodmap
performs the second step. The table below lists the demodulation schemes that demodmap
supports.
To Demap a Digital Signal (General Information)
The generic syntax z = demodmap(y,Fd,Fs,...)
demaps 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, the demapper returns the nearest digit.
y
is a matrix. The sizes of y
and z
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
must have an even number of columns. The odd-numbered columns in y
represent in-phase components and the even-numbered columns represent quadrature components. Each pair of columns of y
is processed separately. If y
is (n*Fs/Fd
)-by-2m, then z
is n-by-m.
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
.
To shift the decision times ahead by the integer offset
, use the alternative syntax
instead of the demapping syntaxes listed in this section and the next. The default decision offset is 0.
To Demap a Digital Signal (Specific Syntax Information)
z = demodmap(y,Fd,Fs,
demaps from an '
ask
'
,M)
M
-ary amplitude shift keying signal constellation. Each entry of z
is in the range [0, M
-1].
z = demodmap(y,Fd,Fs,
demaps using the coherent '
fsk
'
,M,tone)
M
-ary frequency shift keying method. The optional argument tone
is the separation between successive frequencies in the modulated signal y
. The default value of tone
is Fd
. Each entry of z
is in the range [0, M
-1].
z = demodmap(y,Fd,Fs,
demaps using the minimum shift keying method. Each entry of '
msk
'
)
z
is either 0 or 1. The separation between the two frequencies is Fd/2
.
z = demodmap(y,Fd,Fs,
demaps from an '
psk
'
,M)
M
-ary phase shift keying signal constellation. Each entry of z
is in the range [0, M
-1].
z = demodmap(y,Fd,Fs,
demaps from an '
qask
'
,M)
M
-ary quadrature amplitude shift keying 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 = 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 = demodmap(y,Fd,Fs,
demaps from a quadrature amplitude shift keying 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 = demodmap(y,Fd,Fs,
demaps from a quadrature amplitude shift keying 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
The script below suggests which regions in the in-phase/quadrature plane are associated with different digits. It demaps random points, looks for points that were demapped to the digits 0 and 2, and plots those points in red and blue, respectively. The horizontal axis shows in-phase components and the vertical axis shows quadrature components.
% Construct [in-phase, quadrature] for random points. y = 4*(rand(1000,2)-1/2); % Demap to a digital signal, using 4-PSK method. z = demodmap(y,1,1,'psk',4); red = find(z==0); % Indices of points that mapped to the digit 0 h = scatterplot(y(red,:),1,0,'r.'); hold on % Plot in red. blue = find(z==2); % Indices of points that mapped to the digit 2 scatterplot(y(blue,:),1,0,'b.',h); hold off % Plot in blue.
See Also
modmap
, ddemod
, ddemodce
, ademod
, ademodce
, eyediagram
, scatterplot
![]() | decode | dftmtx | ![]() |