Sie sind auf Seite 1von 23

8.

FM MODULATION IN MATLAB
8.1 OBJECTIVE

To perform the Frequency Modulation simulation using


MATLAB
8.2 SOFTWARE REQUIRED
MATLAB ,Computer installed with Windows XP or higher
Version..
8.3 MATLAB INTRODUCTION
MATLAB

is

programming

language

and

numerical

computing environment. The name MATLAB is an acronym for


Matrix

Laboratory.

As

it

name

suggests

it

allows

easy

manipulation of matrix and vectors. Plotting functions and data is


made easy with MATLAB. It has a good Graphic User Interface and
conversion of matlab files to C/C++ is possible. It has several
toolboxes that possess specific functions for specific applications.
For example Image Processing, Neural Networks, CDMA toolboxes
are name a few. An additional package, Simulink, adds graphical
multidomain simulation and Model-Based Design for dynamic and
embedded systems. Simulink contains Blocksets that is analogous
to Toolboxes.It was created by Mathworks Incorporation, USA.
MATLAB has become a defacto programming language for
Engineers.Writing MATLAB programs for modulation applications
require knowledge on very few functions and operators. The
operators

mostly

used

are

arithmetic

operators

and

matrix

operators. To know more type in the command prompt help ops.


MATLAB will give a list in that to know on specific operator say
addition type in the command prompt help plus. MATLAB will give
how to use and other relevant information.
Commonly used graphical functions are plot, figure, subplot,
title, and mathematical functions are sin and cos only.

The

mathematical

The

functions

sin

and

cosareself

explanatory.

graphical function figure will create a new window and then

subsequent graphical commands can be applied. The plot function


usually takes two vectors and plot data points according to given
vector data. In this case it will time Vs signal. Subplot function is
used when two or more plots are drawn on the same figure. As title
function suggests it helps to write title of the graph in the figure. For
further details type help plot or help subplot in the command
prompt and learn the syntax.
8.4 ALGORITHM
I. To generate message and carrier signal ,initialize :
fc(carrier frequency),
fm(modulating signal frequency),
t(time axis)
2. Generate message signal as Sin(2fmt)
3. Generate carrier signal as sin(2fct).
4. Generate the frequency modulated signal using the FM equation
[sin(2fct+mfSin(2fmt) ] where mf stands for modulation index.
Choose modulation ivdex value more than 1.
5. Plot all the signals

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.6 PRELAB QUESTIONS


1. An FM signal has an intelligence frequency of 2 kHz and a
maximum deviation of 10 kHz. If its carrier frequency is set at
2.
3.
4.
5.

162 MHz, what is its index of modulation?


Define modulation index for FM.
Compare FM and PM.
What is capture effect?
What is the IF Frequency for FM superheterodyne receiver?

8.7 MODEL GRAPH

Fig 8.1 Message signal

Fig 8.2 Carrier signal

Fig 8.3 Frequency modulated signal

8.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 NewM-file)
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 M-file
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.

8.9. POST LAB QUESTIONS:


1. Mention advantages of angle modulation over amplitude modulation
2. What is the bandwidth required for an FM wave in which the
modulating frequency signal is 2 KHz and the maximum
frequency deviation is 12 KHz?
3. What is Narrowband FM?
4. Write the functions of limiter?
5. Write short notes on direct method of FM generation.

8.10LAB RESULT:
Thus the Frequency modulation was simulated and performed
using MATLAB.

9. DSB-SC MODULATION IN MATLAB


9.1 OBJECTIVE
To perform double side band suppressed (DSB-SC) modulation
and observe the DSB SC spectra using MATLAB
9.2 SOFTWARE REQUIRED:
MATLAB, Computer installed with Windows XP or higher
Version.
9.3 MATLAB INTRODUCTION
MATLAB

is

programming

language

and

numerical

computing environment. The name MATLAB is an acronym for


Matrix

Laboratory.

As

it

name

suggests

it

allows

easy

manipulation of matrix and vectors. Plotting functions and data is


