Communication System Lab 5

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

GIFT UNIVERSITY, GUJRANWALA

LAB MANUAL 5: NOISE GENERATION AND ITS REDUCTION

DEPARTMENT OF ELECTRICAL ENGINEERING

LAB EVALUATION RUBRICS

Demonstration
Academic Individual &Team Subject
of Program and Lab Report
Honesty Work Knowledge/Viva
Results

Maximum Marks 6 2 2 7 3

Marks Obtained

Total Marks: 20 Total Marks Obtained:

LAB EVALUATION RUBRICS


Excellent Good Satisfactory Poor
(90-100%) (70-90%) (40-70%) (0-40%)
The below Rubric is mapped to PLO-05 and assigned Psychomotor Domain of Level 4
The student was
The student was
unable to
The student The student is able able to complete a
complete the task
completes the task to completes the large part of the
Demonstratio and/or a major
accurately and also task in a proper way task and/or a small
n of Program part of the
writes (presents) the but writes (presents) part of the required
and Results required
code (results) in a the code (results) in information is
information is
professional way a poor way missing from the
missing from the
task
task
The below Rubric is mapped to PLO-08 and assigned Affective Domain of Level 3
The student
The student
performs a major
performs the entire The student copies The students
part of the task by
task by a small part from copies a large
himself/herself
himself/herself other sources but part or the entire
Academic and/or cites the
and/or properly cites properly cites those task from other
Honesty sources in an
all the sources in sources in order to sources without
acceptable way in
order to avoid avoid academic properly citing
order to avoid
academic dishonesty those sources
academic
dishonesty
dishonesty
The below Rubric is mapped to PLO-09 and assigned Affective Domain of Level 3
A high (medium) The student has
A high level of A satisfactory group
level of participation minimal
participation in the member who does
in the lab participation in the
Individual lab performance and what is required
performance and performance and
&Team Work possesses strong with an average
has good (excellent) a poor
knowledge of the understanding of
knowledge of the understanding of
experiment the experiment
experiment the experiment
The below Rubric is mapped to PLO-10 and assigned Affective Domain of Level 4
Professional and Inadequate and
accurate Report data is non-professional
representation of lab accurate but lab report with
Report include all
experiment in terms presented in non- inaccurate results.
required accurate
of problem professional Report did not
Lab Report data with some
statement, circuit manner along with include the
minor inadequacies
design, some errors in required analysis
in presentation
observations, analysis and and graphs along
results, analysis and conclusion with wrong or no
conclusion conclusion
The below Rubric is mapped to PLO-01 and assigned Cognitive Domain of Level 2
Has very good Has some
Has poor
Fully understands understanding of the understanding of
understanding of
the experiment, experiment, its the experiment, its
the experiment,
Subject including its purpose purpose and results; purpose and
its purpose and
Knowledge/Vi and results; able to able to discuss results; almost able
results; unable to
va discuss experimental experimental to discuss
discuss
protocols in a clear protocols in a experimental
experimental
and precise manner reasonably clear protocols in a clear
protocols
manner manner

GENERAL GUIDELINES
1. Students are required to submit the Lab Manual before the next lab. Late submission of Lab
Manuals will NOT be entertained.
2.
The marks in the Lab Performance will be counted as ZERO if the student is absent in the Lab.

3.
The instructors reserve the right to NOT allow late comers to attend the Lab.

4.
Turn off your MOBILE PHONES in the Lab, and keep them in the bag/pocket.

5.
Eating or drinking is STRICTLY prohibited in the Lab.

6. Leave your work station clean and in good order before leaving the Lab. ALWAYS turn off your
computers and/or machines before leaving.
7.
RETURN all the component to the Lab Attendant before leaving the Lab.
Gift University Gujranwala Electrical Engineering

EXPERIMENT NO. 5

NOISE GENERATION AND ITS REDUCTION

Objectives:
 To generate noisy signal and perform filtering using MATLAB

Description:
In electronics, noise is a random fluctuation in an electrical signal, a characteristic of all
electronic circuit. Noise generated by electronic devices varies greatly, as it can be produced by
several different effects. Thermal noise is unavoidable at non-zero temperature, while other types
depend mostly on device type (such as shot noise, which needs steep potential barrier) or
manufacturing quality and semiconductor defects, such as conductance fluctuations, including1/f
noise.

In communication systems, noise is an error or undesired random disturbance of a useful


information signal in a communication channel. The noise is a summation of unwanted or
disturbing energy from natural and sometimes man-made sources. Noise is, however, typically
distinguished from interference, (e.g. Cross-talk, deliberate jamming or other unwanted
electromagnetic interference from specific transmitters), for example in the signal-to-noise ratio
(SNR), signal-to-interference ratio (SIR) and signal-to-noise plus interference ratio (SNIR)
measures.

Noise is also typically distinguished from distortion, which is an unwanted systematic alteration
of the signal waveform by the communication equipment, for example in the signal-to noise and
distortion ratio (SINAD). In a carrier-modulated passband analog communication system, a
certain carrier-to-noise ratio (CNR) at the radio receiver input would result in a certain signal-to-
noise ratio in the detected message signal.

