I design a filter in Matlab using these command:
Fs = 2.5*10^10;
n = 2;
Wn = 5000/Fs;
[b,a] = butter(n,Wn);
and get
b={9.86988268891764e-14, 1.97397653778353e-13, 9.86988268891764e-14}
a={1, -1.99999911142341, 0.999999111423807}
How do I make the analog one?
Best Answer
First, you probably designed your digital filter incorrectly. You used
Wn = 5000/Fs
, but the digital Wn parameter wants a number from 0 to 1, where 1 is Fs/2, so you'd normally say, for a 5000 Hz filter, thatWn = 5000/(Fs/2)
.Assuming this is what you meant, you want to design a 2nd-order analog Butterworth lowpass filter with a cutoff frequency of 5000 Hz.
First, use
[b,a] = butter(n,Wn,'s')
to get the output in the analog s domain instead of the digital z domain.If you want the cutoff frequency to be 5 kHz (= 2π⋅5000 radians/s), use
butter(2,2*pi*5000,'s')
, for instance. In GNU Octave I get:So the transfer function would then be
\$H(s) = {9.8696 \times 10^8 \over {s^2 + 4.4429 \times 10^4 s + 9.8696 \times 10^8}}\$
Butterworth filters always consist of N poles arranged in a semicircle around the left side of the unit circle (and you could actually design it directly this way). This has 2 poles at -22214.4 ± 22214.4j. To make a practical filter, you group the complex conjugate pairs into 2nd-order sections and build a biquad filter for each. In your case, it's already a single 2nd-order section, so you only need one filter.
Then you map that to a circuit, like one of these: http://en.wikipedia.org/wiki/Butterworth_filter#Filter_design
Capacitor reactance is \$1 \over Cs\$ and inductors are \$Ls\$, so the transfer function is
\$H(s) = {Vout(s) \over Vin(s)} = {{1 \over {C1 s}} \| R2 \over {L1 s + R1 + {1 \over {C1 s}} \| R2}} = \frac{R2}{C L1 R2 s^2 + (C R1 R2 + L1) s + (R2 + R1)}\$
So
So then R1 = 0 and L1 = 44.4 kH?? and C = 22.8 fF?? ...Oh man, I don't remember this stuff.
Actually... although these values are completely insane, they do work in a simulation.
So you could then scale all the values simultaneously to more reasonable ones. Multiply the capacitor by some value, and divide the inductor and resistor by the same value to keep the filter the same. For instance, multiplying by 1 million gets us into a more reasonable range:
Hey, it works!
Practically, though? Just use filter design software like everyone else.