function [y]=recnotch(x,f0,fs,eta);
alpha=cos(2*pi*f0/fs);
b(1)=eta/(2*eta-1);
b(2)=-2*alpha*b(1);
b(3)=b(1);
a(1)=1;
a(2)=b(2);
a(3)=1/(2*eta-1);
b
a
fvtool(b,a);

y1=filter(b,a,x);
yr(length(x):-1:1)=y1(1:1:length(x));
y1=filter(b,a,yr);
y(length(x):-1:1)=y1(1:1:length(x));

%check filter
nfft=100;
noverlap=nfft/2;
[Pxx,f] = pwelch(x,rectwin(nfft),noverlap,nfft,fs,'onesided');
[Pyy,f] = pwelch(y,rectwin(nfft),noverlap,nfft,fs,'onesided');
figure
semilogy(f,Pxx,f,Pyy)
plot(f,Pxx,f,Pyy)
