LABORATORY - FREQUENCY ANALYSIS OF DISCRETE-TIME SIGNALS

Similar documents
It is the speed and discrete nature of the FFT that allows us to analyze a signal's spectrum with MATLAB.

Discrete Fourier Transform (DFT)

Biomedical Signals. Signals and Images in Medicine Dr Nabeel Anwar

EE 215 Semester Project SPECTRAL ANALYSIS USING FOURIER TRANSFORM

Observation of the Effects of the Fourier Transformation on Periodic Signals ECE 521. Project 2

L A B 3 : G E N E R A T I N G S I N U S O I D S

DFT: Discrete Fourier Transform & Linear Signal Processing

ELT COMMUNICATION THEORY

1. In the command window, type "help conv" and press [enter]. Read the information displayed.

Figure 1: Block diagram of Digital signal processing

Problem Set 1 (Solutions are due Mon )

EE 464 Short-Time Fourier Transform Fall and Spectrogram. Many signals of importance have spectral content that

(i) Understanding of the characteristics of linear-phase finite impulse response (FIR) filters

Electrical & Computer Engineering Technology

Multirate Signal Processing Lecture 7, Sampling Gerald Schuller, TU Ilmenau

ECE438 - Laboratory 7a: Digital Filter Design (Week 1) By Prof. Charles Bouman and Prof. Mireille Boutin Fall 2015

(i) Understanding of the characteristics of linear-phase finite impulse response (FIR) filters

EE 422G - Signals and Systems Laboratory

Lecture 3, Multirate Signal Processing

Fourier Signal Analysis

Digital Signal Processing Fourier Analysis of Continuous-Time Signals with the Discrete Fourier Transform

Sampling and Reconstruction of Analog Signals

Laboratory Assignment 4. Fourier Sound Synthesis

Topic 6. The Digital Fourier Transform. (Based, in part, on The Scientist and Engineer's Guide to Digital Signal Processing by Steven Smith)

Fourier Series and Gibbs Phenomenon

Basic Signals and Systems

ELECTRONOTES APPLICATION NOTE NO Hanshaw Road Ithaca, NY Nov 7, 2014 MORE CONCERNING NON-FLAT RANDOM FFT

Log Booklet for EE2 Experiments

ELEC3104: Digital Signal Processing Session 1, 2013 LABORATORY 3: IMPULSE RESPONSE, FREQUENCY RESPONSE AND POLES/ZEROS OF SYSTEMS

Lab 4 Fourier Series and the Gibbs Phenomenon

Digital Video and Audio Processing. Winter term 2002/ 2003 Computer-based exercises

Digital Filters IIR (& Their Corresponding Analog Filters) Week Date Lecture Title

FFT analysis in practice

Wireless Communication Systems Laboratory Lab#1: An introduction to basic digital baseband communication through MATLAB simulation Objective

(i) Understanding the basic concepts of signal modeling, correlation, maximum likelihood estimation, least squares and iterative numerical methods

Concordia University. Discrete-Time Signal Processing. Lab Manual (ELEC442) Dr. Wei-Ping Zhu

Lecture 3 Complex Exponential Signals

6.S02 MRI Lab Acquire MR signals. 2.1 Free Induction decay (FID)

PROBLEM SET 6. Note: This version is preliminary in that it does not yet have instructions for uploading the MATLAB problems.

ELEC3104: Digital Signal Processing Session 1, 2013

Lab 8. Signal Analysis Using Matlab Simulink

Experiments #6. Convolution and Linear Time Invariant Systems

Outline. Introduction to Biosignal Processing. Overview of Signals. Measurement Systems. -Filtering -Acquisition Systems (Quantisation and Sampling)

Jawaharlal Nehru Engineering College

DCSP-10: DFT and PSD. Jianfeng Feng. Department of Computer Science Warwick Univ., UK

Sampling of Continuous-Time Signals. Reference chapter 4 in Oppenheim and Schafer.

UNIVERSITY OF WARWICK

The Polyphase Filter Bank Technique

From Fourier Series to Analysis of Non-stationary Signals - VII

Signal Processing. Introduction

GEORGIA INSTITUTE OF TECHNOLOGY. SCHOOL of ELECTRICAL and COMPUTER ENGINEERING. ECE 2026 Summer 2018 Lab #8: Filter Design of FIR Filters

Experiment 8: Sampling

ECE 2713 Homework 7 DUE: 05/1/2018, 11:59 PM

Discrete Fourier Transform, DFT Input: N time samples

Massachusetts Institute of Technology Dept. of Electrical Engineering and Computer Science Spring Semester, Introduction to EECS 2

ECE 5650/4650 MATLAB Project 1

Design of FIR Filters

Here are some of Matlab s complex number operators: conj Complex conjugate abs Magnitude. Angle (or phase) in radians

1 Introduction and Overview

Lab 0: Introduction to TIMS AND MATLAB

System analysis and signal processing

UNIVERSITY OF WARWICK

Window Method. designates the window function. Commonly used window functions in FIR filters. are: 1. Rectangular Window:

Digital Signal Processing

Sampling and Signal Processing

THE CITADEL THE MILITARY COLLEGE OF SOUTH CAROLINA. Department of Electrical and Computer Engineering. ELEC 423 Digital Signal Processing

Frequency Division Multiplexing Spring 2011 Lecture #14. Sinusoids and LTI Systems. Periodic Sequences. x[n] = x[n + N]

Digital Signal Processing

DSP First. Laboratory Exercise #7. Everyday Sinusoidal Signals

Fundamentals of Signals and Systems Using the Web and MATLAB Edward W. Kamen Bonnie S Heck Third Edition

Lecture 3 Review of Signals and Systems: Part 2. EE4900/EE6720 Digital Communications

Islamic University of Gaza. Faculty of Engineering Electrical Engineering Department Spring-2011

Digital Filters FIR and IIR Systems

EE 470 BIOMEDICAL SIGNALS AND SYSTEMS. Active Learning Exercises Part 2

Moving from continuous- to discrete-time

Lab P-4: AM and FM Sinusoidal Signals. We have spent a lot of time learning about the properties of sinusoidal waveforms of the form: ) X

