# template file for Lab #6, Task #1 import numpy import matplotlib.pyplot as p import lab6 from lab2_3 import unit_sample_response def freq_res_usr(usr, num_freqs=401): # 0 <= omega <= pi omega_list = numpy.linspace(0,numpy.pi,num=num_freqs) # create and fill in a numpy array hejw containing # the complex frequency response at each omega in # omega_list pass # your code here... return omega_list,numpy.abs(hejw) def freq_res(channel, num_freqs=401): usr = unit_sample_response(channel) # Get channel's u.s.r. return freq_res_usr(usr,num_freqs) if __name__ == '__main__': # generate plots of freq_2_usr for both channels # using both of the methods omega_1, mag_hejw_chan1 = freq_res(lab6.channel1) lab6.plot_freq_response(omega_1, mag_hejw_chan1,'channel 1') omega_2, mag_hejw_chan2 = freq_res(lab6.channel2) lab6.plot_freq_response(omega_2, mag_hejw_chan2,'channel 2') p.show()