Communications Toolbox 
Syntax
y = dmodce(x,Fd,Fs,'
method
/nomap
'
...); y = dmodce(x,Fd,Fs,'
ask
'
,M); y = dmodce(x,Fd,Fs,'
fsk
'
,M,tone); y = dmodce(x,Fd,Fs,'
msk
'
); y = dmodce(x,Fd,Fs,'
psk
'
,M); y = dmodce(x,Fd,Fs,'
qask
'
,M); y = dmodce(x,Fd,Fs,'
qask/arb
'
,inphase,quadr); y = dmodce(x,Fd,Fs,'
qask/cir
'
,numsig,amp,phs); y = dmodce(x,Fd,[Fs phase],...);
Optional Inputs
Input 
Default Value 
tone 
Fd 
amp 
[1:length(numsig)] 
phs 
numsig*0 
Description
The function dmodce
performs digital baseband modulation and some related tasks. The corresponding demodulation function is ddemodce
. The table below lists the modulation schemes that dmodce
supports.
To Modulate Without Mapping
Ordinarily, the dmodce
function first maps the digital message signal to an analog signal and then modulates the analog signal. The generic syntax
y = dmodce(x,Fd,Fs,'
method
/nomap
'...)
uses the /nomap
flag to tell dmodce
that the digital message has already been mapped to an analog signal x
whose sampling rate is Fs
. As a result, dmodce
skips its usual mapping step. You can use the modmap
function to perform the mapping step. In this generic syntax, method
is one of the seven values listed in the table above, and the other variables are as in the next section.
To Modulate a Digital Signal (General Information)
The generic syntax y = dmodce(x,Fd,Fs,...)
modulates the digital message signal that x
represents. x
is a matrix of nonnegative integers. If x
is a vector of length n, then y
is a vector of length n*Fs/Fd
. Otherwise, if x
is nbym, then y
is (n*Fs/Fd
)bym and each column of x
is processed separately. Since dmodce
implements baseband simulation, the entries of y
are complex.
The sampling rates in Hertz of x
and y
, respectively, are Fd
and Fs
. (Thus 1/Fd
represents the time interval between two consecutive samples in x
, and similarly for y
.) The ratio Fs/Fd
must be a positive integer. The initial phase in the modulation is zero.
The generic syntax y = dmodce(x,Fd,[Fs phase],...)
is the same, except that the third input argument is a twoelement vector instead of a scalar. The first entry, Fs
, is the sampling rate as described in the paragraph above. The second entry, phase
, is the initial phase in the modulation, measured in radians.
To Modulate a Digital Signal (Specific Syntax Information)
y = dmodce(x,Fd,Fs,
performs '
ask
'
,M)
M
ary amplitude shift keying modulation. Each entry of x
must be in the range [0, M
1]. The maximum value of the modulated signal is 1.
y = dmodce(x,Fd,Fs,
performs '
fsk
'
,M,tone)
M
ary frequency shift keying modulation. Each entry of x
must be in the range [0, M
1]. The optional argument tone
is the separation between successive frequencies in the modulated signal y
. The default value of tone
is Fd
. The maximum value of y
is 1.
y = dmodce(x,Fd,Fs,
performs minimum shift keying modulation. Each entry of '
msk
'
)
x
is either 0 or 1. The maximum value of y
is 1. The separation between the two frequencies is Fd/2
.
y = dmodce(x,Fd,Fs,
performs '
psk
'
,M)
M
ary phase shift keying modulation. Each entry of x
must be in the range [0, M
1]. The maximum value of y
is 1.
y = dmodce(x,Fd,Fs,
performs '
qask
'
,M)
M
ary quadrature amplitude shift keying modulation with a square signal constellation. The table below shows the maximum value of y
, for several small values of M.
M 
Maximum Value of y 
M 
Maximum Value of y 
2 
1 
32 
5 
4 
1 
64 
7 
8 
3 
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) .

y = dmodce(x,Fd,Fs,
performs quadrature amplitude shift keying modulation, with a signal constellation that you define using the vectors '
qask/arb
'
,inphase,quadr)
inphase
and quadr
. The constellation point for the kth message has inphase component inphase
(k+1) and quadrature component quadr
(k+1).
y = dmodce(x,Fd,Fs,
performs quadrature amplitude shift keying modulation 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 uses FSK modulation and demodulation with different frequency separations tone
. The output indicates that the symbol error rate varies depending on the value of tone
. Your results might be different from those shown below, because the example uses random numbers.
M = 4; Fd = 1; Fs = 32; SNRperBit = 5; adjSNR = SNRperBit10*log10(Fs/Fd)+10*log10(log2(M)); x = randint(5000,1,M); % Original signal % Modulate using FSK with orthogonal tone spacing. tone = .5; randn('state',1945724); % Seed the Gaussian generator. w1 = dmodce(x,Fd,Fs,'fsk',M,tone); y1 = awgn(w1, adjSNR, 'measured', [], 'dB'); z1 = ddemodce(y1,Fd,Fs,'fsk',M,tone); ser1 = symerr(x,z1) ser1 = 67 % Modulate using FSK with nonorthogonal tone spacing. tone = .25; randn('state',1945724); % Reseed the Gaussian generator. w2 = dmodce(x,Fd,Fs,'fsk',M,tone); y2 = awgn(w2, adjSNR, 'measured', [], 'dB'); z2 = ddemodce(y2,Fd,Fs,'fsk',M,tone); ser2 = symerr(x,z2) ser2 = 258
See Also
ddemodce
, dmod
, ddemod
, amod
, amodce
, modmap
, apkconst
dmod  dpcmdeco 