faculty of engineering multimedia university lab sheetsfoe.mmu.edu.my/lab/lab...

16
FACULTY OF ENGINEERING MULTIMEDIA UNIVERSITY LAB SHEETS ETN3096 DIGITAL SIGNAL PROCESSING TRIMESTER 3 (2015/2016) DSP1 Introduction to DSP with MATLAB DSP2 Design of a Digital Filter with MATLAB

Upload: duongdieu

Post on 05-Jul-2018

224 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: FACULTY OF ENGINEERING MULTIMEDIA UNIVERSITY LAB SHEETSfoe.mmu.edu.my/lab/lab sheet/TRIM3/EPSILON/ETN3096-DSP1,DSP2... · FACULTY OF ENGINEERING MULTIMEDIA UNIVERSITY LAB SHEETS

FACULTY OF ENGINEERING

MULTIMEDIA UNIVERSITY

LAB SHEETS

ETN3096

DIGITAL SIGNAL PROCESSING

TRIMESTER 3 (2015/2016)

DSP1 Introduction to DSP with MATLAB

DSP2 Design of a Digital Filter with MATLAB

Page 2: FACULTY OF ENGINEERING MULTIMEDIA UNIVERSITY LAB SHEETSfoe.mmu.edu.my/lab/lab sheet/TRIM3/EPSILON/ETN3096-DSP1,DSP2... · FACULTY OF ENGINEERING MULTIMEDIA UNIVERSITY LAB SHEETS

ETN3096: Digital Signal Processing

KSS/T3 2015/2016

2

DSP1: Introduction to DSP with MATLAB 1. Objectives

To get familiar with the basics of Matlab programming environment.

To perform basic signal and filter analysis by using interactive GUI tools of the Signal

Processing Toolbox.

2. Equipment

Desktop PC

Matlab 5.3 with Signal Processing Toolbox

3. Background Theory

Introduction to Matlab As a preparation for your DSP Lab session, start Matlab on any computer that has Matlab installed,

type "helpdesk", click on "Getting Started", and read at least following topics:

Introduction

What Is MATLAB?

The MATLAB System

Getting Started

Starting MATLAB

Matrices and Magic Squares

Entering Matrices

sum, transpose, and diag

Subscripts

The Colon Operator

The magic Function

Expressions

Variables

Numbers

Operators

Functions

Expressions

Working with Matrices

Generating Matrices

load

M-Files

Concatenation

Deleting Rows and Columns

The Command Window

The format Command

Suppressing Output

Long Command Lines

Page 3: FACULTY OF ENGINEERING MULTIMEDIA UNIVERSITY LAB SHEETSfoe.mmu.edu.my/lab/lab sheet/TRIM3/EPSILON/ETN3096-DSP1,DSP2... · FACULTY OF ENGINEERING MULTIMEDIA UNIVERSITY LAB SHEETS

ETN3096: Digital Signal Processing

KSS/T3 2015/2016

3

Command Line Editing

Graphics

Creating a Plot

Figure Windows

Adding Plots to an Existing Graph

Subplots

Imaginary and Complex Data

Controlling Axes

Axis Labels and Titles

Printing Graphics

Help and Online Documentation

The help Command

The Help Window

The lookfor Command

The Help Desk

The doc Command

Printing Online Reference Pages

Link to the MathWorks

The MATLAB Environment

The Workspace

save Commands

More About Matrices and Arrays

Linear Algebra

Arrays

Scalar Expansion

Flow Control

if

switch and case

for

while

break

Scripts and Functions

Scripts

Functions

Vectorization

Function Functions

Complementary information is found in the "Matlab Overview 1&2", which will be put online.

Introduction to MATLAB for DSP Matlab can have several "toolboxes" added to it for specific applications. The list of the toolboxes

installed can be obtained by typing the "help" command. If the Digital Signal Processing toolbox

is installed, the user will see the following three lines in the list:

signal\signal - Signal Processing Toolbox.

signal\siggui - Signal Processing Toolbox GUI

