function that finds the cutoff frequency for low pass filter (in matlab)

user1564762 picture user1564762 · Aug 24, 2012 · Viewed 21.9k times · Source

I want to find the cutoff frequency for a lot of low pass filters. Therefor I want a function that can do that for me. I can make a Bode plot and find the frequency for -3dB, but that is boring and time-consuming. Does someone know how I can automatic this procedure? I was trying with

[mag,phase] = bode(sys) 

but failed. How should I go about this?

I have filter coefficients a,b available. I try to use some different technique when I discretize the transform function, therefore I want the cutoff frequency empirically from EKV:

y_k = b(1)*x_k + b(2)*x_{k-1} – a(2)*y_{k-1}

Answer

Kavka picture Kavka · Aug 24, 2012

You can use the bandwidth command on LTI objects (transfer functions, etc.):

G = tf(1, [1 1])
bandwidth(G)

ans =

    0.9976