made easy with MATLAB. It has a good Graphic User Interface and
conversion of matlab files to C/C++ is possible. It has several
toolboxes that possess specific functions for specific applications.
For example Image Processing, Neural Networks, CDMA toolboxes
are name a few. An additional package, Simulink, adds graphical
multidomain simulation and Model-Based Design for dynamic and
embedded systems. Simulink contains Blocksets that is analogous
to Toolboxes. It was created by Mathworks Incorporation, USA.
Writing MATLAB programs for modulation applications require
knowledge on very few functions and operators. The operators
mostly used are arithmetic operators and matrix operators. To know
more type in the command prompt help ops. MATLAB will give a list
in that to know on specific operator say addition type in the
command prompt help plus. MATLAB will give how to use and other
relevant information.
Commonly used graphical functions are plot, figure, subplot,
title, and mathematical functions are sin and cos only.

The

mathematical functions sin and cos are self-explanatory. The


6

graphical function figure will create a new window and then


subsequent graphical commands can be applied. The plot function
usually takes two vectors and plot data points according to given
vector data. Subplot function is used when two or more plots are
drawn on the same figure. As title function suggests it helps to write
title of the graph in the figure. For further details type help plot or
help subplot in the command prompt and learn the syntax.
9.4 THEORY:
DSB-SC is basically an amplitude modulation wave without the
carrier, therefore reducing power waste, giving it a 50% efficiency.
This is an increase compared to normal AM transmission, (DSB) has
a maximum efficiency of 33.333%, since 2/3 of the power is in the
carrier which carries no intelligence, and each sideband carries the
same information. Single Side Band (SSB) Suppressed Carrier is
100% efficient.
9.4.1 GENERATION
DSB-SC is generated by a mixer. This consists of a message signal
multiplied by a carrier signal.

Fig 9.1 Product modulator

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

signal in frequency spectrum.


5. Plot all the signals
9.6 PROGRAM:
N = 1024; %N point FFT N>fc to avoid freq domain aliasing
fs = 4096; % Sample frequency
t = (0:N-1)/fs;
fc = 600; %Carrier Frequency
fm = 80; %Message Frequency
Ec = 20; %Carrier Amplitude
Em = 5; %Messagae Amplitude
xc=Ec*cos(2*pi*fc*t);
xm=Em*cos(2*pi*fm*t);
figure(1)
subplot(2,1,1),plot(t,xc);
title('carrier signal of 600Hz');
xlabel('time (s)');
ylabel('amplitude(V)');
subplot(2,1,2),plot(t,xm);
title('message signal of 80Hz');
xlabel('time (s)');
ylabel('amplitude(V)');
9

% 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:

1. What is the difference between DSB SC and SSB SC?


2. What are the applications of DSBSC?
3. Write the methods of DSBSC generation.
4. What is the BW for single tone modulating signal with
frequency ?
5. What is the percentage of power saving for DSBSC when
compared with AM having 100% depth of modulation?
9.7 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
10

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.

9.8 MODEL GRAPH

Fig. 9.2 Modulating signal

11

Fig.
9.3 Carrier signal
Fig. 9.4 DSB-SC Modulated signal in time domain

Fig. 9.5 DSB-SC Modulated signal in frequency domain

12

9.9 POST LAB QUESTIONS:

1 Which type of carrier is used in ring modulator?


2. What is the difference between DSB-FC and DSB-SC?
3. What are the advantages of DSB SC?
4. What is a Balanced modulator?
5. Write the general equation of DSBSC signal.

9.10LAB RESULT:
Thus the DSB-SC modulation was simulated and performed using
MATLAB.

13

10 .SSB-SC Modulation and Demodulation in


MATLAB
10.1 OBJECTIVE
To perform Single side band (SSB-SC) modulation

and

demodulation and observe the SSB spectra using MATLAB


10.2 SOFTWARE REQUIRED:
MATLAB, Computer installed with Windows XP or higher
Version.
10.3 MATLAB INTRODUCTION
MATLAB

is

programming

language

and

numerical