signal\sigdemos - Signal Processing Toolbox Demonstrations

Page 4: FACULTY OF ENGINEERING MULTIMEDIA UNIVERSITY LAB SHEETSfoe.mmu.edu.my/lab/lab sheet/TRIM3/EPSILON/ETN3096-DSP1,DSP2... · FACULTY OF ENGINEERING MULTIMEDIA UNIVERSITY LAB SHEETS

ETN3096: Digital Signal Processing

KSS/T3 2015/2016

4

To obtain the list of functions available under each, the user can type "help signal", "help

siggui" and "help sigdemos", respectively.

The basic signals used often in digital signal processing are the unit impulse signal [n],

exponentials of the form anu[n], sine waves, and their generalizations to complex exponentials.

Since the only numerical data type in MATLAB is the M x N matrix, signals must be represented

as vectors: either M x 1 matrices if column vector, or 1 x N matrices if row vectors. In MATLAB

all signals must be finite in length. This contrasts sharply with analytical problem solving, where

a mathematical formula can be used to represent an infinite-length signal (e.g. a decaying

exponential, anu[n]).

A second issue is the indexing domain associated with a signal vector. MATLAB assumes by

defauls that a vector is indexed from 1 to N, the vector length. In contrast, a signal vector is often

the result of sampling a signal over some domain where the indexing runs from 0 to N - 1; or,

perhaps, the sampling starts at some arbitrary index that is negative, e.g. at -N. The information

about the sampling domain cannot be attached to the signal vector containing the signal values.

Instead, the user is forced to keep track of this information separately. Usually, this is not a problem

until it comes time to plot the signal, in which case the horizontal axis must be labeled properly.

A final point is the use of MATLAB's vector notation to generate signals. A significant power

of the MATLAB environment is its high-level notation for vector manipulation. for loops are

almost always unnecessary. When creating signals such as a sine wave, it is best to apply the sin

function to a vector argument, consisting of all the time samples.

To familiarize himself with DSP using Matlab, for the first lab, the student will have to examine

a number of demonstration packages and comment on them. As mentioned before, the

understanding of what is going on is of the utmost importance, and the report should be individual

work.

Digital filters come in two types: FIR (Finite Impulse Response, non-recursive, always linear

phase) and IIR (Infinite Impulse Response, recursive, better performance, sometimes unstable).

They are low-pass, high-pass, band-pass or band-stop filters, meaning that they let either the low,

or the high, or a band of frequency pass, or they stop a band of frequencies. To design a filter, one

has to specify the passband (the frequencies that are allowed to pass, from 0 to the edge frequency,

or from the edge frequency to the maximum, or between two frequencies) with the maximum

attenuation that can be allowed in that frequency band; and the stopband with the minimum

attenuation that is required for those frequencies.

The response of a filter is determined by the positions of its zeros (for FIR filters) or poles and

zeros (for IIR filters) in the imaginary plane. Their position toward the unit circle will be very

important, as the unit circle represents the frequencies, from 0 (at complex number 1) to (at

complex number -1). To be stable, all the poles should be inside the unit circle. A zero near the

Page 5: FACULTY OF ENGINEERING MULTIMEDIA UNIVERSITY LAB SHEETSfoe.mmu.edu.my/lab/lab sheet/TRIM3/EPSILON/ETN3096-DSP1,DSP2... · FACULTY OF ENGINEERING MULTIMEDIA UNIVERSITY LAB SHEETS

ETN3096: Digital Signal Processing

KSS/T3 2015/2016

5

unit circle will attenuate the corresponding frequencies, while a pole will boost the same

frequencies.

4. Experimental Procedure

The first demonstration package to analyze is filtdem. Type the command "filtdem" in the

command window (it may not work for Matlab version 6.0 and above, it’s advisable that you use

Matlab version 5.3 when you execute this command). A slideshow starts to illustrate the design of

a band pass filter using MATLAB. Examine the slide show attentively. Copy each command of

the slideshow into a new m-file, save it and execute it. To open a new M-file, go to File -> New -

