ECE 5650/4650 MATLAB Project 1

Similar documents
Basic Signals and Systems

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

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

Electrical & Computer Engineering Technology

Lab S-5: DLTI GUI and Nulling Filters. Please read through the information below prior to attending your lab.

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

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

DSP Laboratory (EELE 4110) Lab#10 Finite Impulse Response (FIR) Filters

ECE 5650/4650 Exam II November 20, 2018 Name:

DFT: Discrete Fourier Transform & Linear Signal Processing

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

ECE Digital Signal Processing

Lab 8: Frequency Response and Filtering

Experiments #6. Convolution and Linear Time Invariant Systems

EE 422G - Signals and Systems Laboratory

ECE 5650/4650 Computer Project #3 Adaptive Filter Simulation

SIGNALS AND SYSTEMS LABORATORY 3: Construction of Signals in MATLAB

ELT COMMUNICATION THEORY

Biomedical Signals. Signals and Images in Medicine Dr Nabeel Anwar

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

George Mason University ECE 201: Introduction to Signal Analysis Spring 2017

EEO 401 Digital Signal Processing Prof. Mark Fowler

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

STANFORD UNIVERSITY. DEPARTMENT of ELECTRICAL ENGINEERING. EE 102B Spring 2013 Lab #05: Generating DTMF Signals

ELEC-C5230 Digitaalisen signaalinkäsittelyn perusteet

SMS045 - DSP Systems in Practice. Lab 1 - Filter Design and Evaluation in MATLAB Due date: Thursday Nov 13, 2003

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

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

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

Experiment 2 Effects of Filtering

DSP First. Laboratory Exercise #7. Everyday Sinusoidal Signals

Adaptive Systems Homework Assignment 3

Signal Processing. Introduction

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

EEM478-WEEK8 Finite Impulse Response (FIR) Filters

1 PeZ: Introduction. 1.1 Controls for PeZ using pezdemo. Lab 15b: FIR Filter Design and PeZ: The z, n, and O! Domains

Problem Set 1 (Solutions are due Mon )

MATLAB SIMULATOR FOR ADAPTIVE FILTERS

Subtractive Synthesis. Describing a Filter. Filters. CMPT 468: Subtractive Synthesis

Lab 4 An FPGA Based Digital System Design ReadMeFirst

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

ESE531 Spring University of Pennsylvania Department of Electrical and System Engineering Digital Signal Processing

DIGITAL FILTERS. !! Finite Impulse Response (FIR) !! Infinite Impulse Response (IIR) !! Background. !! Matlab functions AGC DSP AGC DSP

UNIVERSITY OF WARWICK

Project 2 - Speech Detection with FIR Filters

DSP First. Laboratory Exercise #2. Introduction to Complex Exponentials

LABORATORY - FREQUENCY ANALYSIS OF DISCRETE-TIME SIGNALS

EEL 4350 Principles of Communication Project 2 Due Tuesday, February 10 at the Beginning of Class

UNIVERSITY OF WARWICK

Lakehead University. Department of Electrical Engineering

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

Design Digital Non-Recursive FIR Filter by Using Exponential Window

Digital Filter Design using MATLAB

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

George Mason University Signals and Systems I Spring 2016

Lab S-4: Convolution & FIR Filters. Please read through the information below prior to attending your lab.

GEORGIA INSTITUTE OF TECHNOLOGY SCHOOL of ELECTRICAL and COMPUTER ENGINEERING. ECE 2025 Fall 1999 Lab #7: Frequency Response & Bandpass Filters

Lab 6: Sampling, Convolution, and FIR Filtering

EE 5410 Signal Processing

Laboratory Assignment 4. Fourier Sound Synthesis

ECE 4213/5213 Homework 10

Interpolated Lowpass FIR Filters

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

The Formula for Sinusoidal Signals

FINITE IMPULSE RESPONSE (FIR) FILTERS

Project I: Phase Tracking and Baud Timing Correction Systems

1 Introduction and Overview

ASN Filter Designer Professional/Lite Getting Started Guide

Sampling and Reconstruction of Analog Signals

George Mason University ECE 201: Introduction to Signal Analysis

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

Instruction Manual for Concept Simulators. Signals and Systems. M. J. Roberts

Signal Processing Toolbox

Decoding a Signal in Noise

