a) The 2nd order BP transfer function is described by two parameters, namely a and b. Explain what features of the digital filter frequency response are controlled by each of these parameters. b) Suppose it is required to place the center frequency at 0 0.3 and to create a 3 dB. bandwidth that is BW 0.15 . Compute the coefficients for the numerator and denominator polynomials of HBP (z) that will achieve these design criteria. c) An ideal BP digital filter should have a magnitude response that is zero at = 0 and at = and a magnitude response equal to unity at the center frequency. Verify that your design in part 2 meets these criteria. d) After the values of a and b have been computed to meet the simple BP digital filter specifications and H(z) has been determined, use Matlab functions to compute and plot the frequency response to demonstrate that all specifications have been met. Then adjust the values of a and b to make the bandwidth half the size as specified originally, but keep the center frequency of the passband in the same location. Plot these new results and compare them with the original specifications. Discuss results. Problem 2 a) A DC blocker filter (i.e. a filter that removes DC offsets from a signal) is nothing more than a high-pass filter with a 3 dB frequency very close to DC. Use a sampling frequency of 8000 Hz to design a 1st-order digital DC blocker filter with a 3 dB frequency of 40 Hz and a high- frequency gain of 1. b) In MATLAB, use freqz to calculate the frequency response (magnitude and phase) of the filter designed above. Plot frequency response vs. continuous-time frequency F and obtain hard copies. Also, use the MATLAB command zplaneto obtain a pole/zero plot. You may want to use subplot to put all of the figures on 1 page.

c) Test your filter in MATLAB by generating the following test signal (sampled at 8000 Hz) and passing it through the DC blocker filter using MATLAB’s filter command: x(t) = 6 + 5 cos(2 p × 20 t) + 3 cos(2 p × 500 t) for a time range of 0 to 0.1 second.

Obtain hard copies of both the input and output signals (plotted vs. t). Is the output of the filter as expected, based on the parameters of the filter?

Problem 3.

a) Using a sampling frequency of 8000 Hz, determine the transfer function H(z) for a digital notch filter to remove 400 Hz sinusoidal noise, for each of the following values for a (related to pole magnitude). Scale each filter so that the DC gain = 1:

i) a = 0.866 ii) a= 0.975 iii) a = 0.995

For each case above, calculate the 3 dB notch bandwidth.

b) Test these three filter designs in MATLAB by performing the following tasks. Put all commands in a single m-file and turn the m-file in with your homework.

i) Use freqz to calculate the frequency response (magnitude and phase) of the three filter designs above. Plot frequency response vs. continuous-time frequency F and obtain hard copies for all 3 filters. You may want to use subplot to put all of the figures on 1 page. Also, use the MATLAB command z-plane to obtain a pole/zero plot for all three filters.

ii) Generate the discrete-time test input x[n] by sampling the following CT signal

xc(t)=2cos(2 π ⋅100⋅t)+cos(2 π ⋅400⋅t)

for a time range of 0 to 0.1 seconds and a sampling frequency of 8000 Hz. Plot this test signal and obtain a hard copy. It may look better if you use the plot command rather than the stem command.

iii) Filter the test input using the filter command in MATLAB for all three filter designs. Obtain a hard copy of the filtered output signal for each of the filter designs (use the subplot command).

iv) Generate the ideal filtered signal, yideal [n] =2cos(2 π ⋅100⋅t) sampled at 8000 Hz, and use it to calculate the error signal e[n] = y filtered [n] – yideal [n] for each of the filter designs. Plot all three error signals using the subplot command and obtain a hard copy. The error signal should have a transient part, but should eventually settle to a periodic error.

v) Compare the ideal output to the actual filtered output for all three filter designs. Using the graphs in part (iii-iv) answer the following questions. 1) How quickly does the error settle to a “steady state” for each filter? 2) What is the magnitude of the “steady state” error for each filter? 3) Can you make any generalizations based on your observations above?

Hint: It may help to zoom in on your plots to do the measurements.