# template file for Lab #6, Task #4 import numpy import matplotlib.pyplot as p import lab6 from lab6_1 import freq_res_usr from lab6_3 import low_pass,high_pass # return appropriately scaled unit-sample response # for a band-pass filter with specified cutoff frequencies def bandpass(lo,hi): pass # your code here # return appropriately scaled unit-sample response # for a notch filter with specified cutoff frequencies def notch(lo,hi): pass # your code here if __name__ == '__main__': omega_lo = 0.4 * numpy.pi omega_hi = 0.6 * numpy.pi # A band-pass filter usr_band = bandpass(omega_lo,omega_hi) # Plot the response of the result omega_band, mag_hejw_band = freq_res_usr(usr_band) lab6.plot_freq_response(omega_band,mag_hejw_band, 'band-pass filter @ $\Omega=(%3.2g,%3.2g)$' % (omega_lo,omega_hi)) # A notch filter usr_notch = notch(omega_lo,omega_hi) # Plot the response of the result omega_notch, mag_hejw_notch = freq_res_usr(usr_notch) lab6.plot_freq_response(omega_notch,mag_hejw_notch, 'notch filter @ $\Omega=(%3.2g,%3.2g)$' % (omega_lo,omega_hi)) p.show()