> M-file. Make it a habit by compiling your programs using a new m-file. If you just type them

into the command window and execute them, your codes will be lost after your exit MATLAB.

To have more information about any command, use the help function (e.g. "help ellip") in

the command window. The semicolon at the end of the line suppresses the output; to see the output

(and observe what the command is doing), type the command without the semicolon. Describe in

your report what each command line is doing. Use what you have learned to synthesize a signal

that is a combination of 4 sinusoids. Choose frequencies that are all different from the frequencies

mentioned in the slideshow and observe the corresponding spectrum. Choose another type of filter

(to find the other types of filter, type "help ellip") and analyze the influence of using another

filter order. Plot your result using the "stem" command instead of "plot", explain your

observations.

The second demonstration package to analyze is filtdemo. Type the command "filtdemo"

in the command window. Analyze the various low-pass filter designs using the interactive GUI.

Compare the characteristics of the seven available filters, examine their overall frequency response

as well as their passband and stopband characteristics. Vary the passband and stopband edge

frequencies, as well as the passband and stopband attenuations, either numerically, or by

interactive drag-and-drop in the display window. Comment on the results.

The third demonstration package to analyze is sigdemo1. Type the command "sigdemo1"

in the command window. Analyze the various signals (sine, rectangular, sawtooth) using the

interactive GUI by varying the amplitude and frequency, and seeing the Fourier representation

after applying one of the available windows. Comment on the results. Try to vary the frequency,

amplitude, signal shape, and window, and comment on the differences. Illustrate the problem of

aliasing using the GUI.

The fourth demonstration package to analyze is sptool. Type the command "sptool" in the

command window. In the "Filters" column, click the "View" button, disable the

"Magnitude" and "Phase" plots, and enable the "Zeros and Poles" plot. Next, in the

previous window, click "New Design", which brings you to a window similar to the one

encountered with "filtdemo". Arrange the windows so that you can see the "Filter

Viewer" and "Filter Designer" windows simultaneously. Analyze and comment on the

Page 6: FACULTY OF ENGINEERING MULTIMEDIA UNIVERSITY LAB SHEETSfoe.mmu.edu.my/lab/lab sheet/TRIM3/EPSILON/ETN3096-DSP1,DSP2... · FACULTY OF ENGINEERING MULTIMEDIA UNIVERSITY LAB SHEETS

ETN3096: Digital Signal Processing

KSS/T3 2015/2016

6

positions of poles and zeros for different filter design methods, passband and stopband edge

frequencies, and passband and stopband attenuations.

5.0 Deliverables

Your report is due one week from the date of the lab session and must discuss the

following tasks. However, these tasks needs to be completed during the lab session as

part of in-lab assessment before you are allowed to leave.

Task 1:

Plot the signal with 4 sine waves. Apply a bandpass filter and plot the signal after one of the sine

waves has been removed. Also include a plot of the the frequency response of the bandpass filter

you used.

Task 2:

Plot the four IIR filters that you learned in lecture. Keep the passband/stopband frequencies and

number of coefficients constant across all filters. Describe the characteristics of the passband and

stopband characteristics and the transition band of each filter.

Task 3:

1. Identify the sampling frequency of the system and show an example of aliasing.

2. Pick one type of signal, and pick one type of window (apart from the rectangular

window). Plot them and describe how windowing affects the resulting spectrum.

Task 4:

Create one IIR filter of your choice and compare the pole-zero plot with the frequency response

plot. Plot them. Describe the relationship between the two plots in terms of its pole and zero

frequencies.

Please refer to page 16 under Report Writing Guidelines on the format of your report.

Page 7: FACULTY OF ENGINEERING MULTIMEDIA UNIVERSITY LAB SHEETSfoe.mmu.edu.my/lab/lab sheet/TRIM3/EPSILON/ETN3096-DSP1,DSP2... · FACULTY OF ENGINEERING MULTIMEDIA UNIVERSITY LAB SHEETS

