Chinaunix首页 | 论坛 | 博客
  • 博客访问: 71028
  • 博文数量: 25
  • 博客积分: 880
  • 博客等级: 准尉
  • 技术积分: 245
  • 用 户 组: 普通用户
  • 注册时间: 2008-07-05 10:27
文章分类

全部博文(25)

文章存档

2011年(1)

2009年(2)

2008年(22)

我的朋友

分类:

2008-07-05 10:59:45

Butterworth Lowpass Filter(analog) Design In SCILAB

By JingFeng ZhaoEE

 

Short Introduction for SCILAB

SCILAB is the famous open source software for scientific computing co-developed by scientists of INRIA and ENPC. Since 1997, SCILAB has been extensively received by scientists, engineers and technicians, and practitioners in both academia and industry. It has been recognized as the best substitute for commercial software like Matlab, Xmath and Matrix, and is being distributed currently at the speed of 10,000 copies per month in all over the world.

SCILAB has brought us not only powerful functions in scientific computing, but also its free spirit of open source. At present, many scientists in INRIA are devoted to promoting the open source software to the world, particularly in China. The free spirit of open source software and technology makes far-reaching sense to China's software industry in terms of liberalization from the international Commercial software companies. Therefore, research institutes and governmental sessions concerned in China and France have co-developed and been supporting SCILAB activities in China. From this point of view, SCILAB promotion in China has set up a broad bridge between the researchers in China and in France, and it provides the opportunities for Chinese researchers, engineers and students to study and to express their talent by means of competition and communication with industrial partners both in Chinese and French side.

 

Why I Choose SCILAB:

In my opinion, SCILAB have three priorities: open source, much smaller than MATLAB, and also much faster than MATLAB. Open source is the main stream flow of software develop, it will attracts many people to attend software development. Take SCILAB as example, we can change some functions or develop the toolbox we needed in special situations, that means DIY SCILAB by ourselves. SCILAB is very small, the newest version only takes 100MB disk space, so SCILAB is also very fast, SCILAB is small, but it can also completes all the design which can be done by MATLAB, MATLAB is costful, SCILAB is free.

 

Codes For This Design:

Clear

//disp()的作用为:显示特定内容,因此这一行代码的作用便是显示:

//R1,R2 in ohm, C in nF, L in mH

disp("R1,R2 in ohm, C in nF, L in mH");

//input()用于输入一个变量,input函数括号里面的内容为在界面上显示的内容,

//input函数返回一个量即为我们输入的变量值。

Fp = input("Fp = "); Fs = input("Fs = "); Amax = input("Amax = ");

Amin = input("Amin = "); fs = input("fs = "); R1 = input("R1 = ");

R2 = input("R2 = ");

//求出滤波器所需的阶数

n = log10((10^(0.1*Amin)-1)/(10^(0.1*Amax)-1))/(2*log10(Fs/Fp));

N = round(n);

//求解e

e = sqrt(10^(0.1*Amax)-1);

//disp(N);disp(e);

Pi = %pi;

//反规一化所需之参数

Km = R1;  Kf = 2*Pi*fs;

//逐个显示计算结果

disp(R1,"R1 = ");

for k = 1:1:N

  r = 2*(e^(1/N))*sin((2*k-1)*Pi/2/N);

  if modulo(k,2)

    r = 1000*r*Km/Kf;

    //使用这个函数的目的在于使得输出结果可以这样显示:L1=?C2=?

K = code2str(k);

    disp(r,'L'+K+'=');

  else

    r = (10^9)*r/Km/Kf;

    K = code2str(k);

    disp(r,'C'+K+'=');

  end

end

disp(R2,"R2 = ")

阅读(875) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~