开发者

Matlab symbolic tooltip; trying to design a 3rd order sallen key filter

开发者 https://www.devze.com 2023-03-29 08:11 出处:网络
Trying to design a 3rd order sallen key filter using matlab: [B,A]=cheby1(3,1,10*10^6*2*pi,\'s\'); %3rd order sallen key

Trying to design a 3rd order sallen key filter using matlab:

[B,A]=cheby1(3,1,10*10^6*2*pi,'s');

%3rd order sallen key
syms R1 R2 R3 R4 R5 C1 C2 C3
M=1+R4/R5;
num=[M/(R1*R2*R3*C1*C2*C3)];
den=[1 (1/(R1*C1)+1/(R2*C1)+1/(R2*C2)+(1-M)/(R3*C3)+1/(R3*C2)) ((C3*R3+R1*C3+R2*C3+C1*R1+(1-M)*(R1+R2)*C2)/(R1*R2*R3*C1*C2*C3)) (1/(R1*R2*R3*C1*C2*C3))];

solve('B=num','A=den','M=5','R1','R2','R3','R4','R5')

It tells me:

Warning: 3 equations in 5 variables. New variables might be introduced.  
Warning: Explicit solution could not be found. 

cheby1 gives you a transfer function (numerator and denominator) for a chebyshev type 1 filter; I'm then trying to equate it to the form of the transfer function of a 3rd order sallen key filter; and get matlab to solve for the resistor values in terms of the capacitor values.

==> How can I get the solution I want?

To note: this has nothing to do w开发者_如何转开发ith the actual calculation being performed, and all to do with how to use matlab.


maybe I'm missing something, but B is 1x4 vectors, while num is a scalar, so there is no way you're going to get an answer. Also, (edit) you can't solve indirect equations from the command window (i.e. solve('M=5','R1','R2') won't work, but solve('1 + R1/R2=5','R1','R2') will)

Even if you corrected those I suspect that this will be too complicated for the symbolic toolbox (the solution is likely a really high-order polynomial which can't be solved explicitly)

You're best bet is to use fsolve to find a numerical solution

0

精彩评论

暂无评论...
验证码 换一张
取 消