demod
|
Page in progress. |
Demodulation 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 demodulation, two side bands, suppressed carrier. Multipliesyon a sinusoid with frequencyfcand applies a fifth-order Butterworth low-pass filter using thefiltfiltfunction.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 frequencyfcand applies a fifth-order Butterworth low-pass filter using thefiltfiltfunction.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 frequencyfcand applies a fifth-order Butterworth low-pass filter using thefiltfiltfunction.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`-fc` Hz and gets an instantaneous frequency as a result.y=cos(2*pi*fc*t + opt*cumsum(x))
The function
cumsumis a rectangular approximation of the integral ofx. Themodulatefunction usesoptas a frequency modulation constant. If you do not specify the valueopt, thenmodulateuses the default valueopt=(fc/fs)*2*pi/(max(max(x))), therefore the maximum frequency deviation fromfc`will be `fcHz. -
"pm"— phase demodulation. Demodulates the shape of a phase-modulated (FM) signal by modulating the Hilbert transformyusing a complex exponential frequency`-fc` Hz 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 the pulse width modulated signal `y. Thedemodfunction returns toxis a vector whose elements determine the duration of each pulse in fractions of a period. Pulses inymust start from the beginning of each carrier period, meaning they must be aligned to the left. When calling the functionmodulate(x,fc,fs,"pwm","centered")"the pulses are centered at the beginning of each period. Length `yis equal to `length(x)*fs/fc'. -
"ppm"— positional pulse demodulation. Defines the pulse positions in the pulse-position modulated signaly. For proper demodulation, the pulses should not overlap. Lengthxis equal to `length(t)*fc/fs'. -
"qam" is quadrature amplitude demodulation. The function
[x1,x2] = demod(y,fc,fs,"qam")multipliesyby cosine and sine with frequencyfcand applies a fifth-order Butterworth low-pass filter using `filtfilt'.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);
#
fc —
carrier frequency
Arbitrary type
Details
The carrier frequency used to modulate the useful signal is given as a real positive scalar.
Output arguments
# x — demodulated useful signal
Details
A demodulated useful signal returned as a real vector or matrix.