I am attempting to implement a basic bandpass filter but the center frequency of my filter seems to be irrelevant as I can change it all I want but it has no effect on the filter. where am I going wrong?
I have given my calculations here in the hope that someone will be able to point out where I'm making a mistake.
Filter specs:
supression of DC and Fs/2 (zeroes at +1 and -1)
center frequency at pi/4
bandwith of pi/16
2(1-R)=pi/2
1-R=pi/32
R=(pi/32)-1
R=-0.9018252296
K*(z-1)*(z+1)
---------------
z-R*cos(pi/4)+R
K*(z^2 -1)
-------------------
z^2-R^2*cos(pi/4)+R
all leading to a difference equation of
Y[n]=R^2*cos(pi/4)*Y[n-1]-R*Y[n-2]+K*(X[n]-X[n-2])