Lecture 17 z-transforms 2

Armstrong Atlantic State University Engineering Studies MATLAB Marina Sound Processing Primer

Universiti Malaysia Perlis EKT430: DIGITAL SIGNAL PROCESSING LAB ASSIGNMENT 1: DISCRETE TIME SIGNALS IN THE TIME DOMAIN

System Identification and CDMA Communication

Lecture 3, Multirate Signal Processing

Filters. Phani Chavali

Multirate Digital Signal Processing

Additive Synthesis OBJECTIVES BACKGROUND

DSP First Lab 08: Frequency Response: Bandpass and Nulling Filters

ECE 2026 Summer 2016 Lab #08: Detecting DTMF Signals

Part One. Efficient Digital Filters COPYRIGHTED MATERIAL

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

Lab S-9: Interference Removal from Electro-Cardiogram (ECG) Signals

Design of FIR Filters

UNIVERSITY OF UTAH ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT

ECE 3500: Fundamentals of Signals and Systems (Fall 2014) Lab 4: Binary Phase-Shift Keying Modulation and Demodulation

CS3291: Digital Signal Processing

Solution Set for Mini-Project #2 on Octave Band Filtering for Audio Signals

Signal Processing. Naureen Ghani. December 9, 2017

Experiment 1 Introduction to MATLAB and Simulink

Spring 2014 EE 445S Real-Time Digital Signal Processing Laboratory Prof. Evans. Homework #2. Filter Analysis, Simulation, and Design

Contents. Introduction 1 1 Suggested Reading 2 2 Equipment and Software Tools 2 3 Experiment 2

Octave Functions for Filters. Young Won Lim 2/19/18

EE 403: Digital Signal Processing

ece 429/529 digital signal processing robin n. strickland ece dept, university of arizona ECE 429/529 RNS

Transcription:

This project is to be treated as a take-home exam, meaning each student is to due his/her own work. The project due date is 4:30 PM Tuesday, October 18, 2011. To work the project you will need access to MATLAB and at minimum the signal processing toolbox. Introduction This first MATLAB DSP project will get you acquainted/reacquainted with MATLAB and then move into the exploration of Discrete-time signal generation Sequence convolution and the convolution sum Linear constant coefficient difference equations (LCCDEs) The discrete-time Fourier transform (DTFT) It is the student s responsibility to learn the very basics of MATLAB. There are many resources on the internet. One such example is course notes available in PDF form, from http:// www.eas.uccs.edu/wickert/ece1010/. A Quick MATLAB Review Recall that MATLAB stands for matrix laboratory, so it goes without saying that MATLAB is very efficient at doing matrix oriented numerical calculations. MATLAB supports many data types, but the two data types we will work with the most, are scalar numbers (real and complex), and matrices (real and complex). For our signal processing needs the matrices we create will most often be vectors, that is matrices of dimension m 1 or 1 n. The default data type for real and complex numbers is double precision. Complex numbers are handled transparently in MATLAB, so there is no need to worry about these details, for the most part. In fact, when MATLAB starts-up, it has both i and j defined as 1, i.e., at the command window, as shown in Figure 1, enter >> j ans = 0 + 1.0000i Note that if you use i and j for something else, these definitions will be overwritten. The matrix specialization of MATLAB means that the most efficient programming requires vectorizing. This is an aspect of using MATLAB that most students master over time. Getting your code to work in some fashion is first and foremost. Writing tight code is something that requires practice. The Colon Operator Suppose we wish to create a vector of time samples for We enter at the command window >> t = 0:0.01:5; >> size(t) t 05 s, with sample spacing of 0.01s. Introduction 1

Figure 1: The MATLAB integrated development environment configured with the function/script editor in the upper right, the command window in the lower right, the current directory, workspace, and figure windows all tabbed in the upper left, and finally the command history in the lower left. ans = 1 501 >> cls % clear the command window screen >> clf % clear the active figure window >> figure(1) % open a new figure window or address #1 if already open The variable t is now a row vector containing one row and 501 columns. If all we wanted was integer steps, we could simply enter >> n = 0:10 n = 0 1 2 3 4 5 6 7 8 9 10 Note the semicolon at the end of a statement, suppresses the automatic listing of the return variable. We can create a function of the vector t, say xt = cos 2 2 t, by writing >> x = cos(2*pi*2*t); A plot of x versus t can be made using the plot() command. >> plot(t,x) In Figure 1 we see the results. For the new user, the MATLAB environment needs to be customized by the user to take on the appearance of Figure 1, or whatever IDE set-up you prefer. We started out showing how the colon operator can be used to create a vector. The colon operator can also be used to access portions of an array or matrix, e.g. Introduction 2