ETN3096: Digital Signal Processing

KSS/T3 2015/2016

7

DSP2: Design of a Digital Filter with MATLAB

1. Objectives

In this experiment, students are required to identify and analyze a digital audio signal with some

added noise. When the audio signal is recorded, it is often corrupted by noise. The objective of

this experiment is to identify these unknown noise signals to obtain the filter specification and to

eliminate them using a suitable digital filter implemented in MATLAB. This involves signal

spectrum analysis to produce filter performance specification. Subsequently the student is

required to design the filter that meet the specification by determining the filter order and finding

the filter coefficients. At the end of this lab the student should gain the practical knowledge to

design a FIR and IIR digital filter in MATLAB based on the given filter specification.

Note

Students are required to learn MATLAB and the basic theory of the FIR and IIR filter before

coming to the lab.

2. Apparatus

Desktop PC with soundcards,

MATLAB 5.3 with Signal Processing Toolbox,

Original and noise-corrupted audio files (WAV format)*.

* Each student will be assigned a different set of original audio signal and noisy audio signal in

".wav" format. Instructions on getting your files will be announced in MMLS.

3. Background Theory

A digital filter implements the difference equation that describes the algorithm to process the

time domain signal in order to achieve filtering objectives. The objective of filtering is to remove

signal in certain frequency range. The difference equation is implemented either in software on

DSP processor or on personal computers. It can also be implemented on hardware, for example

in FPGA or custom integrated circuit. The objective of the filter design is to obtain the filter

coefficients so that the difference equation of the filter can be implemented. Equation (3.1)

shows the standard difference equation for IIR filter (order = max (p,q)) and equation (3.2)

shows the standard difference equation for FIR filter of order q. The filter coefficients are given

by bk and ak .

Digital filters can be divided into finite impulse response (FIR) and infinite impulse response

(IIR) filter. IIR filter contains a feedback loop in the block diagram, hence the transfer function

