ADC Labs

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 19

LAB REPORT

Analog & Digital Communication

Submitted By:
Afnan Javaid

Submitted To:
Ma’am Maira Waseem

Registration No:
2020-UET-NFC-FD-Elect-11
Section:
A
Session:

(2020-2024)
Experiment No. 1
Introduction to MATLAB & SIMULINK

Objective:
1.) To familiarize the Student with MATLAB.

2.) To familiarize the Student with SIMULINK in MATLAB environment.

Theory:
MATLAB:
MATLAB stands for Matrix Laboratory. It includes High Level commands
of 2 and 3-dimensional matrix for data visualization.
MATLAB is a programming platform designed specifically for engineers and
scientists to analyze and design systems and products that transform our world. The
heart of MATLAB is the MATLAB language, a matrix-based language allowing the
most natural expression of computational mathematics.
Uses:
Millions of engineers and scientists worldwide use MATLAB
 Signal processing and communications
 Image and video processing
 Test and measurement
 Computational finance and computational biology.

Command Windows in MATLAB:

1. Main Window:
The MATLAB Command Window is the main window where you type
commands directly to the MATLAB interpreter. From main window we can
navigate through different options of the software in order to interact with
the commands.
2. Command Window:
In this window we can write our program line by line but we cannot undo
the previously run codes.

3. Command History:
This window contains the history of lines of the code that was previously
entered.

Matrix Operations:

1. Creating a Matrix:
Let's create a simple vector with 6 elements called a.

a = [9 2 4 3 4 5]
a = 1×6
2. Addition of number to a Matrix:

Now let's add 2 to each element of our vector, a, and store the
result in a new vector.
Notice how MATLAB requires no special handling of vector or
matrix math.
b=a+2
b = 1×6

3. Plotting Graph in MATLAB:


Creating graphs in MATLAB is as easy as one command. Let's plot the
result of our vector addition with grid lines.
plot(b)
grid on

4. Transpose of a Matrix:
We can easily find the transpose of the matrix a.
A = [1 2 0; 2 5 -1; 4 10 -1]
A = 3×3
B = A'
5. Multiplication of Two Matrices
MATLAB doesn't require you to deal with matrices as a collection of
numbers. MATLAB knows when you are dealing with matrices and
adjusts your calculations accordingly.

C = A * B

Instead of doing a matrix multiply, we can multiply the corresponding elements


of two matrices or vectors using the .* operator.
C = A .* B

Commands Introduction:
 clc:
The clc command will clear the command window from previously
executed code.
 clear all:
This command will clear the variable matrices data from the workspace
window.
 linspace:
This command will let us use the range between two numbers that is
divided into 100 equally spaced points.
 global:
This command will declares variables to be global.
 help:
This command will searches for a help topic.
Experiment No. 2
Fourier Series using MATLAB

Objective:
To create MATLAB Program for Trigonometric Series.

Theory:
Fourier Series:
A Fourier series is a method used to represent a periodic function as an
infinite sum of sine and cosine functions. Fourier series is used for periodic
functions. For the non-periodic functions, Fourier transform is considered.
The computation and study of Fourier series is known as harmonic analysis
and is extremely useful as a way to break up an arbitrary periodic function into a set of
simple terms that can be plugged in, solved individually, and then recombined to
obtain the solution to the original problem or an approximation to it to whatever
accuracy is desired or practical.
The motivation for introducing Fourier series seems to be to solve ordinary
differential equations for forced oscillations and to approximate periodic functions.
Later, applications to partial differential equations are presented, much in line with the
motivation behind Fourier's original work.

 Task 1
Implementing Basic values as Variables:

Result:
 Task 2
Calculate Co-efficient of our function:

Result:

 Task 3
For Multiple Co-efficients using Loop:
Result:

 Task 4
COEFFICIENTS USING FUNCTION:

Result:
Experiment No. 3
Discrete Fourier Transform & Discrete Time
Fourier Transform

Objective:
To develop a program that can elaborate the relationship between
Discrete Fourier Transform & Discrete Time Fourier Transform using
MATLAB.

Theory:
 Discrete Fourier Transform:
The DFT is one of the most powerful tools in digital signal processing
which enables us to find the spectrum of a finite-duration signal.
In mathematics, the discrete Fourier transform (DFT) converts a finite
sequence of equally-spaced samples of a function into a same-length sequence of
equally-spaced samples of the discrete-time Fourier transform (DTFT), which is a
complex-valued function of frequency.

