Homework 7

Lecture Homework Exams Demos

Due Friday, May 2

Text Problems:

12.1-3
12.2-1
12.2-2
12.2-4
Show that the impulse response for the ideal bandstop filter is:

Matlab Problems: Pole-Zero and FIR Filter Design

Notch filters for signal removal and enhancement.

Introduction:

In this assignment, you will use the filter design method of pole-zero placement to design simple filters that delete or enhance a narrow frequency band. Placing a zero on the unit circle will create a notch in the frequency domain. The location of the zero determines the location of the notch. The shape of the notch can be altered by putting a pole directly inside of the zero at the same angle. If the pole is closer to the zero, then the notch will be narrower. The cost of the narrower notch is that the filter transients take longer to settle out.

NOTE: All poles and zeros should be entered as complex conjugate pairs, i.e. if a complex zero is added, its complex conjugate should also be added as a zero.

The main steps of the program are given below. This program will be used as a model for the rest of the assignment. The picture shows the effects of the filter.

1. Load wave file or other signal, call it x.

2. Create column vectors of poles and zero to define the filter, p and z

3. Convert the pole/ zero representation into a rational transfer function and plot the poles and zeros and the frequency response using the command zp2tf: [num,den]=zp2tf(z,p,1);

4. Filter the signal,x, to remove the interference and plot the resulting signal using the filter command: y=filter(num,den,x)

Assignment:

1. The speech signal sampled at 11025 Hz has been corrupted with a sinusoidal tone at 500Hz (hw6file.wav). Design a filter to remove the tone that uses only zeros. Give your filter design and a copy of the filter frequency response. Use the commands wavread and wavwrite to input the file and store your results. What does the filtered signal sound like (use soundsc command)?

NOTE: [signal,fs]=wavread('hw6file.wav');wavwrite(signal,fs,'filename.wav');

2. The speech signal sampled at 11025 Hz has been corrupted with a sinusoidal tone at 500Hz (hw6file.wav). Design a filter to remove the tone that uses both poles and zeros. Give your filter design and a copy of the filter frequency response. Compare your results to part 2. The original speech signal is here (simpsonb.wav)

FIR Filter Design Using Windows

Build a linear phase, low-pass FIR filter using a fixed window (rectangular, Hanning, Hamming, or Blackman). The design constraints are: sampling rate of 10 kHz, passband frequency of 2 kHz, stopband frequency of 2.5 kHz, passband attenuation of 0.15 dB and stopband attenuation of 60dB.

  1. Which window(s) can be used to design this filter?
  2. Calculate the order of the filter
  3. Calculate the normalized cutoff frequency of this filter, f_c
  4. What is the impulse response of the filter?
  5.  Using the Matlab routine fir1 calculate the impulse response and plot the frequency response of your filter
h=fir1(M, 2*f_c,window(M+1));
Where window is: boxcar, hann, hamming, or Blackman
For example, for a Hamming window of length 25 with cutoff freq of .3:
h=fir1(25, 2*.3,hamming(25+1));
For frequency response:
H=freqz(h,[1]);
 

Build a linear phase, bandstop FIR filter using a fixed window (rectangular, Hanning, Hamming, or Blackman). The design constraints are: sampling rate of 20 kHz, stopband of 3-4 kHz, transition bandwidth of 1 kHz, passband attenuation of 0.1 dB and stopband attenuation of 50dB.

  1. On the figure handed out in class, fill in the values for each of the constraints for the passband and stopband ripple, and pass and stopband edges.
  2. Which window(s) can be used to design this filter?
  3. Calculate the order of the filter
  4. Calculate the normalized cutoff frequencies of this filter, f_c
  5.  Using Matlab routine fir1 calculate the impulse response and plot the frequency response of your filter

h=fir1(M, 2*[f_c1,f_c2],`stop`,window(M+1));

Posted: 04/16/2003