I try to implement an Lowpass filter using a Hammond Window. The cut-off frequency it's 0.3 and the order of the filter it's 21. My problem is that I have a straight line and it's not crossing through the represented points. Here it's the code:
from pylab import *
import scipy.signal as signal
import matplotlib.pyplot as plt
#Plot step and impulse response
def impz(b,a=1):
l = len(b)
impulse = repeat(0.,l); impulse[0] =1.
x = arange(0,l)
response = signal.lfilter(b,a,impulse)
subplot(211)
stem(x, response)
ylabel('Amplitude')
xlabel(r'Index')
title(r'Impulse response')
n = 21
a = signal.firwin(n, cutoff = 0.3, window = "hamming")
#Impulse and step response
figure(2)
impz(a)
show()
I've attached you how should the pyplot look like:
Why it's the red line in the last picture not crossing through the points of the plot? Any ideas why? Thanks!