The Discrete Fourier Transform (DFT) is of paramount importance in all


areas of digital signal processing. It is used to derive a frequency-domain (spectral)
representation of the signal.

Mathematically:
 Discrete Time Fourier Transform:
The discrete time Fourier transform (DTFT) is the member of the Fourier
transform family that operates on aperiodic, discrete signals.
A discrete-time signal can be represented in the frequency domain using discrete-
time Fourier transform. Therefore, the Fourier transform of a discrete time sequence
is called the discrete-time Fourier transform (DTFT).
Mathematically, if x(n)x(n) is a discrete-time sequence, then its discrete-time Fourier
transform is defined as

F[x(n)]=X(ω)=∑n=−∞∞x(n)e−jωnF[x(n)]=

X(ω)=∑n=−∞∞x(n)e−jωn

The discrete-time Fourier transform X(ω) of a discrete-time


sequence x(n)x(n) represents the frequency content of the sequence x(n)x(n).
Therefore, by taking the Fourier transform of the discrete-time sequence, the
sequence is decomposed into its frequency components. For this reason, the DTFT
X(ω) is also called the signal spectrum.
Difference between DFT & DTFT

DFT DTFT
Non-Periodically, Non-Continuous
Periodicity, Continuous

It is practically version of DTFT,


It is computed for finite length
discrete time signal.

Range of DFT is finite from 0 to N-1.


Range of DTFT is infinite.

It contains only positive frequencies.


It contains both positive &
negative frequencies.

Provide less number of frequency


components. Provide more number of frequency
components.

Accuracy is less.
Accuracy is more.
Experiment No. 4
Amplitude Modulation
Objective:
 To perform ampliture modulation using DSB/SSB AM transmitter
(ST 2201)
 To perfrom ampliture modulation using MATLAB
 To perform amplitude modulation using SIMULINK

Apparatus:
 Hardware based: DSB/SSB AM transmitter trainer
 Software based: MATLAB

Introduction:

AM Modulation is process in which the amplitude of carrier signal


changes with respect to message (modulation) signals. It is earliest modulation
methods that is used in transmitting information over the radio. It is a type of
modulation where the amplitude of the carrier wave is varied in some
proportion with respect to the modulating data or the signal.
Here, the voltage or the power level of the information signal changes the
amplitude of the carrier. In AM, the carrier does not vary in amplitude.
However, the modulating data is in the form of signal components consisting of
frequencies either higher or lower than that of the carrier. The signal
components are known as sidebands and the sideband power is responsible for
the variations in the overall amplitude of the signal.

Types of Amplitude Modulation


There are two main types of amplitude modulation;

 Double sideband-suppressed carrier modulation (DSB-SC).


 Single Sideband Modulation (SSB).
Fig. Carrier and Message signals

The modulated signal’s equation is written as:

Where,

Am = Amplitude of the modulating signal


(ωmt + Ɵ) = Phase of the signal phase
Fig. Modulated signal

MATLAB code for AM:

Result:
AM modulation in SimuLink:

Result:

Modulated signal
Experiment No. 5
Amplitude Demodulation
Objective:
 To perform ampliture demodulation using Advance fiber optic
communication trainer (IT 4410)

 To perform amplitude demodulation using MATLAB


 To perform amplitude demodulation using SimuLink
Apparatus:
 Hardware based: Advance fiber optic communication trainer
 Software based: MATLAB

Introduction:

Amplitude demodulation is the reverse process of modulation.


Demodulation or enveloping is used to recover the signal or to detect the
message coded on the carrier signal. It filters out the carrier to determine
the original signal amplitude.

Product detector: It is possible to demodulate amplitude modulated signals


with a receiver that incorporates a product detector of mixer and a local beat
frequency oscillator or carrier injection oscillator. In its basic form, the local
oscillator is not synchronised to the incoming signal carrier.
Normally a product detector is used for the reception of single sideband - a
derivative of AM. To demodulate SSB, a circuit known as a product detector is
used. Single sideband is a form of amplitude modulation where the carrier and
one sideband is removed leaving only one sideband. This produces the product
of the two signals, which results in the original modulating signal being
produced.
MATLAB code for AM demodulation

Result:

You might also like