computing environment. The name MATLAB is an acronym for


Matrix

Laboratory.

As

it

name

suggests

it

allows

easy

manipulation of matrix and vectors. Plotting functions and data is


made easy with MATLAB. It has a good Graphic User Interface and
conversion of matlab files to C/C++ is possible. It has several
toolboxes that possess specific functions for specific applications.
For example Image Processing, Neural Networks, CDMA toolboxes
are name a few. An additional package, Simulink, adds graphical
multidomain simulation and Model-Based Design for dynamic and
embedded systems. Simulink contains Block sets that are analogous
to Toolboxes. It was created by Math works Incorporation, USA.
Writing MATLAB programs for modulation applications require
knowledge on very few functions and operators. The operators
mostly used are arithmetic operators and matrix operators. To know
more type in the command prompt help ops. MATLAB will give a list
in that to know on specific operator say addition type in the
command prompt help plus. MATLAB will give how to use and other
relevant information.

14

Commonly used graphical functions are plot, figure, subplot,


title, and mathematical functions are sin and cos only.

The

mathematical functions sin and cos are self-explanatory. The


graphical function figure will create a new window and then
subsequent graphical commands can be applied. The plot function
usually takes two vectors and plot data points according to given
vector data. Subplot function is used when two or more plots are
drawn on the same figure. As title function suggests it helps to write
title of the graph in the figure. For further details type help plot or
help subplot in the command prompt and learn the syntax.
10.4 Theory:
An SSB signal is produced by passing the DSB signal through a
highly selective band pass filter. This filter selects either the upper
or the lower sideband. Hence transmission bandwidth can be cut by
half if one sideband is entirely suppressed. This leads to single
sideband modulation (SSB). In SSB modulation bandwidth saving is
accompanied by a considerable increase in equipment complexity.
In DSB-SC it is observed that there is symmetry in the band
structure. So, even if one half is transmitted, the other half can be
recovered at the received. By doing so, the bandwidth and power of
transmission is reduced by half. Depending on which half of DSB-SC
signal is transmitted, there are two types of SSB modulation
1. Lower Side Band (LSB) Modulation
2. Upper Side Band (USB) Modulation
10.5 ALGORITHM:
1. To generate message and carrier signal ,initialize :
fc(carrier frequency),
(modulating signal frequency),
fs(sampling frequency),
N( N point DFT-no of samples)
15

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

with carrier (cosine) and apply

butterworth filter to get demodulated signal or multiply USB with


carrier(sine) and apply butterworth filter to get demodulated signal.
7. Plot all the signals

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);

sbu = m.*2.*cos(2*pi*fc*t)-mh.*2.*sin(2*pi*fc*t);%Expression for USB


sbl = m.*2.*cos(2*pi*fc*t)+mh.*2.*sin(2*pi*fc*t);%Expression for LSB

16

SBU = 2/N*abs(fft(sbu)); %Fourier Transform of USB


SBL = 2/N*abs(fft(sbl)); %Fourier Transform of LSB
freq = fs * (0 : N/2) / N;

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

10.7. PRE LAB QUESTIONS:

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

Fig.10.1 Message Signal

Fig.10.2 Carrier Signal

Fig. 10.3 Time domain representation of USB

Fig. 10.4 Time domain representation of LSB

20

Fig. 10.5 Frequency domain representation of USB

Fig. 10.6 Frequency domain representation of LSB

Fig. 10.7 Demodulated Signal

21

10.9 POST LAB QUESTIONS:

1. When is the figure of merit of SSB-SC system is unity?


2.

Compare the noise performance of AM receiver with that of


SSB-SC receiver.

3.

SSB is suitable for speech signals and not for video signals.
Why?

4.

Mention Some applications of SSB-SC.

5.

What do you mean by Hilbert transform and inverse Hilbert


Transform? Write few applications of Hilbert transform?

10.10 LAB RESULT:


Thus the SSB-SC modulation and demodulation were simulated and
performed using MATLAB.

22

Das könnte Ihnen auch gefallen