In a digital communications system, a certain Eb/N0 (normalized signal-to-noise ratio) would


result in a certain bit error rate (BER). While noise is generally unwanted, it can serve a useful
purpose in some applications, such as random number generation or dithering.

Communication Systems
Gift University Gujranwala Electrical Engineering

Gaussian noise:

Gaussian noise is statistical noise that has its probability density function equal to that of the
normal distribution, which is also known as the Gaussian distribution. In other words, the values
that the noise can take on are Gaussian-distributed. A special case is white Gaussian noise, in
which the values at any pairs of times are statistically independent (and uncorrelated). In
applications, Gaussian noise is most commonly used as additive white noise to yield additive
white Gaussian noise.

Noise Types:

1.1) Thermal noise 1.2) Shot noise 1.3) Flicker noise 1.4) Burst noise 1.5) Transit-time noise

White noise:

White noise is a random signal (or process) with a flat power spectral density. In other words, the
signal contains equal power within a fixed bandwidth at any center frequency. White noise draws
its name from white light in which the power spectral density of the light is distributed over the
visible band in such a way that the eye's three-color receptors (cones) are approximately equally
stimulated.

Additive white Gaussian noise:

Additive white Gaussian noise (AWGN) is a channel model in which the only impairment to
communication is a linear addition of wideband or white noise with a constant spectral density
(expressed as watts per hertz of bandwidth) and a Gaussian distribution of amplitude.

Wideband Gaussian noise comes from many natural sources, such as the thermal vibrations of
atoms in conductors (referred to as thermal noise or Johnson-Nyquist noise), shot noise, black
body radiation from the earth and other warm objects, and from celestial sources such as the Sun.

The AWGN channel is a good model for many satellite and deep space communication links.

Communication Systems Page 1


Gift University Gujranwala Electrical Engineering

In this lab you have to generate white Gaussian noise in Matlab. By simply using build in
command ‘awgn’ or ‘randn’ command.

Algorithm:
Step 1: To generate sine waveform.

Step 2: To generate random signal.

Step 3: To generate AWGN signal.

Step 4: To plot sine + random signal.

Step 5: To plot sine +AWGN signal.

Step 6: To plot FFT of both noisy signals.

Output Results:

Communication Systems Page 2


Gift University Gujranwala Electrical Engineering

sine wave sine wave


5 5

0 0

-5 -5
0 0.02 0.04 0.06 0.08 0.1 0 0.02 0.04 0.06 0.08 0.1

rand noisy signal 2 awgn noisy signal 1


5
amplitude

amplitude
0.4
0.2
0 0
-0.2
-5
0 0.02 0.04 0.06 0.08 0.1 0 0.02 0.04 0.06 0.08 0.1
time time
randm + sine awgn + sine
5 10
amplitude

amplitude
0 0

-5 -10
0 0.02 0.04 0.06 0.08 0.1 0 0.02 0.04 0.06 0.08 0.1
time time
fft of randm fft of awgn
40 100
20 50
0 0
0 0.02 0.04 0.06 0.08 0.1 0 0.02 0.04 0.06 0.08 0.1

Figure 5.1

We will call the noisy signal x(n). You are to design a low-pass filter to filter out the noise. You
will try different low-pass filters until you find one that works well.

If your computer supports sound, you can listen to the noisy signal x(n) with the command ‘
soundsc(x)’.Use the fft command as shown to plot the magnitude of the spectrum of the original
signal

Communication Systems Page 3


Gift University Gujranwala Electrical Engineering

====================================================================

LAB TASK
====================================================================

Lab Task 1

By using algorithm steps generate white Gaussian noisy signal reproduce a code in
MATLAB.
z1=abs(fft(x,1024));
z2=abs(fft(y,1024));
f2=0:fs/1023:fs;
(03 mark)

MATLAB code:

Lab Task 1 Code


clc % clearing all the window
clear all % clearing all the workspace

Communication Systems Page 4


Gift University Gujranwala Electrical Engineering

close all % closing all the graphs windows