of an IIR filter contains poles, and perhaps zeros as well. FIR filter, on the other hand, does not

)1.3(][][][10

p

k

k

q

k

k knyaknxbny )2.3(][][0

q

k

k knxbny

Page 8: FACULTY OF ENGINEERING MULTIMEDIA UNIVERSITY LAB SHEETSfoe.mmu.edu.my/lab/lab sheet/TRIM3/EPSILON/ETN3096-DSP1,DSP2... · FACULTY OF ENGINEERING MULTIMEDIA UNIVERSITY LAB SHEETS

ETN3096: Digital Signal Processing

KSS/T3 2015/2016

8

have the feedback loop, thus its transfer function consists of only zeros. Both types of filter have

its own advantages:

Advantages of FIR filter:

Can have exact linear phase,

FIR filters are realized non-recursively, thus are always stable,

Round-off noise and coefficient quantization errors much less severe,

Arbitrary frequency responses.

Advantages of IIR:

Analog filters can be readily transformed into equivalent IIR digital filters. This is

impossible with FIR filters as they have no analog counterpart,

Require less filter coefficients than FIR to achieve similar frequency response,

In many applications, linearity of phase response is not an issue.

Generally there are 8 stages in the design of a digital filter:

1. Specification of the filter requirements

2. Choice of a type of filter (FIR or IIR).

3. Determination of the filter order.

4. Finding a set of coefficients.

5. Implementation.

6. Quantization.

7. Redesigning if necessary.

8. Choosing the filter structure.

The first step of a digital filter design is the filter specification. The specification is in frequency

domain and based on the magnitude response of the filter. This is due to frequency selective

operation that the filter performs. The important parameters to be included are described in the

following diagram.

Page 9: FACULTY OF ENGINEERING MULTIMEDIA UNIVERSITY LAB SHEETSfoe.mmu.edu.my/lab/lab sheet/TRIM3/EPSILON/ETN3096-DSP1,DSP2... · FACULTY OF ENGINEERING MULTIMEDIA UNIVERSITY LAB SHEETS

ETN3096: Digital Signal Processing

KSS/T3 2015/2016

9

Figure 1: Digital Filter Specification

As shown in Figure 1, the parameters of the filter specification are the passband edge frequency

fp, the stopband edge frequency fs, maximum attenuation in passband (1/Ap), minimum

attenuation in the stopband (1/As) and the transition bandwidth (fs – fp). p define the

magnitude of the ripples allowed in the passband. The attenuation is usually expressed in the dB

unit. The filter to be designed must meet the criteria in the specification. Normally a low pass

filter is designed and the transfer function is modified in order obtain other types of filter such as

the high pass filter and the bandpass filter. The focus of this experiment is on stages (a) – (d),

using both the FIR and IIR filters.

For IIR filter, the filter order and the set of filter coefficients can be found directly from Matlab

functions. The design approach commonly used is to design a prototype analog filter and

transform it to an equivalent digital filter using method such as the bilinear transform. This

approach makes use of the many establish methods of analog filter design available such as the

Butterworth and Chebyshev filter. Figure 2 shows the design flow for an IIR filter using bilinear

transform. Take note that the cut-off frequency obtained from the filter specification is a

digital frequency where = 2 f/fsampling (f is frequency in Hz) and is the prewarped analog

frequency =2/Ts tan( /2), Ts= 1/ fsampling . The analog filter uses as the cut-off frequency.

Figure 2: IIR filter design using bilinear transform

|H ( f )|

1+ p

Ap=1- p

s

0 0

Passband Stopband

Transition

band

f f p f s

fampling/2

Page 10: FACULTY OF ENGINEERING MULTIMEDIA UNIVERSITY LAB SHEETSfoe.mmu.edu.my/lab/lab sheet/TRIM3/EPSILON/ETN3096-DSP1,DSP2... · FACULTY OF ENGINEERING MULTIMEDIA UNIVERSITY LAB SHEETS

ETN3096: Digital Signal Processing

KSS/T3 2015/2016

10

One common method used for designing the FIR filter is the windowing approach. The idea is to

truncate the infinite impulse response h(n) of an ideal low pass filter using a window function

such as a rectangle function. This is to produce a linear phase and causal FIR filter. This process

however distorts the magnitude response of the ideal filter by introducing ripples in the passband

and stopband. In addition, the transition band is created as well. Different types of window such

as the Hanning, Blackman and Hamming window can be used to mitigate this unwanted effect.

Figure 2 below shows the effect of windowing on the ideal frequency response.

cut-off

Figure 3: The ideal desired frequency response and the practical response

For FIR filter, we need to first determine the window type and the filter order. The window type

is determined based on the stopband attenuation, while the filter order is identified based on the

transition width:

- Rectangular window: αs= -21dB, N = 0.9 / f;

- Hanning window: αs= -44dB, N = 3.1 / f;

- Hamming window: αs= -53dB, N = 3.3 / f;

- Blackman window: αs= -74dB, N = 5.5 / f;

- Kaiser window: αs= -20log(δs), N = (s - 7.95) / (14.36 f);

f =( fstop - fpass)/ fsampling

The filter coefficients of FIR filter can then be found using Matlab function.

4. Experimental Procedure

The audio signals need to be compared both in time and in frequency domain. To read the signal,

use the function wavread. You can also use the function wavread to identify the sampling

frequency of audio files (type ‘help wavread’). The length of the signal can be obtained

using the command length. The sound wave can be played using the command wavplay

(don't be too annoying for your fellow students by playing it over and over again…). Before the

filter specification can be obtained, the frequency spectrum of the clean and noisy signal will

Page 11: FACULTY OF ENGINEERING MULTIMEDIA UNIVERSITY LAB SHEETSfoe.mmu.edu.my/lab/lab sheet/TRIM3/EPSILON/ETN3096-DSP1,DSP2... · FACULTY OF ENGINEERING MULTIMEDIA UNIVERSITY LAB SHEETS

ETN3096: Digital Signal Processing

KSS/T3 2015/2016

11

need to be obtained. This enable you to locate the noise frequency range by comparing the

spectrum plot for both the clean and noisy signal. The frequency spectrum or Fourier transform

can be obtained using the command fft. Note that the fft is a complex function, hence it can be

split up in its real and imaginary parts (functions imag and real) or in its amplitude and phase

(abs and angle). Usually, we are more interested in the amplitude than in the phase - can you

see why from the plot of both phase and amplitude? You are only required to plot the spectrum

magnitude till the Nyquist frequency.

Plot the amplitude of the frequency spectrum for both the original clean signal and noisy signal.

From the comparison between both, specify the requirements for a filter that would eliminate the

noise as much as possible and alter the signal as little as possible. From passband edge frequency

fp and stopband edge frequency fs, the cutoff frequency fc is calculated as the average of both.

The student will have to implement both an FIR and an IIR filter. Although the concepts behind

each type of filter are very different, and their usage is also quite different, their design using

MATLAB is quite similar, thanks to the power of the MATLAB Signal Processing Toolbox.

For the FIR filter, the command fir1 will be used. For this experiment, you should achieve a

peak passband ripple of 3 dB and minimum stopband attenuation of 30 dB. Which window will

you choose? Why? Determine the filter order N for the chosen window. Design the FIR filter

using the function fir1. The frequency response of the filter can be obtained using the function

freqz. Plot the designed filter frequency response and see whether the specifications are met.

Check especially the passband and stopband edge frequencies. If necessary, redesign the filter.

Apply the filter to the noisy signal using the function filter. For example, if the noisy signal

is stored in vector x and the designed FIR filter coefficients are stored in vector h, we can obtain

the filtered signal by using y = filter(h, 1, x). Plot the frequency spectrum or Fourier

transform of the filtered signal, and compare it with the Fourier transform of the original and of

the noisy signal. Discuss your findings.

For the IIR filter, the student has the choice between 4 types of filter: Butterworth, Chebyshev

type I, Chebyshev type II, and elliptic. The filter order can be determined using the functions

buttord, cheb1ord, cheb2ord and ellipord, respectively. As in the case of the FIR

filter, you should achieve a peak passband ripple of 3 dB and minimum stopband attenuation of

30 dB. Which filter type will you choose? Why? Determine the filter order N for the chosen filter

type. Design the IIR filter using the function butter, cheby1, cheby2 or ellip,

respectively. The frequency response of the filter can be obtained using the function freqz. Plot

the designed filter frequency response and see whether the specifications are met. Check

especially the passband and stopband edge frequencies. If necessary, redesign the filter.

Apply the filter to the noisy signal using the function filter. For example, if the noisy signal

is stored in vector x and the designed IIR filter coefficients are stored in vectors a and b, we

can obtain the filtered signal by using y = filter(b, a, x). Plot the Fourier transform of

Page 12: FACULTY OF ENGINEERING MULTIMEDIA UNIVERSITY LAB SHEETSfoe.mmu.edu.my/lab/lab sheet/TRIM3/EPSILON/ETN3096-DSP1,DSP2... · FACULTY OF ENGINEERING MULTIMEDIA UNIVERSITY LAB SHEETS

ETN3096: Digital Signal Processing

KSS/T3 2015/2016

12

the filtered signal, and compare it with the Fourier transform of the original and of the noisy

signal. Discuss your findings.

Summary of basic procedure and useful functions:

1. To read the wave file into a vector, use the wavread function. To play the sound

stored in the vector, use the wavplay function.

2. Plot the spectrum using the fft function, refer to the demo ‘filtdem’ on how to plot

the spectrum. Wherever possible, use the subplot function to combine the spectra

of the noisy and clean signal into a signal plot for easy comparison.

3. Determine the cut-off frequency, transition width, and filter order required. For FIR

filter, the filter order needs to be computed manually. For IIR, it can be computed

using either the buttord, cheb1ord, cheb2ord and ellipord functions.

4. Design a low-pass filter using. For FIR, use the fir1 function. For IIR, use either

the butter, cheby1, cheby2 or ellip functions.

5. Filter the noisy signal using the filter function.

6. Compare the frequency spectrum again to check if the noise has been removed. You

can play back the sound too to check if the quality has been improved.

5. Exercise Questions

a) Describe the filter specification used and the results obtained using FIR and IIR filter.

Use data tables to tabulate your result.

Write a MATLAB code to compute the difference between the frequency samples of the

clean signal and the noisy signal. The frequency samples of the signal can be obtained

using the MATLAB fft function. Use the code to estimate the noise frequency range.

Your filter design specifications depend on this estimation.

Noise frequency range (Hz): _____

Filter Specification

Sampling frequeny (Hz): ______ Nyquist Frequency (Hz) ____

Passband edge frequency (Hz): ____ Passband frequency range: ______

Stopband edge frequency (Hz): ______ Stopband frequency range: ______

Maximum passband attenuation (dB): _____ Minimum stopband attenuation (dB):

____

i) Tabulate the performance of the FIR filter obtained. Plot the frequency response graph.