ME scope Application Note 01 The FFT, Leakage, and Windowing

Sound synthesis with Pure Data

Project 2 - Speech Detection with FIR Filters

Performing the Spectrogram on the DSP Shield

ADSP ADSP ADSP ADSP. Advanced Digital Signal Processing (18-792) Spring Fall Semester, Department of Electrical and Computer Engineering

Armstrong Atlantic State University Engineering Studies MATLAB Marina Sound Processing Primer

speech signal S(n). This involves a transformation of S(n) into another signal or a set of signals

Fourier Series. Discrete time DTFS. (Periodic signals) Continuous time. Same as one-period of discrete Fourier series

THE HONG KONG POLYTECHNIC UNIVERSITY Department of Electronic and Information Engineering. EIE2106 Signal and System Analysis Lab 2 Fourier series

ME scope Application Note 02 Waveform Integration & Differentiation

EECS 452 Midterm Exam Winter 2012

Digital Signal Processing Laboratory 1: Discrete Time Signals with MATLAB

B.Tech III Year II Semester (R13) Regular & Supplementary Examinations May/June 2017 DIGITAL SIGNAL PROCESSING (Common to ECE and EIE)

The Discrete Fourier Transform. Claudia Feregrino-Uribe, Alicia Morales-Reyes Original material: Dr. René Cumplido

Understanding Digital Signal Processing

Topic 2. Signal Processing Review. (Some slides are adapted from Bryan Pardo s course slides on Machine Perception of Music)

The University of Texas at Austin Dept. of Electrical and Computer Engineering Final Exam

DSP First Lab 03: AM and FM Sinusoidal Signals. We have spent a lot of time learning about the properties of sinusoidal waveforms of the form: k=1

Spectrum Analysis - Elektronikpraktikum

Experiment 1 Introduction to MATLAB and Simulink

1.5 The voltage V is given as V=RI, where R and I are resistance matrix and I current vector. Evaluate V given that

CS3291: Digital Signal Processing

EE 470 Signals and Systems

PROBLEM SET 5. Reminder: Quiz 1will be on March 6, during the regular class hour. Details to follow. z = e jω h[n] H(e jω ) H(z) DTFT.

Transcription:

LABORATORY - FREQUENCY ANALYSIS OF DISCRETE-TIME SIGNALS INTRODUCTION The objective of this lab is to explore many issues involved in sampling and reconstructing signals, including analysis of the frequency content of sinusoidal signals using the DFT. When the sequence x[n] is of finite duration, the frequency contents that are contained in the sequence can be determined using the Discrete Fourier Transform (DFT). The DFT is an approximation of the Discrete Time Fourier Transform (DTFT), which is computed over an infinite duration. Computation of the DFT using only N data points may exhibit the edge effect when the windowed periodic signal is nothing like the original signal as shown in Fig. 1. (a) Windowed data (b) Fig. 1 Edge effect of the windowed data. (a) original sinusoidal sequence. (b) windowed periodic signal. Extracting a finite length of data can be thought of as multiplying the sequence with a rectangular box of length N which has a sinc-like spectrum as shown in Fig. 2. The sinclike spectrum of the rectangular window makes the resulting spectrum of the windowed sinusoid in Fig. 1 appear like a sinc-function, instead of an impulse as expected. (a) (b) Fig. 2 A rectangular window (a) Time domain (b) Frequency domain SW-1

Fig. 3 Spectrum of windowed sinusoid EXERCISE 1: EFFECT OF THE NUMBER OF POINTS IN THE FFT In this exercise, we will demonstrate the effect of data window and changing the value of the number of points in the FFT, N, on the FFT of sinusoidal signals. 1. Let us start by synthesising a cosine with 5 samples at 1 samples per period. t=linspace(,2,5); T=t(2)-t(1); x=cos(2*pi*t/(1*t)); % vector of time variable % sampling period % the cosine with 5 samples at 1 samples/period The plot of the sequence x[n] from n = to 49 is shown in Fig. 4 stem([:49],x); % plot of the sequence x[n] 1.8.6.4.2 x[n] -.2 -.4 -.6 -.8-1 5 1 15 2 25 3 35 4 45 5 Sample (n) Fig. 4 A cosine with 5 samples at 1 samples per period SW-2

