I'm trying to design a Sallen-Key BPF within Matlab. With the documentation found on ti: http://www.ti.com/lit/ml/sloa088/sloa088.pdf, I studied and understood the basic. enter image description here

As for the design: The center frequency of my BPF is 40kHz. Q-factor and gain at center frequency must be 1. So in matlab I've made:

Fm = 40000;
R1 = 10000
R2 = 10000
C = 10*10^-9

R = 1/(2*pi*Fm*C);

G = 1+(R2/R1);
Q = 1/(3-G);
Am = G/(3-G);

w = 2*pi*Fm;

B=[G*R*C*w 0 ]
A=[(R^2)*(C^2)*(w^2) R*C*w*(3-G) 1]


The issue is that my resulting bodeplot is indeed showing a BPF behaviour, but not at the desired frequency. Furthermore.

Can someone explain this to me? Thanks in advance

  • \$\begingroup\$ Where is "s" in your formulas? \$\endgroup\$
    – Andy aka
    Commented Feb 3, 2016 at 10:57
  • \$\begingroup\$ It is on vacation and now the everything turned real ;-) \$\endgroup\$ Commented Feb 3, 2016 at 11:02
  • \$\begingroup\$ If you don't mind my asking, what is your ultimate goal? Are you doing a Matlab homework assignment, trying to learn filter design, or trying to get a filter implemented? If you are a practicing engineer trying to get a filter designed and implemented, you need a different type of answer. \$\endgroup\$ Commented Feb 3, 2016 at 22:34

1 Answer 1


Your formulas do not take into account that the impedance of a capacitor is complex !

What you use is:

$$Zc(f) = 1 / 2 \pi f$$

but what you should use is:

$$Zc(s) = 1 / s$$

where $$s = 2 \pi f j $$ where j makes it imaginary remember: $$j^2 = -1$$

Have a look at this page on Wikipedia where they show how to determine the transfer function in the s domain.

  • 3
    \$\begingroup\$ s = 2 pi j F - you left the f off (sorry I didn't mean "f off" LOL) \$\endgroup\$
    – Andy aka
    Commented Feb 3, 2016 at 11:02
  • \$\begingroup\$ If you use the tf command in matlab, you can see that it places the "s" accordningly. \$\endgroup\$ Commented Feb 3, 2016 at 12:34
  • \$\begingroup\$ But only if you tell it to because it does not do so by default, in your script it assumes the transfer function has no imaginary numbers. tf can also calculate in z domain, but you have to tell it to do so. Have a look at the examples in nl.mathworks.com/help/control/ref/tf.html \$\endgroup\$ Commented Feb 3, 2016 at 12:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.