>> V = rand(6,6) V = 0.8147 0.2785 0.9572 0.7922 0.6787 0.7060 0.9058 0.5469 0.4854 0.9595 0.7577 0.0318 0.1270 0.9575 0.8003 0.6557 0.7431 0.2769 0.9134 0.9649 0.1419 0.0357 0.3922 0.0462 0.6324 0.1576 0.4218 0.8491 0.6555 0.0971 0.0975 0.9706 0.9157 0.9340 0.1712 0.8235 >> V(1:2,4:5) ans = 0.7922 0.6787 0.9595 0.7577 >> V(:,3:5) ans = 0.9572 0.7922 0.6787 0.4854 0.9595 0.7577 0.8003 0.6557 0.7431 0.1419 0.0357 0.3922 0.4218 0.8491 0.6555 0.9157 0.9340 0.1712 Note that rand() produces uniformly distributed random numbers on the interval [0, 1]. It can also be used to store values into an array or matrix, e.g., >> W = zeros(6,3) W = >> W(2:4,2:3) = rand(3,2) W = 0 0.6948 0.0344 0 0.3171 0.4387 0 0.9502 0.3816 Functions One of the key building blocks in constructing a MATLAB simulation, is the ability to write custom user functions. To demonstrate this, we will create a function that generates a sinusoid with a delayed turn-on time, i.e., xt = Acos 2 f 0 t + ut t 0 (1) The signal model above is a continuous-time sinusoid, but the MATLAB produced signal will be discrete-time in nature, because we will be letting t nt = n f s, where f s is the sampling rate. The end result will be a signal vector xn with corresponding integer time axis n and a corresponding time axis t. Introduction 3

We require the MATLAB function to take as inputs the frequency f 0, the phase, the sampling rate f s, the delay time t 0, and the time duration for the waveform, Tsim. The amplitude is taken to be one. The function listing is given below: function [x,t,n] = cos_gen(f0,phi,t0,fs,tsim) % [x,t,n] = cos_gen(f0,phi,t0,fs,tsim) % Generate a cos signal/sequence for Tsim s %================ Inputs ========================================= % f0 = frequency in Hz % phi = phase in radians % to = turn-on time delay in s % fs = sampling rate in samples per second % Ts = simulation duration in s %================ Outputs ======================================== % x = signal vector (a row vector) % t = time axis in s corresponding to x % n = integer axis corresponding to t %//////////////////////////////////////////////////////////////// % Mark Wickert September 2008 % Create the time axis >> t = 0:1/fs:Tsim; % Create the corresponding integer time axis >> n = 0:length(t)-1; % Cosine wave starting at t = 0 >> x = cos(2*pi*f0*t+phi); % Zero samples for t < t0 using the find function % The vector idx holds the indices where t < t0 >> idx = find(t < t0); % Replace the elements of x having the indices of idx % with a vector of zeros [x,t,n] = cos_gen(10,0,.2,200,0.5); 1 [x,t,n] = cos_gen(10,pi/2,.2,200,0.5); 1 Amplitude 0.5 0 0.5 Amplitude 0.5 0 0.5 1 0 0.1 0.2 0.3 0.4 Time (s) [x,t,n] = cos_gen(10,pi/2,.1,200,0.5); 1 1 0 0.1 0.2 0.3 0.4 Time (s) [x,t,n] = cos_gen(10,0,.05,200,0.25); 1 Amplitude 0.5 0 0.5 Amplitude 0.5 0 0.5 1 0 0.1 0.2 0.3 0.4 Time (s) 1 0 0.05 0.1 0.15 0.2 Time (s) Figure 2: Plots obtained from the MATLAB function cos_gen(). Introduction 4