FIR Filter Design with Window Method

Page 13: FACULTY OF ENGINEERING MULTIMEDIA UNIVERSITY LAB SHEETSfoe.mmu.edu.my/lab/lab sheet/TRIM3/EPSILON/ETN3096-DSP1,DSP2... · FACULTY OF ENGINEERING MULTIMEDIA UNIVERSITY LAB SHEETS

ETN3096: Digital Signal Processing

KSS/T3 2015/2016

13

Implemented filter

Design method used. Mention the window

function used.

Minimum order attained, N

Attenuation at passband edge frequency.

(dB)

(Obtained from frequency response graph)

Attenuation at stopband edge frequency.

(dB)

(Obtained from frequency response graph)

Which window function provides the best performance? Justify your answer.

How many filter coefficients is used to implement the FIR filter?

ii) Use Matlab function to estimate the order of the various IIR filter. Write the answer in

the table below. Which IIR filter gives the best performance? Explain your answer from

the aspect of computational complexity and memory requirement of the filter

implementation.

IIR Filter Types Butterworth Type 1

Chebychev

Type 2

Chebychev

Elliptic

filter

Minimum order attained,

N

Comment on ripples in the

passband

iii) Fill up the table below with the result obtained from the chosen IIR filter. Plot the

frequency response graph.

