Program to design a FIR filter using windows.
close all;
clear all;
fp=input('Enter the pass band frequency');
fs=input('Enter the stop band frequency');
rp=input(' Enter the pass band attenuation');
rs=input('Enter the stop band attenuation');
f=input(' Enter the sampling frequency');
%Calculating filter order
num=-20*log10(sqrt(rp*rs))-13;
dem=14.6*(fs-fp)/f;
n=ceil(num/dem);
n=abs(n);
% Normalizing the frequencies
wp=2*fp/f;
ws=2*fs/f;
wn=(ws+wp)/2;
%Adjusting the filter order. The order of window must be an odd number
%and the order of filter must be one less than that of the window
if (rem(n,2)==0)
m=n+1;
else
m=n;
n=n-1;
end
%Window sequence calculation
w=hann(m);
%Calculation of filter coefficients
b=fir1(n,wn,'low',w);
%Plotting the filter response
freqz(b,1,500,3000);
TITLE('Magnitude and Phase response');
FIR-filter.rar_fir
版权申诉
117 浏览量
2022-07-15
10:26:00
上传
评论
收藏 569B RAR 举报
局外狗
- 粉丝: 68
- 资源: 1万+
最新资源
- cmak-3.0.0.6.zip
- Map2ShpPro-Demo.zip
- vue3 的 main.ts 文件,包含了 elementui-plus 注册,icon 全局注册等常用注册
- Typecho博客主题Joe素颜执念修改版
- SP8K32-TB-VB一款2个N-Channel沟道SOP8的MOSFET晶体管参数介绍与应用说明
- Alibaba 阿里P9百亿级高并发系统设计手册最新全彩PDF版本
- Socket通讯验证工具 可验证本机端口是否被占用 验证服务端端口是否开通或可访问 查看服务端与客户端的socket发送信息
- SP8K31-TB-VB一款2个N-Channel沟道SOP8的MOSFET晶体管参数介绍与应用说明
- 安卓AndroidStudio基于百度云平台人脸识别学生考勤签到系统
- 红外温度传感器的原理及应用
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