final exp 6
final exp 6
Tejashwi DATE:04-09-2024
ROLL No: PAGE No:
22EG104D45
EXP-6:Spectrum Analysis of AM & FM
Aim:
To generate spectrum of AM & FM using fourier transform in MATLAB.
Software required:
MATLAB R2023b
Hardware required:
Personal computer (or) desktop
Theory:
The total bandwidth of an AM signal is given by 2fm, where fm is the highest frequency of
the message signal. This bandwidth includes both the upper and lower sidebands.
The bandwidth of an FM signal can be estimated using Carson's Rule, which gives the total
bandwidth as: B=2(Δf+fm) Where Δf is the maximum frequency deviation, and fm is the
highest frequency of the message signal.
Clear the workspace using clc; clear all; close all. Define fm = 20 Hz, fc =
200 Hz, am = 1, and fs = 10*fc. Create the time vector t = 0:(1/fs):(6/fm)and
generate the message signal m = am * sin(2*pi*fm*t). Plot the message signal.
Use modulateto perform AM modulation with y = modulate(m, fc, fs, 'am'), then
plot the AM modulated signal. Apply FFT to the AM signal using f = abs(fft(y)) and
plot the AM spectrum.
For FM modulation, use fmmodwith g = fmmod(m, fc, fs, 70)(70 being
the frequency deviation). Plot the FM modulated signal, apply FFT using
f1 = abs(fft(g)), and plot the FM spectrum.
Source Code:
clc;
clear
all;
close
all;
fm=20;
fc=200;
am=1;
fs=10*fc;
t=0:(1/fs):(6/fm);
m=am*sin(2*pi*fm*t);
figure;
subplot(4,1,1);
plot(t,m);
xlabel("time");
ylabel("amplitude");
title("message signal");
y=modulate(m,fc,fs,'am');
subplot(4,1,2);
plot(t,y);
xlabel("time");
ylabel("amplitude")
title("am modulated
signal"); f=abs(fft(y));
subplot(4,1,3);
plot(t,f);
xlabel("frequency")
;
ylabel("magnitude")
; title("am
spectrum"); figure;
subplot(4,1,1);
plot(t,m);
xlabel("time");
ylabel("amplitude");
title("message signal")
g=fmmod(m,fc,fs,70);
subplot(4,1,2);
plot(t,g);
xlabel("time");
ylabel("amplitude")
title("fm modulated
signal"); f1=abs(fft(g));
subplot(4,1,3);
plot(t,f1);
xlabel("frequency")
;
ylabel("magnitude")
; title("fm
spectrum");
Conclusion:
Hence, generated and analysed spectrum of AM & FM.