IIR Filter Design with Bilinear Transform

Implemented filter

Design method. Mention the analog prototype

filter used.

Minimum order attained, N

Attenuation at passband edge frequency. (dB)

(Obtained from frequency response graph)

Attenuation at stopband edge frequency. (dB)

(Obtained from frequency response graph)

b) Based on the filter that you have designed, compare and comment on the performance of

the FIR and IIR filters. Explain if the filters designed successfully remove the noise.

Explain your answer by referring to the frequency spectrum of the clean, noisy and

Page 14: FACULTY OF ENGINEERING MULTIMEDIA UNIVERSITY LAB SHEETSfoe.mmu.edu.my/lab/lab sheet/TRIM3/EPSILON/ETN3096-DSP1,DSP2... · FACULTY OF ENGINEERING MULTIMEDIA UNIVERSITY LAB SHEETS

ETN3096: Digital Signal Processing

KSS/T3 2015/2016

14

filtered signal. Explain why the filtered signal is not perceptually similar to the clean

signal.

6. Report Writing Guidelines

The lab report must be type written and shall consist of the following headings. Write clearly and

concisely to describe the important elements of your experiment. All graphs and tables need to be

labeled properly. Describe the data with proper units. The answer from the questions in section 5

can be incorporated into the result and discussion section. If there is any numerical calculation, it

needs to be shown in the procedure section. Don’t forget to mention the filter specification and

design parameters used.

i) A header page

which mentions student name and ID number, subject, lab number, date

of experiment and date of report

ii) Introduction

This section introduces the basic theory underlying the experiment.

iii) Objectives

State the specific investigation that you would like to conduct in this

experiment.

