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. Multipliesy
on a sinusoid with frequencyfc
and applies a fifth-order Butterworth low-pass filter using thefiltfilt
function.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. Multipliesy
on a sinusoid with frequencyfc
and applies a fifth-order Butterworth low-pass filter using thefiltfilt
function.x = y.*cos(2*pi*fc*t); [b,a] = butter(5,fc*2/fs); x = filtfilt(b,a,x);
-
"amssb"
— amplitude demodulation. Multipliesy
on a sinusoid with frequencyfc
and applies a fifth-order Butterworth low-pass filter using thefiltfilt
function.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 transformy
using 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
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 demodulation. Demodulates the shape of a phase-modulated (FM) signal by modulating the Hilbert transformy
using 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
. Thedemod
function returns tox
is a vector whose elements determine the duration of each pulse in fractions of a period. Pulses iny
must 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 `y
is 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. Lengthx
is equal to `length(t)*fc/fs'. -
"qam" is quadrature amplitude demodulation. The function
[x1,x2] = demod(y,fc,fs,"qam")
multipliesy
by cosine and sine with frequencyfc
and 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.