z = fmdemod(y,Fc,Fs,freqdev)
z = fmdemod(y,Fc,Fs,freqdev,ini_phase)
z = fmdemod(y,Fc,Fs,freqdev) demodulates
the modulating signal
z from the carrier signal
using frequency demodulation. The carrier signal has frequency
and sampling rate
Fs (Hz), where
be at least
is the frequency deviation (Hz) of the modulated signal
z = fmdemod(y,Fc,Fs,freqdev,ini_phase) specifies
the initial phase of the modulated signal, in radians.
Set the sample rate and carrier frequency. Generate a time vector having a duration of 0.2 s.
fs = 1000; fc = 200; t = (0:1/fs:0.2)';
Create a sinusoidal signal.
x = sin(2*pi*30*t)+2*sin(2*pi*60*t);
Set the frequency deviation to 50 Hz.
fDev = 50;
y = fmmod(x,fc,fs,fDev);
z = fmdemod(y,fc,fs,fDev); % Demodulate both channels.
Plot the original and demodulated signals.
plot(t,x,'c',t,z,'b--'); xlabel('Time (s)') ylabel('Amplitude') legend('Original Signal','Demodulated Signal')
The demodulated signal is well aligned with the original.