Q1. What is the sampling period of x[n]? Q2. What is the frequency of the cosine x[n] in Hz? Q3. What kind of spectrum do you expect from this signal? 2. The frequency contents of the sequence will be determined using the MATLAB command FFT. The syntax for computing the FFT of a signal is FFT(x,N) where x is the discrete signal x[n] you wish to transform and N is the number of points in the FFT. If N is omitted, the FFT will generates the N-point FFT where N is the length of x. Define 3 different values of N, i.e. N=64, 128, and 256. Compute a set of N- point FFT X(k) and plot the results from k=-n/2. % Define 3 different values of N N1 = 64; N2 = 128; N3 = 256; % Compute the magnitudes of FFT of x[n] for each of 3 values of N X1 = abs(fft(x,n1)); X2 = abs(fft(x,n2)); X3 = abs(fft(x,n3)); % Frequency scaling to convert the discrete frequencies k to the continuous frequency in Hz fs=1/t; % sampling frequency in Hz F1 = [ : N1/2]/N1*fs; F2 = [ : N2/2]/N2*fs; F3 = [ : N3/2]/N3*fs; % plot the transforms figure; subplot(3,1,1) stem(f1,x1(1:n1/2+1),'filled'),title('n = 64'),axis([ 12.3 3]) subplot(3,1,2) stem(f2,x2(1:n2/2+1),'filled'),title('n = 128'),axis([ 12.3 3]) subplot(3,1,3) stem(f3,x3(1:n3/2+1),'filled'),title('n = 256'),axis([ 12.3 3]) xlabel('frequency (Hz)') SW-3

3 N = 64 2 1 2 4 6 8 1 12 3 N = 128 2 1 2 4 6 8 1 12 3 N = 256 2 1 2 4 6 8 1 12 Frequency (Hz) Fig. 5 FFT of a cosine for N=6, 128 and 256 Fig. 5 shows that the transforms all have a sinc-like appearance, which is a result of data window, differing only in the number of samples used to approximate the sinc function. Q4. Record the frequencies at the peaks of all three spectra in Fig. 5. Compare these peak frequencies with the frequency of the cosine x[n] and comment on the results. EXERCISE 2: EFFECT OF DATA LENGTH In this part, we will consider impact of window data length on resolution of FFT as the FFT length kept fixed. We choose to fix N=124 points and vary the number of repetitions of the repetitions of the fundamental period. % Data generation t=linspace(,2,5); T=t(2)-t(1); x1=cos(2*pi*t/(1*t)); % 5 periods x2=repmat(x1,1,2); % 1 periods x3=repmat(x1,1,5); % 25 periods N = 124; % the number of FFT % Compute the magnitudes of FFT of x[n] for each of 3 data lengths X1 = abs(fft(x1,n)); X2 = abs(fft(x2,n)); X3 = abs(fft(x3,n)); SW-4

% Frequency scaling fs=1/t; % sampling frequency in Hz F = [ : N/2]/N*fs; % plot the transforms figure; subplot(3,1,1) plot(f,x1(1:n/2+1)),title('5 periods') subplot(3,1,2) plot(f,x2(1:n/2+1)),title('1 periods') subplot(3,1,3) plot(f,x3(1:n/2+1)),title('25 periods') xlabel('frequency (Hz)') 4 5 periods 2 2 4 6 8 1 12 14 5 1 periods 2 2 4 6 8 1 12 14 25 periods 1 2 4 6 8 1 12 14 Frequency (Hz) Fig. 6 FFT of a cosine of 5, 1 and 25 periods Q5. As x[n] is extended to a large number of periods, how does this affect the obtained spectrum? Find the peak frequencies of spectra obtained from Fig. 6 and compare them with the ones you get from Fig. 5. EXERCISE 3: RECOVERING THE TIME-DOMAIN FUNCTION USING IFFT Given the FFT of a signal, you can recover the time-domain function of the signal by using IFFT. Here is how to do it. 1. Generate the cosine function as in EXERCISE 1: t=linspace(,2,5); % vector of time variable T=t(2)-t(1); % sampling period x=cos(2*pi*t/(1*t)); SW-5

2. Create the DFT of the signal and plot its magnitude and phase. Xk=fft(x); % Discrete Fourier transform of x figure subplot(2,1,1),stem(abs(xk),'.'), title('magnitude of FFT'); subplot(2,1,2),stem(angle(xk),'.'),title('phase of FFT'); 3. Recover the time-domain function by using the inverse DFT. xr = real(ifft(xk)); figure subplot(2,1,1), plot(t,x), title('cosine before FFT'); subplot(2,1,2), plot(t,xr),title('cosine after FFT and IFFT'); SW-6