t=0:0.0001:0.1; % Time Period of the Signal
s=4*sin(2*pi*100*t); % Generating a Sine Signal
plot(t,s) % Ploting the Original Sine Signal
xlabel('Time Period') % label x-Axis as Time Period
ylabel('Amplitude') % label y-Axis as Amplitude of the Signal
title('Sine Signal') % Adding Title of Sine Signal
p=0.1*randn(size(t)); % Creating a Random Noise
plot(t,p) % Plot the Noise Signal
hold on;
xlabel('Time Period') % label x-Axis as Time Period
ylabel('Amplitude') % label y-Axis as Amplitude of the Signal
title('Noise Signal') % Adding Title of Noise Signal
snr=15;% Setting the Signal to Noise Ratio
n=awgn(s,snr); % Creating an Additive White Gaussian Noise
plot(t,n) % Plot the Additive White Gaussian Noise
hold on;
xlabel('Time Period') % label x-Axis as Time Period
ylabel('Amplitude') % label y-Axis as Amplitude of the Signal
title('AWGN Signal') % Adding Title of AWGN Signal
e=s+p; % Adding the Original Sine Signal and Random Noise
plot(t,e) % Ploting the Sum of Sine and Random Noise Signal
hold on;
xlabel('Time Period') % label x-Axis as Time Period
ylabel('Amplitude') % label y-Axis as Amplitude of the Signal
title('Sine+Random Noise Signal') % Adding Title of Sine+Random Noise Signal
z=s+n; % Summing the Original Sine and AWGN Signal.
plot(t,z) % Ploting the Sum of Sine and AWGN Signal
hold on;
xlabel('Time Period') % label x-Axis as Time Period
ylabel('Amplitude') % label y-Axis as Amplitude of the Signal
title('Sine+AWGN Signal') % Adding Title of Sine+AWGN Signal
z1=abs(fftshift(fft(s,1024))); % Taking Fourier Transform of sine signal
% along with Fourier Transform Shift later taking Absolute of it.
plot(z1) % Ploting Z1
hold on;
xlabel('Time Period') % label x-Axis as Time Period
ylabel('Amplitude') % label y-Axis as Amplitude of the Signal
title('Fourier of Sine Signal') % Adding Title of Fourier of Sine Signal
z2=abs(fftshift(fft(n,1024))); % Taking Fourier Transform of sine signal
% along with Fourier Transform Shift later taking Absolute of it.
plot(z2) % Plot Singal of Z2
xlabel('Time Period') % label x-Axis as Time Period
ylabel('Amplitude') % label y-Axis as Amplitude of the Signal
title('Fourier of AWGN Signal') % Adding Title of Fourier of AWGN Signal
z3=abs(fftshift(fft(p,1024))); % Taking Fourier Transform of sine signal
% along with Fourier Transform Shift later taking Absolute of it.
plot(z3) % Ploting the Z3
xlabel('Time Period') % label x-Axis as Time Period
ylabel('Amplitude') % label y-Axis as Amplitude of the Signal
title('Fourier of Noise Signal') % Adding Title of Fourier of Noise Signal

MATLAB results:

Communication Systems Page 5


Gift University Gujranwala Electrical Engineering

Lab Task 2

Construct an appropriate elliptical low-pass filter with the butter command. Use the filter
command to filter the noisy signal x(n) with the lowpass filter you construct.

Try different cut-of frequencies and different values for the stop-band ripple and the pass
band ripple. Can you remove most of the noise from the noisy signal?
wc=2*pi*f/fs;
[m,n]=butter(k,wc);
p=filter(m,n,y);
(03 mark)

MATLAB code:

Lab Task 2 Code


clc % clearing all the window
clear all % clearing all the workspace
close all % closing all the graphs windows
t=0:0.0001:0.1; % Time Period of the Signal
s=4*sin(2*pi*100*t); % Generating a Sine Signal
plot(t,s) % Ploting the Original Sine Signal
xlabel('Time Period') % label x-Axis as Time Period
ylabel('Amplitude') % label y-Axis as Amplitude of the Signal
title('Sine Signal') % Adding Title of Sine Signal
p=0.1*randn(size(t)); % Creating a Random Noise
plot(t,p) % Plot the Noise Signal
hold on;
xlabel('Time Period') % label x-Axis as Time Period
ylabel('Amplitude') % label y-Axis as Amplitude of the Signal
title('Noise Signal') % Adding Title of Noise Signal
f=50;% Declaring Frequency of the Both Signals
fs=3000; % Declaring the Sampling Frequency for the Signals
k=10; % Declaring Modulation Value
wc=2*pi*f/fs; % Fourmula for Cut off Frequency
[m,n]=butter(k,wc); % Implement a Formula of Butterworth filter
p=filter(m,n,noise);% Implement a Formula
plot(t,p) % Ploting the Filtered Signal after Noise Reduction
hold on;
xlabel('Time Period') % label x-Axis as Time Period
ylabel('Amplitude') % label y-Axis as Amplitude of the Signal
title('Filtered Signal') % Adding Title of Filtered Signal

MATLAB results:

Observations: (02 Mark)

This lab explained me about the creation and removal of noise in signals. I started with
generating the original signal, and then I built a white Gaussian noise. I then included the
Communication Systems
original signal as Page
well as the noise signal. and 6
examined both the filter- and non-filter-filled
output graphs.
Gift University Gujranwala Electrical Engineering

Review Questions

1. Explain how a low-pass filter can remove the high frequency noise?

(01 Mark)
A low-pass filter reduces high-frequency noise by allowing low-frequency signals to flow
through while attenuating or blocking high-frequency ones.

2. What frequencies are predominant in the speech signal. Can you identify which part of
the spectrum corresponds to the noise and which part corresponds to the speech signal
by using the soundsc command? (02 Mark)

Generally our Speech Sinal Travel bet 300 to 3400 Hz Frequency the Function soundsc
gives us the Spectrum of Speech Signal Travelling

Communication Systems Page 7

You might also like