modulate
Page in progress. |
Modulation for modeling communication systems.
Library |
|
Arguments
Input arguments
#
fs —
sampling rate
Arbitrary type
Details
The sampling rate specified as a real positive scalar.
#
method —
The modulation method
Arbitrary type
Details
The modulation method used, possible values:
-
"am"
or"amdsb-sc"
— amplitude modulation, two side bands, suppressed carrier. Multipliesx
on a sinusoid with a frequency fc.y = x.*cos(2*pi*fc*t)
-
amdsb-tc
— amplitude modulation, two side bands, transmitted carrier. Subtracts the scalar valueopt
fromx
and multiplies the result by a sinusoid with a frequency fc.y = (x-opt).*cos(2*pi*fc*t)
If you do not specify
opt
, thenmodulate
uses the default valuemin(min(x))
so that the useful signal(x-opt)
is non-negative and has a minimum value of `0'. -
amssb
— amplitude modulation, single sideband. Multipliesx
on a sinusoid with frequencyfc
and adds the result to the Hilbert transformx
multiplied by a phase - shifted sinusoid with frequencyfc
.y = x.*cos(2*pi*fc*t)+imag(hilbert(x)).*sin(2*pi*fc*t)
This method effectively eliminates the upper sideband.
-
"fm"
— frequency modulation. Creates a sinusoid with an instantaneous frequency that varies depending on the useful signalx
.y = cos(2*pi*fc*t + opt*cumsum(x))
The function
cumsum
is a rectangular approximation of the integral ofx
. Themodulate
function usesopt
as a frequency modulation constant. If you do not specify the valueopt
, thenmodulate
uses the default valueopt=(fc/fs)*2*pi/(max(max(x)))
, therefore the maximum frequency deviation fromfc`will be `fc
Hz. -
"pm"
— phase modulation. Creates a sinusoid with a frequency offc`the phase of which varies depending on the useful signal `x
.y=cos(2*pi*fc*t + opt*x)
-
pwm" is pulse width modulation. Creates a modulated pulse width signal based on the pulse lengths in `x
. Elements ofx
are in the range from0
to1
and determine the duration of each pulse in fractions of a period. The pulses start at the beginning of each carrier period, meaning they are aligned to the left. When calling the functionmodulate(x,fc,fs,"pwm","centered")"the pulses are centered at the beginning of each period. The length of `_(y,t)
is equal tolength(x)*fs/fc
. -
"ppm"
— pulse-position modulation. Creates a pulse-position modulated signal from the pulse positions inx
. Elements ofx
are in the range from0
to1
, setting the left edge of each pulse in fractions of a period. The valueopt
is a scalar from0
to1
, which defines the length of each pulse in fractions of a period. The default value foropt
is0.1'. The length of `_(y,t)
is equal tolength(x)*fs/fc
. -
"qam" is quadrature amplitude modulation. Creates a signal using quadrature amplitude modulation from the signals
x
andopt
.y = x.*cos(2*pi*fc*t) + opt.*sin(2*pi*fc*t)
#
x —
a useful signal
Arbitrary type
Details
a useful signal defined as a real vector or matrix.
#
fc —
carrier frequency
Arbitrary type
Details
The carrier frequency used to modulate the useful signal is given as a real positive scalar.