>> x(idx) = zeros(size(idx)); To demonstrate the function in action consider T sim = 5 s for various value of the other parameters, as shown in Figure 2. The command line used to create each plot is shown as the title of each plot. Each plot is created as an overlay of a line plot and plot of just the sample points, as follows: >> [x,t,n] = cos_gen(10,0,.2,200,0.5); >> plot(t,x) >> hold Current plot held >> plot(t,x,.r ) >> grid >> xlabel( Time (s) ) >> ylabel( Amplitude ) >> title( [x,t,n] = cos_gen(10,0,.2,200,0.5); ) Note that the array of four plots is crated using the subplot() command, e.g., >> subplot(2,2,1) % a 2 x 2 array, the first element, L to R/T to B, is >> plot() % etc We also have created embedded help for the function cos_gen() by including comment lines immediately following the function declaration, e.g., function [x,t,n] = cos_gen(f0,phi,t0,fs,tsim) % [x,t,n] = cos_gen(f0,phi,t0,fs,tsim) % Generate a cos signal/sequence for Tsim s %================ Inputs ========================================= % f0 = frequency in Hz % phi = phase in radians% to = turn-on time delay in s % fs = sampling rate in samples per second % Ts = simulation duration in s %================ Outputs ======================================== % x = signal vector (a row vector) % t = time axis in s corresponding to x % n = integer axis corresponding to t %//////////////////////////////////////////////////////////////// % Mark Wickert September 2008 The result when we type help function_name at the command prompt is: >> help cos_gen [x,t,n] = cos_gen(f0,phi,t0,fs,tsim)generate a cos signal/sequence for Tsim s ================ Inputs ========================================= f0 = frequency in Hz phi = phase in radians to = turn-on time delay in s fs = sampling rate in samples per second Ts = simulation duration in s ================ Outputs ======================================== x = signal vector (a row vector)t = time axis in s corresponding to x n = integer axis corresponding to t Introduction 5

//////////////////////////////////////////////////////////////// Mark Wickert September 2008 Problems Signal Generation In this problem you will write a MATLAB function for generating a pulse train signal. You will then explore some properties of this signal. The signal will be a purely discrete-time signal of the form where here pn N p 1 xn = pn km D 0 n N 1 k = 0 is a rectangular pulse shape of the form (2) pn = 1, 0 n W 1 0, otherwise (3) Write your code so that in the future a different pulse shape may be utilized. 1. Problem statement a) Write the function discrete_pulse_train() to have the following function prototype: function [x,n] = discrete_pulse_train(w,m,np,d,n) % [x,n] = discrete_pulse_train(w,m,np,d,n) % Generate a discrete-time pulse train %================ Inputs ========================================= % W = pulse width in samples % M = period in samples, M > W % Np = Number of periods to create (if 0 full out to N samples) % D = turn-on delay in samples of the first period % N = total number of samples to create %================ Outputs ======================================== % x = signal vector (a row vector) % n = integer time axis corresponding to x %//////////////////////////////////////////////////////////////// An example plot from this function obtained using the command line >> [x,n] = discrete_pulse_train(5,18,4,13,200); is shown in Figure 3. Problems 6

[x,n] = discrete_pulse_train(5,18,4,13,200); 1 0.8 Amplitude 0.6 0.4 0.2 0 0 10 20 30 40 50 60 70 80 90 100 Samples (n) Figure 3: Plots obtained from the MATLAB function discretepulse_train(). b) Test the function and produce output stem() function plots for the function parameter entries given in Table 1. Table 1: Parameter values for test plots to be created with the function discrete_ pulse_train.m. W M Np D N 15 20 3 0 100 8 20 10 0 100 8 20 0 (limited by N ) 5 200 5 1 60 5 10 0 5 60 c) Working from the command window, create a co-sinusoidal pulse train signal of the form yn = N p 1 cos 0 n pn km n 0 0 n N p 1 k = 0 (4) Problems 7

