MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   MATLAB论坛 (https://www.labfans.com/bbs/forumdisplay.php?f=6)
-   -   [MATLAB混合编程] 有关滤波器的程序问题 求教 (https://www.labfans.com/bbs/showthread.php?t=14618)

jrj520 2012-04-09 09:43

有关滤波器的程序问题 求教
 
基于MATLAB利用巴特沃斯模拟滤波器,设计一数字带通滤波器,要求带通上下截止频率为0.4π,0.3π,带通内衰减不大于3dB,阻带上下起始频率为0.5π,0.2π,阻带内衰减不小于18dB。
程序如下
clear all;
Wp=[0.3*pi,0.4*pi];
Ws=[0.2*pi,0.5*pi];
Ap=3;
As=18;
[N,wn]=buttord(Wp/pi,Ws/pi,Ap,As); %计算巴特沃斯滤波器阶次和截至频率
[b,a]=butter(N,wn,'bandpass'); %频率变换法设计巴特沃斯带通滤波器
[b0,B,A]=dir2cas(b,a) %数字带通滤波器级联型
[db,mag,pha,grd,w]=freqz_m(b,a); %数字滤波器响应
subplot(211);
plot(w/pi,mag);
title('带通数字滤波器幅频响|H(ejOmega)|')
subplot(212);
plot(w/pi,db);
title('带通数字滤波器幅频响(db)')




但是在运行不出结果 提示为 ??? Undefined function or method 'dir2cas' for input arguments of type 'double'.
请教高手求帮忙 谢 能尽量详细点 我是新手


所有时间均为北京时间。现在的时间是 06:17

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.