Experiment 4 - Frequency Modulation using Scilab

advertisement
EXPERIMENT 4
FREQUENCY MODULATION USING SCILAB
1.0 OBJECTIVES:
1.1 To perform he frequency modulation simulation using Scilab.
1.2 To analyze the frequency-modulated signal in time domain and frequency domain
representation.
1.3 To plot the frequency spectrum of frequency-modulation signal using Scilab.
2.0
Equipment / Apparatus
1.0 SCILAB Software
3.0
INTRODUCTION
Before an information signal is transmitted through a communication channel, some type
of modulation process is typically utilized to produce a signal that can easily be
accommodated by the channel. There are three properties of an analog signal that can
be varied (modulated) by the information signal. Those properties are amplitude,
frequency
and phase. In previous lab, we have deal with amplitude modulation.
Phase modulation (PM) and frequency modulation (FM) are both forms of angle
modulation. The main difference between angle modulation and amplitude modulation is
that in angle modulation, the information is contained in the angle of the carrier whereas
in amplitude modulation, the information is in the amplitude of the carrier. We will be
dealing only with FM in this lab. The theories and concepts are similar for PM.
FREQUENCY MODULATION:
In FM, the phase angle of a carrier signal Ac cos(2πfct) is varied proportionally to the
integral of the message signal x(t), the frequency modulated signal xc(t) is:
(1)
where kf is a constant. The instantaneous frequency of the FM signal is given by:
(2)
In the special case of tone-modulated FM, the message signal is a sinusoid
EKT231 – COMMUNICATION SYSTEM
the instantaneous phase deviation of the modulated signal is
(3)
and the modulated signal is given by:
(4)
where the parameter β is called the modulation index defined as
(5)
(6)
and represents the maximum phase deviation produced by the message signal. The
parameter ∆f represents the peak frequency deviation of the modulated signal. The
modulation index is defined only for tone modulation.
The calculation of the spectrum of an FM signal is difficult since frequency modulation is
a nonlinear process. However, for the special case of tone-modulation an equivalent
expression for Eq.(4) is
(7)
This equation describes the modulated signal as a series of sinusoids whose coefficients
Jn(β) are given by the Bessel function of the first kind and nth order.
The bandwidth of the tone-modulated FM signal can be estimated by the Carlson’s rule,
and it depends on the modulation index and the frequency of the modulating tone:
(8)
From this equation it can be noticed that a small value of β << 1 will result in a bandwidth
of about 2fx. Modulated signals with this condition are referred to as narrowband FM
signals. Large values of the modulation index will produce signals with relatively large
bandwidth, or wideband FM signals.
The examples below show how to use Scilab Software to produce frequency modulation
signals in time domain and frequency domain. Study the source code given and simulate
to see the plotting signal.
EKT231 – COMMUNICATION SYSTEM
I)
Plotting frequency modulation signal in time domain
This source-code is to plot frequency modulation signal in time domain representation.
Example 1:
t= 0:1/1000:1;
// declare time interval
Ac = 9;
// amplitude of carrier signal
Am = 4;
// amplitude of modulating signal
fc = 100;
// carrier frequency
fm = 50;
// modulating frequency
//Carrier signal
Vc = Ac *cos (((2*%pi)*fc)*t);
//Modulating signal
Vm = Am * sin (((2*%pi)*fm)*t);
//Frequency modulation signal
m = 2; //modulation index
Vfm = Ac*cos(((( 2*%pi)*fc)*t)+m*sin(((2*%pi)*fm)*t));
// plot signal
subplot (311);
plot (t, Vm)
title (‘Modulating signal’)
subplot (312);
plot (t,Vc);
title (‘Carrier signal’)
subplot (313);
plot (t,Vfm)
title (‘Frequency modulating signal’)
EKT231 – COMMUNICATION SYSTEM
II) Plotting frequency modulation signal in both time and frequency domain.
We now consider the calculation of the spectrum of an FM (or PM) signal using the FFT
algorithm. As can be seen from the Scilab soure-code, a modulation index of 3 is
assumed.
Example 2:
N = 1024;
// Number of points
fs = 4096;
// Sampling frequency
t = (0:N-1)/fs;
// Time vector
fm = 50;
// Message Freq 1
Em = 3;
// Amplitude of modulating signal
m = 3;
// Modulation Index
fc = 300;
// Carrier frequency
Vm = Em*cos(2*%pi*fm*t); // Modulating signal
// Frequency Modulation (FM)
Vfm = cos(2*%pi*fc*t+Vm);
Vf
=
(2/N)*abs(mtlb_fft(Vfm,2048))1024;
//Frequency
modulation in time domain
f = (fs*(0:N/2))/N;
subplot(2,1,1); //Time domain plot
plot(t(1:N/2),Vfm(1:N/2),t(1:N/2),Vm(1:N/2),"r");
title(‘Time Domain Representation’);
xlabel(‘Time’);
ylabel(‘Modulated signal’);
subplot(2,1,2);
//Frequency Domain Plot
plot(f(1:256),Vf(1:256));
title(‘Frequency Domain Representation’);
xlabel(‘Frequency (Hz)’);
ylabel(‘Spectral Magnitude’);
EKT231 – COMMUNICATION SYSTEM
III) Plotting FM frequency Spectrum
In this example, we consider a Scilab program to computing the amplitude spectrum of
an FM (or PM) signal having a message signal consisting of a pair of sinusoids. The
single-sided amplitude spectrum is calculated. The single-sided spectrum is determined
by using only the positive portion of the spectrum represented by the first N/2 points
generated by the FFT program. In the following Scilab code, N is represented by the
variable number of points.
Example 3:
fs = 1000;
// sampling frequency
delt = 1/fs;
//sampling increment
t = 0:delt:1-delt;
//time vector
N=1024
// number of points
fn = (0:N/2)*(fs/N);
// frequency vector for plot
m1 = 2*cos(((2*%pi)*50)*t);
// modulation signal 1
m2 = 2*cos(((2*%pi)*50)*t) + 1*cos(((2*%pi)*5)*t); //modulation
signal 2
xc1 = sin((((2*%pi)*250)*t)+m1);
// modulated carrier 1
xc2 = sin((((2*%pi)*250)*t)+m2);
// modulated carrier 2
asxc1 = (2/N)*abs(fft(xc1));
// amplitude spectrum 1
asxc2 = (2/N)*abs(fft(xc2));
//amplitude spectrum 2
ampspec1 = asxc1(1:((N/2)+1));
// positive frequency portion 1
ampspec2 = asxc2(1:((N/2)+1));
// positive frequency portion 2
subplot(211)
plot2d(fn,ampspec1)
xlabel('Frequency - Hz');
ylabel('Amplitude');
subplot(212)
plot(fn, ampspec2, 'k');
xlabel('Frequency - Hz');
ylabel('Amplitude');
EKT231 – COMMUNICATION SYSTEM
4.0 QUESTIONS:
1. Why we are using FFT algorithm in the Scilab program?
2. What is the carrier frequency used in Example 2 and 3?
3. Perform the following instructions:
i)
Create a vector time 't' that varies from zero to one cycle with an interval 1/1000
or 1/5000
ii)
Create a message and carrier signal with a single sine frequency. Use the
following values:
-
Amplitude of carrier signal = 5V
-
Amplitude of carrier signal = 7V
-
Carrier frequency = 100 Hz
-
Modulating frequency = 20 Hz
iii) Create the modulated signal using FM equation. The value of modulation index is
equals to 5.
iv) Plot and label the FM signal in time and frequency domain.
4. Given the message signal in a form of sinusoidal signal as below:
x
(
t
)

cos
2

(
25
)
t

cos
2

(
15
)
t
The modulation is given by
m
(
t
)

2
sin
2

(
25
)
t

4
sin
2

(
15
)
t
The modulated carrier signal becomes
x
(
t
)

cos[
2

(
300
)
t

2
sin
2

(
25
)
t

4
sin
2

(
15
)
t
]
c
Use Scilab to illustrate the single-sided amplitude spectrum of the above.
EKT231 – COMMUNICATION SYSTEM
Download