Lab 4 Zaheer Abbas (Communication System) BEE-FA18-02

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

Experiment No 4: To study Amplitude modulation using MATLAB.

Objectives:
You will learn following.
 Explain Amplitude modulation
 MATLAB code to perform its Fourier transform.
 Find Fourier transform of modulated signal,
 Compare the effects of modulation in Time domain and frequency domain .

Name: Zaheer Abbas

Date: 18\03\2021

Rubrics

Performances Lab
Report
Total Marks Total Marks
Description Description
Marks Obtained Marks Obtained
Experimen Organization
t related 10 05
Knowledge / Structure
Data
10 Data Presentation 05
Analysis
Total Marks Obtained

Remarks (if any):

Name & Signature of faculty:

COMMUNICATION SYSTEMS LAB,


SCHOOL OF ELECTRICAL ENNGINEERING,
THE UNIVERSITY OF FAISALABAD
Apparatus:
 Computer
 Matlab Software

Amplitude modulation:
Amplitude modulation is a process by which the wave signal is transmitted
by modulating the amplitude of the signal. It is often called as AM and is used in
transmitting a piece of information. Amplitude modulation is mostly used in the
form of electronic communication.

Types of Amplitude Modulation:


 Double Sideband Suppressed Carrier (DSB SC) Introduction.
 Double side-band full carrier (Traditional Amplitude Modulation)
Introduction.
 Quadrature Amplitude Modulation (QAM) Block Diagram.
 Single sideband (SSB) Bandwidth.
 Vestigial sideband (VSB) Bandwidth.

Mathematical expression:
Time-domain Representation of the Waves. Let the modulating signal be,

And the carrier signal be,

Am and Ac are the amplitude of the modulating signal and the carrier signal
respectively.
fm and fc are the frequency of the modulating signal and the carrier signal
respectively.
Then, the equation of Amplitude Modulated wave will be

COMMUNICATION SYSTEMS LAB,


SCHOOL OF ELECTRICAL ENNGINEERING,
THE UNIVERSITY OF FAISALABAD
Difference between AM and FM:
 Amplitude Modulation
The amplitude of a carrier varies depending on the information signal. AM
radio broadcast signals use lower carrier frequencies, this helps them to travel
long distances. Sometimes AM signals can be able to bounce off the
ionosphere. The distance travelled by the AM is much larger than the FM.
 Frequency Modulation
In this module, the frequency of the carrier wave is modified according to the
signal that carries information. The radio signals have large bandwidth than
AM radio signals, which helps to offer much better sound quality. Frequency
modulation also enables to transmit stereo signals.
The main difference between both modulations is that in frequency modulation,
the frequency of the carrier wave is modified as per the transmit data, while
in amplitude modulation, the carrier wave is modified according to the data.

Effects on Frequency Spectra:


 In the frequency domain, amplitude modulation corresponds to translating
the baseband spectrum to a band surrounding the carrier frequency.
 Because the baseband spectrum is symmetrical with respect to the y-axis,
this frequency translation results in a factor-of-2 increase in bandwidth.
Procedure:
1. Open Matlab
2. Create new ‘M’ file
3. Type code written below
4. Then execute the code to compute and plot desired signals.
Find its Fourier transform:
Code:1
Ts = 1/50;
t = 0:Ts:10-Ts;
x = sin(2*pi*15*t) + sin(2*pi*20*t);
plot(t,x)
xlabel('Time (seconds)')
ylabel('Amplitude')

Amplitude

COMMUNICATION SYSTEMS LAB,


SCHOOL OF ELECTRICAL ENNGINEERING,
THE UNIVERSITY OF FAISALABAD
Time (second)
Code:2
y = fft(x);
fs = 1/Ts;
f = (0: length(y)-1)*fs/length(y);
When you plot the magnitude of the signal as a function of frequency, the spikes in
magnitude correspond to the signal's frequency components of 15 Hz and 20 Hz.
plot (f,abs(y))
xlabel('Frequency (Hz)')
ylabel('Magnitude')
Title ('Magnitude')

Magnitude

Frequency (Hz)

COMMUNICATION SYSTEMS LAB,


SCHOOL OF ELECTRICAL ENNGINEERING,
THE UNIVERSITY OF FAISALABAD
Amplitude modulation to the base signal:
Code:
Fs = 8000; % Sampling Rate
Fc = 300; % Carrier frequency
t = 0:0.0001:0.1; % Sampling time
x = sin (20*pi*t); % Representation of Modulating Signal
y = ammod (x, Fc, Fs); % Modulate x to produce y
figure;
subplot(2,1,1); plot (t , x); % Plot x on top
subplot(2,1,2); plot (t , y); % Plot y below