iv) Procedures

Explain the procedure and the methodology used

v) Results and Discussion

Describe the results obtained in a suitable form such as table and graph.

Discuss the finding of the experiment from the result obtained.

vi) Conclusion

Derive conclusion based on your findings and results

vii) References

WARNING:

Students who are found to have copied someone else's report and the ones who let somebody

else copy their reports will all get their marks averaged. For example, two students with similar

reports originally deserving 20 marks each will each get 10 marks; and three students with

similar reports originally deserving 18 marks each will each get 6 marks instead. A complete

database of your seniors’ reports will also be used in the copy detection process.

Plagiarizing reports of previous years will result in getting zero marks.

Please send a hardcopy of your lab 2 report to Dr Shima. With your report, please include a CD

that includes a softcopy of the report and the sound files before and after filtering.

7. Further Readings

[1] J. H. McClellan, R. W. Schafer, and M. A. Yoder, Signal Processing First. Upper

Saddle River, NJ: Prentice Hall, 2003.

[2] V. K. Ingle and J. G. Proakis, Digital Signal Processing Using MATLAB V.4. Boston:

PWS Publishing Company, 1997.

[3] E. C. Ifeachor and B. W. Jervis, Digital Signal Processing: A Practical Approach, 2nd

ed. Upper Saddle River, NJ: Prentice Hall, 2001.

Page 15: FACULTY OF ENGINEERING MULTIMEDIA UNIVERSITY LAB SHEETSfoe.mmu.edu.my/lab/lab sheet/TRIM3/EPSILON/ETN3096-DSP1,DSP2... · FACULTY OF ENGINEERING MULTIMEDIA UNIVERSITY LAB SHEETS

ETN3096: Digital Signal Processing

KSS/T3 2015/2016

15

[4] M. H. Hayes, Schaum's Outline of Theory and Problems of Digital Signal Processing,

New York: McGraw-Hill, 1999.

[5] J. G. Proakis and D. G. Manolakis, Digital Signal Processing: Principles, Algorithms,

and Applications, 3rd ed. Englewood Cliffs, NJ: Prentice Hall, 1996.

[6] A. V. Oppenheim and R. W. Schafer, Discrete-Time Signal Processing. Englewood

Cliffs, NJ: Prentice-Hall, 1989.

Marking Scheme

Assessment Components %

1 Format and presentation of report. 20

2 Acquisition of basic MATLAB programming skills. 20

3 Correctness in calculations and illustrations. 20

4 Correctness in relating and explaining the results obtained. 20

5 Depth of discussion. 20

Page 16: FACULTY OF ENGINEERING MULTIMEDIA UNIVERSITY LAB SHEETSfoe.mmu.edu.my/lab/lab sheet/TRIM3/EPSILON/ETN3096-DSP1,DSP2... · FACULTY OF ENGINEERING MULTIMEDIA UNIVERSITY LAB SHEETS

ETN3096: Digital Signal Processing

KSS/T3 2015/2016

16

FACULTY OF ENGINEERING

LAB REPORT SUBMISSION

ETN3096 DIGITAL SIGNAL PROCESSING

TRIMESTER 3 SESSION 2015/2016

Student Name: ………..………………………………………………………………

Student ID: ………………………………

Lab Group No.: ………………………………

Degree Major: ………………………………

Declaration of originality:

I declare that all sentences, results and data mentioned in this report are from my own work.

All work derived from other authors have been listed in the references. I understand that

failure to do this is considered plagiarism and will be penalized.

Note that collaboration and discussions in conducting the experiments are allowed but

copying and any act of cheating in the report, results and data are strictly prohibited.

Student signature: …………………………………………

Experiment title: DSP1: Introduction to DSP with MATLAB

DSP2 – Design of a Digital Filter with MATLAB

Experiment Date: ………………………………

Table/PC No.: ………………………………

Date Submitted: ……………………................

Lab Instructor Name: ……………………………………… Verified:………………….

(Please get your lab instructor signature after they have verified your result)