modulate
Modulation for modeling communication systems.
| Library |
|
Arguments
Input arguments
# x is a useful signal
+
vector | the matrix
Details
A useful signal defined as a real vector or matrix.
# fc — carrier frequency
+
scalar
Details
The carrier frequency used to modulate the useful signal is given as a real positive scalar.
#
fs —
sampling
rate
scalar
Details
The sampling rate specified as a real positive scalar.
# method — modulating method
+
"am" (by default) | "amdsb-sc" | "amdsb-tc" | "amssb" | "fm" | "pm" | "pwm" | "ppm" | "qam"
Details
The modulation method used, possible values:
-
"am"or"amdsb-sc"— amplitude modulation, two side bands, suppressed carrier. Multipliesxto a sinusoid with a frequency fc.y = x.*cos(2*pi*fc*t)
-
"amdsb-tc"— amplitude modulation, two side bands, transmitted carrier. Subtracts a scalar valueoptfromxand multiplies the result by a sinusoid with a frequency fc.y = (x-opt).*cos(2*pi*fc*t)
If you do not specify
optThenmodulateuses the default valuemin(min(x))to provide a useful signal(x-opt)it was non-negative and had a minimum value of0. -
"amssb"— amplitude modulation, single sideband. Multipliesxon a sinusoid with a frequencyfcand adds the result to the Hilbert transform.xmultiplied 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 desired signal.x.y = cos(2*pi*fc*t + opt*cumsum(x))
Function
cumsumis a rectangular approximation of the integral ofx. Functionmodulateusesoptas a constant of frequency modulation. If you do not specify a valueoptThenmodulateuses the default valueopt=(fc/fs)*2*pi/(max(max(x))), therefore , the maximum frequency deviation fromfcwill befcHz. -
"pm"— phase modulation. Creates a sinusoid with a frequency offc, the phase of which varies depending on the useful signalx.y=cos(2*pi*fc*t + opt*x)
-
"pwm"— pulse width modulation. Creates a modulated pulse width signal based on the pulse lengths inx. Elementsxare in the range from0before1and 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. Length_(y,t)equal tolength(x)*fs/fc. -
"ppm"— pulse-position modulation. Creates a pulse-position modulated signal from pulse positions inx. Elementsxare in the range from0before1by setting the left edge of each pulse in fractions of a period. Meaningoptrepresents a scalar from0before1, which determines the length of each pulse in fractions of a period. The default value foroptis0.1. Length_(y,t)equal tolength(x)*fs/fc. -
"qam"— quadrature amplitude modulation. Creates a signal using quadrature amplitude modulation from the signalsxandopt.y = x.*cos(2*pi*fc*t) + opt.*sin(2*pi*fc*t)