Output

COMMUNICATION SYSTEMS LAB,


SCHOOL OF ELECTRICAL ENNGINEERING,
THE UNIVERSITY OF FAISALABAD
Fourier transform of modulated signal:
Code:
clc
clear
close
Ac = 2; %carrier amplitude
fc= 0.5; %carrier frequency
Am = 0.5. %message signal amplitude
Fm = 0.05. %message signal frequency
%The signal and carrier frequency is taken small for now, to make the response visible
Fs = 100; %sampling rate/frequency
Ka = 0.5. %modulation coefficient
T=[0:0.1:100]; %defining the time range & disseminating it into samples
Ct= Ac*Cos(2*pi*fc*t); %defining the carrier signal wave
mt=Am*cos(2*pi*fm*t); %defining the message signal
AM=ct.*(1+ka*mt); %Amplitude Modulated wave, according to definition
plot(AM, 'b');
hold on;
N = length(AM)
X = fft(AM,N); % Find FFT of the Amplitude Modulated Signal
%Assuming there is a symmetry in spectrum we will fold and add the ]spectrum
%creating a new analytical signal and pad zeros to maintain N point FFT size
if(rem(N,2)==0)
envelope = ifft([zeros(1,N/2-1) X(1) 2*X(2:N/2) X(N/2+1) ],N);
else
envelope = ifft([zeros(1,(N+1)/2) X(1) 2*X(2:N/2) X((N+1)/2) ],N);
end
%we use 2*X(2:N/2) since by folding and adding through f=0 (i.e., X(1)) we
%creating a new analytical signal and pad zeros to maintain N point FFT size
plot(abs(envelope), 'r');
%Upper envelope
plot(-abs(envelope), 'k');
%Lower envelope
xlabel('Sample Index')
ylabel('Amplitude')
axis('tight')
hold off

COMMUNICATION SYSTEMS LAB,


SCHOOL OF ELECTRICAL ENNGINEERING,
Output:
THE UNIVERSITY OF FAISALABAD

Amplitude upper envelope


Lower envelope

Sample index
The effects of modulation in Time domain and frequency domain:
the equation for the amplitude modulated waveform if the information signal is a single sine
wave .We already know the frequency domain representations of the modulating signal (vm(t))
and the carrier signal (vc(t))

Amplitude

time

COMMUNICATION SYSTEMS LAB,


Amplitude
SCHOOL OF ELECTRICAL ENNGINEERING,
THE UNIVERSITY OF FAISALABAD
Frequency
 A spectrum is different frequency components in any signal. It’s like the
display on the graphic-equalizer in your stereo which has led showing the
relative amounts of bass, midrange and treble.
 These correspond directly to increasing frequencies. It is a well-known fact
of mathematics, that any function (signal) can be decomposed into purely
sinusoidal components.
 In technical terms, the sins and cosines form a complete set of functions, also
known as a basis in the infinite-dimensional vector space of real-valued
functions.
 Given that any signal can be thought to be made up of sinusoidal signals, the
spectrum then represents the "recipe card" of how to make the signal from
sinusoids.
 Like: 1 part of 50 Hz and 2 parts of 200 Hz. Pure sinusoids have the simplest
spectrum of all, just one component:
Amplitude

time

COMMUNICATION SYSTEMS LAB,


SCHOOL OF ELECTRICAL ENNGINEERING,
THE UNIVERSITY OF FAISALABAD
Amplitude

Time
Code:
Clc
Close all
Clear all
T=0:.001:1;
Fc=input(’ enter frequency of carrier Sin wave :’);
fm=input(‘enter message frequency :’);
Amp=input (Enter carrier & message amplitude (Assuming. Both equal:’);
C=amp .* Sin (2xpi*fc*t); % generating carrier sin
Subplot (3,1,1) % for plotting the carrier wave
Plot(t;c)
xLabel (‘time’)
ylabel (‘amplitude ‘)
title (‘caerier’)
m=square (2*pi*fm*t);%. For plotting message signal
subplot (3,1,2)
plot (t,m)
xlable (‘time’)
ylable (‘amplitude ‘)
title(‘message signal ‘)% Sin wave multiplied with squre wave in order to generate psk
x=c.*m;
subplot(3,1,3)
plot(t,x)
xlable (‘t’)
ylable (‘y’)
title (‘psk’)

COMMUNICATION SYSTEMS LAB,


SCHOOL OF ELECTRICAL ENNGINEERING,
THE UNIVERSITY OF FAISALABAD
COMMUNICATION SYSTEMS LAB,
SCHOOL OF ELECTRICAL ENNGINEERING,
THE UNIVERSITY OF FAISALABAD

You might also like