Convolution This signal could be used as the basis for a pulsed RADAR simulation waveform. As a specific test case, generate and plot the output vector y for >> [x,n] = discrete_pulse_train(50,500,0,0,10000); and 0 = 10. Here with so many points in the signal, it is OK to use plot() instead of stem(). If say the sampling rate is f s = 1 T = 10 MHz, what is the corresponding pulse width in seconds and pulse repetition frequency in Hz? Here we consider the mechanics of the convolution sum and related properties. We will utilize the pulse train signal generator from Problem 1 and MATLAB s conv() function to validate some familiar concepts from continuous-time convolution. 2. Consider sequences x 1 and x 2 each defined on n 019 as follows: >> x1 = discrete_pulse_train(5,20,1,5,20); >> x2 = discrete_pulse_train(8,20,1,0,20); a) Obtain y 1 = x 1 *x 1 and plot it using the stem() function with a properly scaled sequence axis n. Comment your plot relative to theoretical expectations with regard to nonzero duration (support interval) of the output, the shape, and the peak value. b) Repeat part (a), except now explore y 11 = x 1 *x 1 *x 1. What can you say in general about the support interval of y 11 and the pulse duration? c) Repeat part (a), except now explore y 12 = x 1 *x 2. 3. We will now consider multiple pulses in signal x 1 : >> x3 = discrete_pulse_train(5,20,2,5,60); >> x4 = discrete_pulse_train(5,20,0,5,50); a) Obtain y 3 = x 3 *x 3 and plot it using the stem() function with a properly scaled sequence axis n. Comment your plot relative to theoretical expectations with regard to nonzero duration (support interval) of the output, the shape, and the peak value. b) Repeat part (a) for y 4 = x 4 *x 4. Is the result consistent with what your observed in part (a)? What pattern is developing? Problems 8

Difference Equations, Frequency Response, and Filtering To begin with we will consider a simple exponential sequence and how it can be generated via a recursion or difference equation. Then we will consider filtering the pulse train signal of Problem 1 using both FIR and IIR filters. 4. The real exponential pulse signal has both finite and infinite duration forms: y 1 = a n un un L, (5) y 2 = a n un where in both cases we assume that 1 a 1. a) At the command window generate and plot using the stem()function, y 1 for L = 40, a = 0.8, and 0 n 50. Hint: You should be able to use the pulse train function to help generate this signal. Now feed y 1 through an accumulator system which has difference equation z 1 = z 1 n 1 + y 1. (6) You can use the MATLAB function filter() to make this easy. Note the final or steady-state value of z 1. Compare it with the theoretical value using the geometric series sum formula S L 1 a n = = n = 0 1 a L -------------. (7) 1 a b) Repeat part (a) using y 2, but this time generate the signal by driving into the system having difference equation yn = ay n 1 + xn. (8) In this case let 0 n 100. Again compare the approximate steady-state value with the theoretical value obtained via the infinite geometric series. 5. In this problem we consider the steady-state response of an IIR notch filter. To begin with we know that when a sinusoidal signal of the form xn = Acos 0 n + n (9) is passed through an LTI system having frequency response the form He j, the system output is of yn AH e j 0 0 n + He j 0 = cos + n (10) In this problem the input will be of the form xn = Acos 0 n + un, so the output will consist of both the transient and steady-state responses. For n large the output is in steady-state, and we should be able to determine the magnitude and phase response at 0 from the waveform. The filter of interest is Problems 9

He j = e j e j2 1 2cos 0 + -------------------------------------------------------------------- 1 2rcos 0 e j + r 2 e j2 (11) where controls the center frequency of the notch and r controls the bandwidth. 0 a) Using freqz() plot the magnitude and phase response of the notch for 0 = 2 and r = 0.9. Plot the magnitude response as both a linear plot, He j, and in db, i.e., 20log 10 He j. b) Using filter(), input cos 3 n for 0 n 50. Determine from the output sequence plot approximate values for the filter gain and phase shift at = 3. Note that the filter still has center frequency 0 = 2. Also, plot the transient response as a separate plot, from your knowledge of the theoretical steady-state response. c) Assume that the filter operates within an A/D-He j -D/A system. An interfering signal is present at 120 Hz and the system sampling rate is set at 2000 Hz. Determine 0 so that the filter removes the 120 Hz signal. Simulate this system by plotting the filter output in response to the interference signal input. Determine in ms, how long it takes for the filter output to settle to yn 0.01, assuming the input amplitude is one. Sub-Optimal Filtering of Noisy Speech 6. Consider filtering noisy speech signals using a 65-tap (64th-order) FIR linear phase lowpass filter of the form = b k e jk He j The filter will be designed using the MATLAB function M k = 0 >> b = fir1(64,wn); % Wn = cutoff frequency relative to pi <-> % 1.0, thus wc = pi/2 --> set Wn = 0.5 % If fc = 2 khz & fs = 8000 Hz, wc = 2*fc/fs FYI: This filter design function, part of the Signal Processing Toolbox, uses windowing of a truncated ideal brickwall filter impulse response. The system model is shown in Figure 4. In (12) dn 8 ksps speech wave files from zip package + wn xn Noise corrupted speech signal FIR Lowpass 65 Taps f c yn = dˆ Lowpass filter with variable cutoff frequency to achieve minimum mean-square error Figure 4: Noisy speech signal and a MMSE estimator that uses an FIR lowpass filter. Problems 10

