4Author: J.A. de Jong - ASCEE
6Description: Decimation filter design.
9import matplotlib.pyplot
as plt
10from fir_design
import freqResponse, lowpass_fir_design
20fir = lowpass_fir_design(L, fs, fc)
23ax = fig.add_subplot(111)
25freq = np.logspace(1, np.log10(fs/2), 1000)
27H = freqResponse(fs, freq, fir)
28dBH = 20*np.log10(np.abs(H))
30ax.axvline(fs/2, color=
'green')
31ax.axvline(fd/2, color=
'red')
34fn_index = np.where(freq <= fd/2)[0][-1]
36dBHmax_above_Nyq = np.max(dBH[fn_index:])
38print(f
"Reduction above Nyquist: {dBHmax_above_Nyq} dB")