Documente Academic
Documente Profesional
Documente Cultură
Lab – 4
Date:
1
Version 1.0 – Zulaikha Kiran – 18/02/2019
Spring 2020 ADC Lab 4 Version 1.0
Introduction
The purpose of this lab is to enable the students to calculate and plot Energy Spectral Density
and Power Spectral Density of signals.
Equipment
• Software
o MATLAB
Instructions
• This is an individual lab. You will perform the tasks individually and submit a .m file
as well as the filled hand-out.
• There will be no concept of make-up labs. The lab if missed may be performed later
for practice and knowledge required for the coming labs, but it will not be graded.
• Please see the rubric at the end of the lab for marks distribution.
• Plagiarism or any hint thereof will be dealt with strictly. Any incident where
plagiarism is caught, all students involved will be given zero marks, regardless of who
copied whom. Multiple such incidents will result in disciplinary action being taken.
2
Spring 2020 ADC Lab 4 Version 1.0
• Using sampling frequency to be 20, and time increment as 1/fs, generate a sinusoidal
input signal with amplitude 5 and frequency 2 Hz, between -1 and 1
• Add uniform noise with value between -5/2 and 5/2 to this signal.
• Plot the result.
Exercise 2
• Find the total energy of the signal by taking the sum of the square of its value at each
time instant and multiplying the final result with the time increment.
Exercise 3
• Write a MATLAB code to compute and plot the energy spectral density of the signal.
Follow the following steps:
o Enter N = 256
o Use fft(signal, N)/fs to compute N-point fft of the signal.
o The above function gives the Fourier transform of the signal, which is not
centered at the zero frequency. In order to move the zero frequency
component to the center, use fftshift( ).
o The Fourier transform is in complex form. We only need to plot the
magnitude. Search for a MATLAB function that gives the magnitude of a
complex number, and use it to get the amplitude spectrum of the signal.
o Plot the result.
o The energy spectrum is simply the squared amplitude spectrum. Find and plot
it as well.
Exercise 4
• Find the total energy of the signal by taking the sum of the energy spectrum and
multiplying the final result with the sampling frequency and dividing it by N.
3
Spring 2020 ADC Lab 4 Version 1.0
Exercise 6
• Using the same input signal, find and plot the power spectral density using fft. Follow
the following steps.
o Define N equal to the length of input signal.
o Compute the squared magnitude of the centered fft, and multiply it with
(1/fs*N) to get the power spectral density.
o Define the frequency variable from –fs/2 to (fs/2)-(fs/N) with step size equal
to fs/N
o Convert the power spectral density to dB/Hz and plot it against the frequency
variable.
4
Version 1.0
5
Version 1.0 – Zulaikha Kiran – 28/01/2019