Beruflich Dokumente
Kultur Dokumente
FM MODULATION IN MATLAB
8.1 OBJECTIVE
is
programming
language
and
numerical
Laboratory.
As
it
name
suggests
it
allows
easy
mostly
used
are
arithmetic
operators
and
matrix
The
mathematical
The
functions
sin
and
cosareself
explanatory.
8.5 PROGRAM
clc;
clearall;
closeall;
fm=25;
fc=400;
mf=10;
t=0:0.0001:0.1;
m=sin(2*pi*fm*t);
subplot(3,1,1);
plot(t,m);
xlabel('Time(s)');
ylabel('Amplitude(V)');
title('Message Signal');
grid on;
c=sin(2*pi*fc*t);
subplot(3,1,2);
plot(t,c);
xlabel('Time(s)');
ylabel('Amplitude(V)');
title('Carrier Signal');
grid on;
y=sin(2*pi*fc*t+(mf.*sin(2*pi*fm*t)));%Frequency changing w.r.t
Message signal
subplot(3,1,3);
plot(t,y);
xlabel('Time(s)');
ylabel('Amplitude(V)');
title('Frequency modulated Signal');
grid on;
2
8.10LAB RESULT:
Thus the Frequency modulation was simulated and performed
using MATLAB.
is
programming
language
and
numerical
Laboratory.
As
it
name
suggests
it
allows
easy
The
9.5 ALGORITHM:
1. To generate message and carrier signal ,initialize :
fc(carrier frequency),
fm(modulating signal frequency),
fs(sampling frequency),
2. Generate message signal and carrier signal
3. Multiply message and carrier signal to get DSBSC modulated
signal in time domain.
4. Take fourier transform of DSBSC modulated signal
to get the
% DSB-SC MODULATION
z1= xm.*xc;
figure(2)
subplot(2,1,1),plot(t,z1);
title('DSB-SC MODULATION IN TIME DOMAIN');
xlabel('time (s)');
ylabel('amplitude (V)');
f = fs * (0 : N/2) / N;%Since the fft result is symmetrical, only the
%positive half is sufficient for spectral representation
M1 = 2/N*abs(fft(z1,N));
subplot(2,1,2); %Frequency Domain Plot
plot(f(1:256),M1(1:256));
title('DSB-SC MODULATION IN FREQUENCY DOMAIN');
xlabel('Frequency (Hz)');
ylabel('amplitude (V)');
9.6. PRE LAB QUESTIONS:
5. Now start typing your program. After completing, save the Mfile with appropriate name. To execute the program Press F5 or
go to Debug Menu and select Run.
6. After execution output will appear in the Command window .If
there is an error then with an alarm, type of error will appear
in red color.
7. Rectify the error if any and go to Debug Menu and select Run.
11
Fig.
9.3 Carrier signal
Fig. 9.4 DSB-SC Modulated signal in time domain
12
9.10LAB RESULT:
Thus the DSB-SC modulation was simulated and performed using
MATLAB.
13
and
is
programming
language
and
numerical
Laboratory.
As
it
name
suggests
it
allows
easy
14
The
t(time axis)
(modulating signal amplitude)
(Carrier signal amplitude)
2. Generate message signal and carrier signal
3. Apply Hilbert transform to the message signal.
4. write the expression for LSB or USB as per the requirement
LSB
=message
*carrier(cosine)+Hilbert
transform
of
*carrier(cosine)-Hilbert
transform
of
message*carrier(sine)
USB
=message
message*carrier(sine)
5. Take fourier transform for LSB or USB to get the desired frequency
spectrum for modulated signal.
6.. For demodulation, multiply LSB
10.6 PROGRAM
N = 1024;
fs = 2048;
ts = 1/fs;
t=(0:N-1)/fs;
fc = 600; % Limit fc<800 to avoid freqdomain aliasing
fm = 100;
Vm = 1;
Vc = 1;
m = Vm*cos(2*pi*fm*t);%Message
mh = Vm*cos((2*pi*fm*t)-pi/2);%Hilbert transform of the messagesignal
c=Vc*sin(2*pi*fc*t);
16
close all;
figure(3)
subplot(221);
plot(10*t(1:200),sbu(1:200),'r');%Time Domain Plot of USB
title('Time Domain Representation === USB');
xlabel('Time(s)'); ylabel('Amplitude(V)');
subplot(222)
plot(10*t(1:200),sbl(1:200),'b');%Time Domain Plot of LSB
title('Time Domain Representation === LSB');
xlabel('Time(s)'); ylabel('Amplitude(V)');
subplot(223);
plot(freq,SBU(1:N/2+1))
title('Frequency Domain Representation');
xlabel('Frequency(Hz)'); ylabel('Amplitude(V)');
legend('USB');
subplot(224)
plot(freq,SBL(1:N/2+1)); %Frequency domain plot
title('Frequency Domain Representation');
xlabel('Frequency(Hz)'); ylabel('Amplitude(V)');
legend('LSB');
figure(4)
plot(freq,SBU(1:N/2+1),freq,SBL(1:N/2+1));
title('Frequency Domain Representation');
xlabel('Frequency(Hz)'); ylabel('Amplitude(V)');
legend('USB','LSB');
%Demodulation:
md=sbu.*cos(2*pi*fc*t);
[b,a]=butter(2,0.1);
mf=filter(b,a,md);
figure(5)
17
plot(t,mf)
title('Demodulated Signal');
xlabel('Time(s)'); ylabel('Amplitude(V)');
figure(1);
plot(t,m);
xlabel('Time(s)'); ylabel('Amplitude(V)');
title('message signal');
figure(2);
plot(t,c);
title('Carrier signal');
xlabel('Time(s)'); ylabel('Amplitude(V)');
18
1. Define SSB-SC.
2. What are the advantages of signal sideband transmission?
3. What are the disadvantages of single side band transmission?
4. What are the methods for generating SSB-SC signal?
5. Compare AM with SSBSC
10.8 LAB PROCEDURE:
1 Open the MATLABsoftware by double clicking its icon.
2. MATLABlogo will appear and after few moments Command
Prompt will appear.
3. Go to the File Menu and select a New M-file. (File NewMfile) or in the left hand corner a blank white paper icon will be
there. Click it once.
4. A blank M-file will appear with a title untitled
5. Now start typing your program. After completing, save the Mfile with appropriate name. To execute the program Press F5 or
go to Debug Menu and select Run.
6. After execution output will appear in the Command window .If
there is an error then with an alarm, type of error will appear
in red color.
7. Rectify the error if any and go to Debug Menu and select Run.
10.9 MODEL GRAPH
19
20
21
3.
SSB is suitable for speech signals and not for video signals.
Why?
4.
5.
22