0% found this document useful (0 votes)
47 views4 pages

Signals and Systems: Laboratory Manual

This document provides instructions for a lab assignment on implementing the discrete Fourier transform (DFT) and inverse DFT using MATLAB. The tasks include: 1) Computing the DFT and inverse DFT of a sequence and verifying the original is recovered, 2) Plotting the DFT magnitude of two summed signals, 3) Analyzing aliasing with different sampling frequencies, 4) Observing the effect of varying FFT points on the frequency spectrum, and 5) Designing and applying a highpass filter to an audio signal and comparing the original and filtered sounds.

Uploaded by

Fakhar Abbaspp
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views4 pages

Signals and Systems: Laboratory Manual

This document provides instructions for a lab assignment on implementing the discrete Fourier transform (DFT) and inverse DFT using MATLAB. The tasks include: 1) Computing the DFT and inverse DFT of a sequence and verifying the original is recovered, 2) Plotting the DFT magnitude of two summed signals, 3) Analyzing aliasing with different sampling frequencies, 4) Observing the effect of varying FFT points on the frequency spectrum, and 5) Designing and applying a highpass filter to an audio signal and comparing the original and filtered sounds.

Uploaded by

Fakhar Abbaspp
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Signals and Systems

(EL-223)

LABORATORY MANUAL

Dr. Shahzad saleem


Engr. Fakhar Abbas

Implementatin of DFT and IDFT using MATLAB USING MATLAB

(Lab # 13)

Student Name:

Roll No: Section:

Date performed:

MARKS AWARDED: ________ / 20

Version: 3.00

Verified by: Dr. Waqas bin Abbas, Dr. Shahzad Updated: Spring 2020
Saleem
Lab 13 - Implementatin of DFT and IDFT using MATLAB

TASK-01: [MARKS = 4]
Find the DFT of the following sequence of data. Then find the IDFT of the resulted sequence and verify that
you get back the original sequence.
Note: - Use the formula of DFT and IDFT given in manual.

x[n] = [ −3 4 1 2]
TASK-02: [MARKS = 4]:
Let x 1 (t)=2 cos ( 2 π 100 t ) and x 2 (t)=sin ( 2 π 300 t ), x ( t )=x 1 ( t ) + x 2 ( t ) ;
Write a Matlab code to compute DFT of x (t) . Let Fs=1000. and N = 500 samples. The magnitude plot of
DFT should look like this.

TASK-03: [MARKS = 2 + 2 = 4]

a) Run the sampling code given in lab manual, change value of Fs at each time and fill table-1

Table 1 - Effect of Sampling Frequency on signal with Maximum Input Frequency of 4 Hz

Maximum Input Sampling frequency Is aliasing observed? Observations


frequency (f) (Fs) Yes or No
4 2
4 4
4 6
4 8
4 10
4 12

EL223 - SIGNALS AND SYSTEMS LAB NUCES, ISLAMABAD Page 2 of 4


Lab 13 - Implementatin of DFT and IDFT using MATLAB

Repeat the above process for:

b) sinc signal: sinc(2*f*t)


Table 2 - Effect of Sampling Frequency on sinc signal

frequency (f) Sampling frequency Is aliasing observed? Observations


(Fs) Yes or No
2 12
4 12
6 12
8 12

TASK-04: [MARKS = 3]: Analysis of fft Command Over Different Points:


Consider x [n] in task 1. Vary fft points and observe the variation in frequency domain spectrum. Fill the
following table.
Table 1 - Effect of fft points in frequency domain

fft points Positive Frequency at Negative Frequency Observations


whcich First Peak at whcich First Peak
Occur Occur
256
128
64
32
16
8
4

TASK-05: [MARKS = 3 + 2 = 5]: Filtering Audio Signal using Filter Command:


a) Download ‘8k8bitpcm.wav’ file from Slate. We want to filter this audio signal using highpass filter.
Design the Highpass filter with following parameters. Fs = 8000 Hz, Fpass = 500 Hz,
Analyse and complete the following code.
clc;close all;
[x,Fs]= audioread('8k8bitpcm.wav');
% Write code to listen audio for 2 seconds only
pause(4)% Pause for 4 seconds
% Design a highpass filter for above mentioned parameters
N = ? % Select Filter Order N
Wn = ? % Finding Cutoff frequency
Num = fir1(N,Wn);% Computing Numerator Coefficients of High pass
Filter
% where N is the order of the filter and Wn is the cutoff
frequency
% Find detailed help using Matlab
y = filter(Num,1,x);% Applying Highpaas Filter to input siganl x
producing output signal y
% sound command is used to listen the filtered audio signal
sampled at Fs

EL223 - SIGNALS AND SYSTEMS LAB NUCES, ISLAMABAD Page 3 of 4


Lab 13 - Implementatin of DFT and IDFT using MATLAB

% Write code to write filtered audio signal


% Compare two sounds

b) Analysis of Audio Signal using Filter Command:


Modify the above written Matlab code as follows:
 Add x_new = cos(2*pi*100*n/Fs) in x where n has the same samples as that of x
 Increase the volume of sound 10 times
 Rest steps are same as mentioned in task 2.
Observations:- Write here about the changes you have seen after adding x_new to original signal.

EL223 - SIGNALS AND SYSTEMS LAB NUCES, ISLAMABAD Page 4 of 4

You might also like