add makenotch script
git-svn-id: https://bucket.mit.edu/svn/nilm/zoom@7711 ddd99763-3ecb-0310-9145-efcb8ce7c51f
This commit is contained in:
parent
ab571fbd72
commit
a1d4b342a4
14
pc/data/20090722/makenotch.m
Normal file
14
pc/data/20090722/makenotch.m
Normal file
|
@ -0,0 +1,14 @@
|
|||
function [b,a] = makenotch(Fs, W0, BandWidth)
|
||||
|
||||
Fn = Fs/2; % Nyquist freq [Hz]
|
||||
w0 = W0*pi/Fn; % notch frequency normalized
|
||||
B = BandWidth*pi/Fn; % normalized bandwidth
|
||||
k1 = -cos(w0); k2 = (1 - tan(B/2))/(1 + tan(B/2));
|
||||
b = [1+k2 2*k1*(1+k2) 1+k2];
|
||||
a = [2 2*k1*(1+k2) 2*k2];
|
||||
|
||||
#figure(1); % look at the frequency response of your filter
|
||||
#freqz(b,a);
|
||||
|
||||
|
||||
# now filter(b,a,input)
|
Loading…
Reference in New Issue
Block a user