practice we only have access to the noisy signal xn. For the initial filter design we have access to dn test vectors to complete the design of a sub-optimum filter for the estimation of dn from xn. a) Plot the magnitude and phase response of this filter for f c = 2 khz, assuming f s = 8 khz. When using freqz() you will want to use the form [H, F] = freqz(b,a,n,fs); % Say N = 1024, Fs = 8000 or 8k You may want to explore the use of the filter view function, fvtool(b,a, fs,8000). Note the passband ripple in db and the stopband attenuation level in the magnitude response. b) The zip package for Set 1p contains two 8 ksps audio speech files (in.wav format) which can be read into the workspace or a MATLAB function via: d1 = wavread('osr_us_000_0030_8k.wav'); % Male voice, column vec d2 = wavread('osr_us_000_0018_8k.wav'); % Female voice, column vec In the block diagram the speech files constitute dn. To listen to these sound files inside MATLAB you can use the sound() function sound(d,8000); % d = d1 or d2, or both together as [d1; d2] We are now going to add white Gaussian noise wn to dn as follows: >> SNRdB = 10.0; % note in later parts the SNR in db will be changed >> var_w = var(d)/10^(snrdb/10); >> w = sqrt(var_w)*randn(size(d)); % Gaussian noise of variance var_w >> x = d + w; % form signal plus noise Pass this signal through the filter of part (a) and plot using subplots both the noisy input x and filtered version of x (y) for just 500 samples. It is OK to use plot() instead of stem() due to the large number of points involved. Note that the signal-to-noise ratio SNR is initially set to 10 db. c) Continuing from part (b), we will now adjust the filter cutoff so as to minimize the mean-square error (MSE) between the noise free input, d, and the filtered noisy output, y. The filter forms the estimate dˆ. To obtain the minimum MSE (MMSE), you will first need to calculate the mean-squared error (MSE) in a meaningful way. Since the long 65-tap FIR filter introduces a mean signal delay of ((65-1)/2 = 32 samples, the input and output vectors need to be trimmed. There is also a transient period present in the filter output. Choose a reasonable value for the trim interval based on the waveform plot of part (b). The MSE can then be found using >> MSE = var(d_trim - y_trim); where d_trim is the trimmed noise-free input and y_trim is the trimmed filter output when noise is present. Note that var() is MATLAB s sample variance estimator. You now need to repeat this experiment for different values of fc in the FIR filter design, to find the approximate MMSE. Collect data using a concatenation of the male and female Problems 11

speech vectors plus noise. The intent is obtain a filter design that works for both male and female voices. You should plot MMSE in db (10*log10(MSE)) versus fc in Hz for fc values ranging from [500, 3500] Hz. Create a family of curves using the same range of fc values with SNR fixed at 50, 20, 10, and 5 db. Does it makes sense that the optimum fc value changes with SNR? d) For the case of SNR = 10 db export xn and yn for your optimum fc to a.wav file. ZIP these files up and Email them to me as part of the assignment requirements. Comment the intelligibility of the pre- and post-filter speech quality. Bibliography/References [1] J. H. McClellan, C.S. Burrus, A.V. Oppenheim, T.W. Parks, R.W. Schafer, and H.W. Schuessler, Computer-Based Exercises for Signal Processing Using MATLAB 5, Prentice Hall, New Jersey, 1998. [2] S.K. Mitra, Digital Signal Processing: A Computer Based Approach, third edition, Mc Graw Hill, New York, 2006. [3] S.K. Mitra, Digital Signal Processing Laboratory Using MATLAB, McGraw Hill, New York, 1999. [4] M.J. Smith and R.M. Mersereau, Introduction to Digital Signal Processing: A Computer Laboratory Textbook, John Wiley, New York, 1992. Bibliography/References 12