FM with noise
Fs = input(‘enter the value of Fs ‘); % Sampling rate of signal
Fc = input(‘enter the value of Fc ‘); % Carrier frequency
t = [0:Fs]’/Fs; % Sampling times
x = sin(2*pi*20*t)%+2*sin(2*pi*60*t); % Channel
dev = input(‘enter the value of dev ‘);% Frequency deviation in modulated signal
y = fmmod(x,Fc,Fs,dev); % Modulate both channels.
n = input(‘enter the value of snr ‘);
n = awgn(x,30);
z = fmdemod(y,Fc,Fs,dev); % Demodulate both channels.
You can change the values, names and descriptions. Remove the descriptions as we normally don’t write them. They are their only for the understanding of the students. Once you understand them there is no need to write them.