Matlab program for Frequency modulation and demodulation by matlab inbuilt function.
Matlab code
clc; clear all;close all;
t=0:0.001:1; % Define time axis
A=1; % Amplitude
fc=100; % Carrier Signal frequency
fs=1000; % Sampling rate of signal
frepdev=50; % Frequency deviation
% Message Signal
Sm=A*sin(2*pi*fm*t);
subplot(4,1,1);
plot(t,Sm);
xlabel('Time');
ylabel('Amplitude');
title('Message Signal');
% Carrier Signal
Sc=A*sin(2*pi*fc*t);
subplot(4,1,2);
plot(t,Sc);
xlabel('Time');
ylabel('Amplitude');
title('Carrier Signal');
% Frequency modulated Signal
Sfm=fmmod(Sm,fc,fs,frepdev);
subplot(4,1,3);
plot(t,Sfm);
xlabel('Time');
ylabel('Amplitude');
title('Frequency modulated Signal');
% Frequency Demodulated Signal
Sfdm=fmdemod(Sfm,fc,fs,frepdev);
subplot(4,1,4);
plot(t,Sfdm);
xlabel('Time');
ylabel('Amplitude');
title('Frequency Demodulated Signal');
No comments:
Post a Comment