demod
Demodulation for modeling communication systems.
| Library |
|
Arguments
Input arguments
# 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" (default) | "amdsb-sc" | "amdsb-tc" | "amssb" | "fm" | "pm" | "pwm" | "pmm" | "qam"
Details
The modulation method used, possible values:
-
"am"or"amdsb-sc"— amplitude demodulation, two side bands, suppressed carrier. Multipliesyon a sinusoid with a frequency offcand applies a fifth-order Butterworth low-pass filter using the functionfiltfilt.x = y.*cos(2*pi*fc*t); [b,a] = butter(5,fc*2/fs); x = filtfilt(b,a,x);
-
"amdsb-tc"— amplitude demodulation, two side bands, transmitted carrier. Multipliesyon a sinusoid with a frequencyfcand applies a fifth-order Butterworth low-pass filter using the functionfiltfilt.x = y.*cos(2*pi*fc*t); [b,a] = butter(5,fc*2/fs); x = filtfilt(b,a,x);
-
"amssb"— amplitude demodulation. Multipliesyon a sinusoid with a frequencyfcand applies a fifth-order Butterworth low-pass filter using the functionfiltfilt.x = y.*cos(2*pi*fc*t); [b,a] = butter(5,fc*2/fs); x = filtfilt(b,a,x);
-
"fm"— frequency demodulation. Demodulates the shape of a frequency-modulated (FM) signal by modulating the Hilbert transformyusing a complex exponential frequency-fcHz and gets an instantaneous frequency as a result.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 demodulation. Demodulates the shape of a phase-modulated (FM) signal by modulating the Hilbert transformyusing a complex exponential frequency-fcHz and gets an instantaneous phase as a result.y=cos(2*pi*fc*t + opt*x)
-
"pwm"— pulse width demodulation. Defines the pulse width of a pulse-width modulated signaly. Functiondemodreturns toxa vector whose elements determine the duration of each pulse in fractions of a period. Pulses inyThey must start from the beginning of each carrier period, meaning they must be aligned to the left. When calling a functionmodulate(x,fc,fs,"pwm","centered")the pulses are centered at the beginning of each period. Lengthyequal tolength(x)*fs/fc. -
"ppm"— Positional pulse demodulation. Determines the pulse positions in a pulse-position modulated signaly. For proper demodulation, the pulses should not overlap. Lengthxequal tolength(t)*fc/fs. -
"qam"— quadrature amplitude demodulation. Function[x1,x2] = demod(y,fc,fs,"qam")multipliesyfor cosine and sine with frequencyfcand applies a fifth-order Butterworth low-pass filter usingfiltfilt.x1 = y.*cos(2*pi*fc*t); x2 = y.*sin(2*pi*fc*t); [b,a] = butter(5,fc*2/fs); x1 = filtfilt(b,a,x1); x2 = filtfilt(b,a,x2);
Output arguments
# x — demodulated useful signal
+
vector | the matrix
Details
A demodulated useful signal returned as a real vector or matrix.