



全文预览已结束
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
用 ideallp 函数设计 FIR 线性相位滤波器% G038% 用 ideallp 函数设计 FIR 线性相位滤波器%h_fig1 = figure; % 创建第1个图形窗口set(h_fig1, unit, normalized, position, 0.0, 0.0, 0.99, 0.94);set(h_fig1, defaultuicontrolunits, normalized);set(gcf, color, w)h_text1 = uicontrol(gcf, Style, text, Position, 0.2, 0.9, 0.7, 0.07,. % 在第 1 个图形窗中创建文本框 String, FIR 线性相位滤波器 , FontName, 黑体, ForegroundColor, r, . FontSize, 38, FontWeight, Bold, BackgroundColor, 1, 1, 1); set(gcf, color, w)h_text2 = uicontrol(gcf,style,text, BackgroundColor, w, Position, 0.01, 0.58, 0.2, 0.1,. % 在第 1 个图形窗中创建文本框 string, 滤波器类型, ForegroundColor, r, FontWeight, Bold, FontSize, 20) h_pushbutton1 = uicontrol(h_fig1, Style, PushButton, Position, 0.07, 0.2, 0.08, 0.07,. % 创建命令钮 h_pushbutton2,定义其属性 string, 退出, BackgroundColor, 0.8 0.9 0.8, ForegroundColor, r, FontSize, 14, FontWeight, Bold,. callback, delete(h_fig1)hr_1 = uicontrol(gcf,style,radio, BackgroundColor, w,.% 创建第 1 个 radio 钮 string,低通, ForegroundColor, r, FontWeight, Bold, FontSize, 10,. position,0.04,0.53,0.08,0.05); set(hr_1,value,get(hr_1,Max);set(hr_1, callback, . % 定义第 1 个 radio 钮的回调函数 set(hr_1,value,get(hr_1,max), set(hr_2,value,get(hr_2,min),. set(hr_3,value,get(hr_3,min), set(hr_4,value,get(hr_4,min),. cb05(h_axes1, h_axes2, h_axes3, h_axes4, 1);hr_2 = uicontrol(gcf,style,radio, BackgroundColor, w,.% 创建第 2 个 radio 钮 string,高通, ForegroundColor, r, FontWeight, Bold, FontSize, 10,. position,0.12,0.53,0.08,0.05); set(hr_2,value,get(hr_2,Min); set(hr_2, callback, . % 定义第 2 个 radio 钮的回调函数 set(hr_2,value,get(hr_2,max), set(hr_1,value,get(hr_1,min),. set(hr_3,value,get(hr_3,min), set(hr_4,value,get(hr_4,min),. cb05(h_axes1, h_axes2, h_axes3, h_axes4, 2);hr_3 = uicontrol(gcf,style,radio, BackgroundColor, w,.% 创建第 3 个 radio 钮 string,带通, ForegroundColor, r, FontWeight, Bold, FontSize, 10,. position,0.04,0.45,0.17,0.05); set(hr_3,value,get(hr_3,Min); set(hr_3, callback, . % 定义第 3 个 radio 钮的回调函数 set(hr_3,value,get(hr_3,max), set(hr_1,value,get(hr_1,min),. set(hr_2,value,get(hr_2,min), set(hr_4,value,get(hr_4,min),. cb05(h_axes1, h_axes2, h_axes3, h_axes4, 3);hr_4 = uicontrol(gcf,style,radio, BackgroundColor, w,.% 创建第 4 个 radio 钮 string,带阻, ForegroundColor, r, FontWeight, Bold, FontSize, 10,. position,0.12,0.45,0.08,0.05); set(hr_4,value,get(hr_4,Min); set(hr_4, callback, . % 定义第 4 个 radio 钮的回调函数 set(hr_4,value,get(hr_4,max), set(hr_1,value,get(hr_1,min),. set(hr_2,value,get(hr_2,min), set(hr_3,value,get(hr_3,min),. cb05(h_axes1, h_axes2, h_axes3, h_axes4, 4);h_axes1 = axes(Box, on, Position, 0.27, 0.525, 0.3, 0.3) % 在第 2 个图形窗中创建轴对象h_axes2 = axes(Box, on, Position, 0.65, 0.525, 0.3, 0.3) % 在第 2 个图形窗中创建轴对象h_axes3 = axes(Box, on, Position, 0.27, 0.095, 0.3, 0.3) % 在第 2 个图形窗中创建轴对象h_axes4 = axes(Box, on, Position, 0.65, 0.095, 0.3, 0.3) % 在第 2 个图形窗中创建轴对象% -cb05(h_axes1, h_axes2, h_axes3, h_axes4, 1);function cb05(a1, a2, a3, a4, k)% 计算 Kaiser 窗M = 45; As = 60; n = 0:1:M-1;beta = 0.1102*(As-8.7)+1w_kai = (kaiser(M,beta);% 给定滤波器的参数wc1 = pi/3; wc2 = 2*pi/3;% 根据参数 k,计算滤波器的理想冲激响应if k=1 % 低通 hd = ideallp(wc1,M) end if k=2 % 高通 hd = ideallp(pi,M) - ideallp(wc1,M) end if k=3 % 带通 hd = ideallp(wc2,M)-ideallp(wc1,M);end if k=4 % 带阻 hd = ideallp(wc1,M) + ideallp(pi,M) - ideallp(wc2,M);end% -% 设计低通滤波器h = hd .* w_kai;db,mag,pha,grd,w = myfreqz(h,1);% 画出低通滤波器的特性subplot(a1); stem(n,hd,.); grid; title((1)理想冲激响应, FontWeight, Bold)xlabel(n, FontSize, 12, FontWeight, Bold); ylabel(hd(n), FontSize, 12, FontWeight, Bold); axis(-1 M -0.5 0.8); set(a1, LineWidth, 2);subplot(a2); stem(n,w_kai,.); grid; title((2)凯泽窗, FontWeight, Bold)xlabel(n, FontSize, 12, FontWeight, Bold); ylabel(w(n), FontSize, 12, FontWeight, Bold); axis(-1 M 0 1.1); set(a2, LineWidth, 2);subplot(a3); stem(n,h,.); grid; title((3)实际冲激响应, FontWeight, Bold)xlabel(n, FontSize, 12, FontWeight, Bold); ylabel(h(n), FontSize, 12, FontWeight, Bold)axis(-1 M -0.5 0.8); set(a3, LineWidth, 2);subplot(a4); plot(w/pi,db);xlabel(频率(单位: pi ), FontSize, 12, FontWeight, Bold); ylabel(分贝数, FontSize, 12, FontWeight, Bold)title((4)滤波器模频特性, FontSize, 12, FontWeight, Bold); grid;axis(0 1 -110 10); set(a4, LineWidth, 2);set(gca,XTickMode,manual,XTick,0;0.333;0.667;1)set(gca,XTickLabelMode,manual, XTickLabels, 0 ;1/3;2/3; 1 )set(gca,YTickMode,manual,YTick,-60,0)set(gca,YTickLabelMode,manual,YTickLabels,60; 0)function y1=cb06(a1, a2, x, k)Nx=length(x); nx=0:Nx-1;nx1=-Nx:2*Nx-1; x1=x(mod(nx1,Nx)+1);y1,ny1=sigshift(x1,nx1,k); % 2 是移位点数RN=(nx1=0) & (nx1=0) & (ny1Nx);subplot(a1), stem(-6,-5,ny1,3,2,y1,.); xlabel(n, fontsize, 12); ylab
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 铣工试题库及答案
- 2025年航空公司机务人员岗位飞机维修知识考试试题及答案解析
- 工勤考试技师考试题库及答案2025
- 高校科研合同模板(3篇)
- 高速公路护栏板施工合同(3篇)
- 高炮广告拆除施工合同(3篇)
- 安徽招聘考试试题及答案
- 安徽农商银行笔试题目及答案
- 安定协管员招聘面试题及答案
- 股东间公司治理信息保密及责任分配协议
- 幕墙玻璃更换施工安全技术方案
- 2025年国内知名企业数据分析师岗位招聘面试题及答案
- 2025年地方病防治科地方病防控策略考核试卷答案及解析
- 型钢混凝土剪力墙剪力刚度精细评估与设计优化
- 《百分数与分数的互化》课件 2025-2026学年小学数学六年级上册 苏教版
- 2025中国人民抗日战争纪念馆招聘4人考试参考试题及答案解析
- 2025年山西省政府采购评审专家考试真题库(带答案)
- 2025年度太阳能光伏发电站基础地基旋挖钻孔灌注桩专业分包合同
- 北京暴雨洪涝灾害风险评估:基于多因素分析与案例研究
- 2025纪念中国人民抗日战争胜利80周年心得一
- 北师大版(2024)新教材三年级数学上册课件 3.1 捐书
评论
0/150
提交评论