Filter Coefficients for ButterWorth Low pass filter

10 views (last 30 days)
I am new to Digital Filter. I want to know filter Coefficients calculation formula manually for second order Butter Worth Low pass Filter.
And also i want to know sampling and cutoff frequency apply for the input signal. But i know fs > 2fmax for sampling is it correct or not.
Thanks in Advance,

Answers (1)

Jan
Jan on 29 Apr 2013
Edited: Jan on 29 Apr 2013
Do you really need the "filter coefficients calculations formula", or would is be satisfying already to call the function butter() to determine the coefficients?
The sampling frequency depends on your data, and therefore this cannot be answered by the forum, but by yourself only. The cut-off frequency depends on the wanted frequency spectrum, such that it is impossible for us to guess it. The cutoff frequency cannot be higher than the half frame rate - this is more or less obvious e.g. trying to filter a signal at 1kHz must fail, when it has been recorded at 1Hz only.
[EDITED] A boiled down 2nd order Butterworth filter algorithm:
function [B, A] = myButter2ndOrder(W)
V = tan(W * 1.5707963267948966);
Sg = V ^ 2;
Sp = V * [-1-1i, -1+1i] / sqrt(2);
% Bilinear transform:
P = (1 + Sp) ./ (1 - Sp);
G = real(Sg / prod(1 - Sp));
% From Zeros, Poles and Gain to numerator and denominator:
B = G * [1, 2, 1];
A = real(poly(P));
W is the cut-off frequency in the range 0 < W < 1, so it is relative to the half sample frequency.
  3 Comments
Jan
Jan on 29 Apr 2013
Please note, that the value of the signal does not allow to determine the filter coefficients. Neither sampling nor cut-off frequency can be determined based on the values of the signal. The sampling frequency must be provided separately and the cut-off frequency depends on your needs and it is impossible to guess them.
I cannot understand, why you want the formula to calculate the filter parameters, but the implementation in the function butter() does not satisfy you. This function contains an efficient and stable implementation, so what do you want instead?
Jan
Jan on 30 Apr 2013
Edited: Jan on 30 Apr 2013
@Crystal: Sorry, I'm not going to post more answers in this thread. It is a waste of my time if you offer the specifications of your question part by part only. If you want to know, what happens inside butter(), simply open this function in the editor and read it. Good luck.

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!