function y=myBiquad(A,B,x)
% x and y are 2 channel stereo signals with N samples per channel,
% thus 2 (Nx2)-matrices of reals.
% A, B are real (3,1)-matrices, which contain the filter coefficients
% given to the function myBiquad. x is the (N,2)-matrix,
% which contains the sample values of both stereo channels.
% The transfer function is H(z)=(A(1)+A(2)/z+A(3)/z^2)/(1+B(2)/z+B(3)/z^2)
N=size(x,1);
% Defines the output matrix y and preallocates zeros in it
y=zeros(N,2); % a signal with 2 channels of length N is assumed
for c=1:2; % c gives channel 1 and 2
for p=3:N; % of the following filtering of x with a notch biquad
s1=A(1)*x(p,c)+A(2)*x(p-1,c)+A(3)*x(p-2,c); % s1, s2 are reals
s2=-B(2)*y(p-1,c)-B(3)*y(p-2,c);
y(p,c)=s1+s2;
% y(p,c) is the filtered output sample p in channel c
end;
end;