|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?我要加入
x
edit text 1 输入 阶数
function zeta_edit1_Callback(hObject, eventdata, handles)
M=str2num(get(handles.zeta_edit1,'string'));
handles.zeta_edit1=M;
edit text 2 输入 通带频率
function zeta_edit2_Callback(hObject, eventdata, handles)
wp=str2num(get(handles.zeta_edit2,'string'));
handles.zeta_edit2=wp;
edit text 3 是输入 截至频率
function zeta_edit3_Callback(hObject, eventdata, handles)
ws=str2num(get(handles.zeta_edit3,'string'));
M=handles.zeta_edit1;
wp=handles.zeta_edit2;
wc=(ws+wp)/2;
hd=ideal_lp(wc,M);
w_ham=hamming(M);
h=hd*w_ham;
[db,mag,pha,grd,w]=freqz_m(h,[1]);
delta_w=2*pi/1000;
Rp=-(min(db(1:1:wp/delta_w+1)));
RP=0.0394
As=-round(max(db(ws/delta_w+1:1:501)));
As=52
axes(handles.axes1);
stem(n,hd);
axes(handles.axes2);
stem(n,w_ham);
希望有高人指点。
MATLAB 提示错误是
Warning: Rounding order to nearest integer.
> In signal\private\check_order at 24
In signal\private\gencoswin at 18
In hamming at 17
In luhuacheng>zeta_edit3_Callback at 139
In gui_mainfcn at 75
In luhuacheng at 44
Warning: Integer operands are required for colon operator when used as index.
> In luhuacheng>zeta_edit3_Callback at 143
In gui_mainfcn at 75
In luhuacheng at 44
??? Index exceeds matrix dimensions.
Error in ==> luhuacheng>zeta_edit3_Callback at 143
Rp=-(min(db(1:1:wp/delta_w+1)));
Error in ==> gui_mainfcn at 75
feval(varargin{:});
Error in ==> luhuacheng at 44
gui_mainfcn(gui_State, varargin{:});
??? Error while evaluating uicontrol Callback.
[ 本帖最后由 eight 于 2007-6-18 10:01 编辑 ] |
|