I'm using Fixed-Point 32bit processor to process the audio file and I want to make Low-Pass Filter.
I've used MATLAB to simulate and get the filter coefficients and the filter works on MATLAB but doesn't work on my program.
here's the filter equation I'm using (From MATLAB M-File)
CODE
x =wavread(in_file);
[B,A] = butter(5,0.25,'low');
N= length(x);
y(1) = B(1)*x(1);
y(2) = B(1)*x(2) + B(2)*x(1) - A(2)*y(1);
y(3) = B(1)*x(3) + B(2)*x(2) + B(3)*x(1) - A(2)*y(2) - A(3)*y(1);
y(4) = B(1)*x(4) + B(2)*x(3) + B(3)*x(2) + B(4)*x(1) - A(2)*y(3) - A(3)*y(2) - A(4)*y(1);
y(5) = B(1)*x(5) + B(2)*x(4) + B(3)*x(3) + B(4)*x(2) + B(5)*x(1) - A(2)*y(4) - A(3)*y(3) - A(4)*y(2) - A(5)*y(1);
for n=6 : N
y(n) = B(1)*x(n) + B(2)*x(n-1) + B(3)*x(n-2) + B(4)*x(n-3) + B(5)*x(n-4) + B(6)*x(n-5) - A(2)*y(n-1) - A(3)*y(n-2)- A(4)*y(n-3) - A(5)*y(n-4) - A(6)*y(n-5);
end
the output's sound quality is bad like it's has noise I think it's because the output is overflow.
I've try to scale down the coefficients but it's still the same.