【滤波器设计】基于matlab GUI窗函数法高通+低通+带通带阻FIR滤波器设计【含Matlab源码 072期】
一、获取代码方式
获取代码方式1:
完整代码已上传我的资源:【滤波器设计】基于matlab GUI窗函数法高通+低通+带通带阻滤波器设计【含Matlab源码 072期】
获取代码方式2:
通过订阅紫极神光博客付费专栏,凭支付凭证,私信博主,可获得此代码。
备注:订阅紫极神光博客付费专栏,可免费获得1份代码(有效期为订阅日起,三天内有效);
二、数字滤波器设计简介(附滤波器参数设置说明书)
1 设计原理
1.1 滤波器概念
1.2 数字滤波器的系统函数和差分方程
1.3 数字滤波器结构的表示
1.4 数字滤波器的分类
2.1 IIR滤波器与FIR滤波器的分析比较
2.2 FIR滤波器的原理
3 FIR滤波器的仿真步骤
三、部分源代码
%DSP语音滤波
%常函数法设计低通、高通、带通、带阻滤波器
function varargout = DSP_fiters004(varargin)
% DSP_FITERS004 MATLAB code for DSP_fiters004.fig
% DSP_FITERS004, by itself, creates a new DSP_FITERS004 or raises the existing
% singleton*.
%
% H = DSP_FITERS004 returns the handle to a new DSP_FITERS004 or the handle to
% the existing singleton*.
%
% DSP_FITERS004('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in DSP_FITERS004.M with the given input arguments.
%
% DSP_FITERS004('Property','Value',...) creates a new DSP_FITERS004 or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before DSP_fiters004_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to DSP_fiters004_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES% Edit the above text to modify the response to help DSP_fiters004% Last Modified by GUIDE v2.5 26-May-2021 19:06:06% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...'gui_Singleton', gui_Singleton, ...'gui_OpeningFcn', @DSP_fiters004_OpeningFcn, ...'gui_OutputFcn', @DSP_fiters004_OutputFcn, ...'gui_LayoutFcn', [] , ...'gui_Callback', []);
if nargin && ischar(varargin{1})gui_State.gui_Callback = str2func(varargin{1});
endif nargout[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
elsegui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT% --- Executes just before DSP_fiters004 is made visible.
function DSP_fiters004_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to DSP_fiters004 (see VARARGIN)% Choose default command line output for DSP_fiters004
handles.output = hObject;% Update handles structure
guidata(hObject, handles);% UIWAIT makes DSP_fiters004 wait for user response (see UIRESUME)
% uiwait(handles.figure1);% --- Outputs from this function are returned to the command line.
function varargout = DSP_fiters004_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)% Get default command line output from handles structure
varargout{1} = handles.output;% --- Executes on button press in pushbutton7.
function pushbutton7_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton7 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
y = handles.y; %带噪语言
%%
% %FIR低通滤波器_等波纹法备选方案
% fp = str2double(get(handles.edit12,'String')); %通带截止频率
% fs = str2double(get(handles.edit13,'String')); %阻带截止频率
% At = 100; %带外衰减系数(dB)
% wave=1; %带内纹波系数(dB)
% mval=[1 0]; %边界处的幅值
% fedge=[fp fs];
% derta1=1-10^(-wave/20); %δ1的计算
% derta2=10^(-At/20); %δ2的计算
% dev=[derta1 derta2]; %基本参数δ1与δ2
% Fs=8000; %FIR采样频率
% %参数计算
% [N,fpts,mag2,wt]=remezord(fedge,mval,dev,Fs);
% %雷米兹交替算法设计最优FIR滤波器
% b=remez(N,fpts,mag2,wt);
% %FIR低通滤波器滤波
% sf1=filter(b,1,y);
% x=sf1; %信号
% plot(handles.axes5,x); %绘出随频率变化的振幅
% y1 = fft(x); %对信号进行快速Fourier变换
% mag2 = abs(y1); %求得Fourier变换后的振幅
%% 凯塞窗滤波
fs = 8000;
hn = handles.hn;
x1 = fftfilt(hn,y);
% filename = 'kaiser.wav';
% audiowrite(filename,x1,fs);
n = length(x1);
f = fs*(0:n/6-1)/n;
t = (0:n-1)/fs;
figure(9)
subplot(5,1,2);plot(t,y(:,1)); %加噪语音信号的时域波形图
xlabel('时间/s');ylabel('振幅/V');
title('加高斯白噪声后语音信号的时域波形'); grid on;
subplot(5,1,3);plot(t,x1(:,1));
xlabel('时间/s');ylabel('振幅/V');
hold on;title('加高斯白噪声的语音信号滤波后的时域波形');
hold off;grid on;
y_zz = fft(y); %带噪语音的频谱图
subplot(5,1,4);plot(f,abs(y_zz(1:n/6))); %加噪语音信号的频谱图
%axis([0, 8000, 0, 0.05])
xlabel('频率/Hz');ylabel('幅度/dBm');
title('加高斯白噪声后语音信号的频域波形'); grid on;
x11=fft(x1,n);
subplot(5,1,5);plot(f,abs(x11(1:n/6)));
xlabel('频率/Hz');ylabel('幅度/dBm');
hold on;title('加高斯白噪声的语音信号经凯塞滤波后的频域波形');
hold off;grid on;
% sound(x1,fs)
[H,f]=freqz(hn,1);
subplot(5,1,1);plot(f,20*log10(abs(H)/max(abs(H))));
xlabel('归一化频率');ylabel('振幅/dB');
hold on;title('频率响应');
hold off;grid on;
plot(handles.axes5,t,x1(:,1))mag2 = abs(x11); %滤波后的频谱
sf1 = x1; %滤波后的信号
handles.mag2 = mag2;
handles.sf1 = sf1;
guidata(hObject,handles)% --- Executes on button press in pushbutton8.
function pushbutton8_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton8 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
sf1 = handles.sf1;
fs = handles.edit11;
clear sound
sound(sf1,fs)% --- Executes on button press in pushbutton9.
function pushbutton9_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton9 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
mag2 = handles.mag2;
plot(handles.axes6,mag2(:,1)); %绘出随频率变化的振幅% --- Executes on button press in pushbutton5.
function pushbutton5_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton5 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
y = handles.y;
fs = handles.edit11;
clear sound
sound(y,fs)% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
x = handles.x;
fs = handles.edit11;
clear sound
sound(x,fs)% --- Executes on button press in OpenFile.
function OpenFile_Callback(hObject, eventdata, handles)
% hObject handle to OpenFile (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[file, path] = uigetfile({'*.wav';'*.mp3';'*.*'},...'File Selector');
if isequal(file, 0) % 如果file的返回值等于0disp('User selected Cancel');
elsedisp(['User selected ', fullfile(path, file)]); [x,fs] = audioread(fullfile(path, file));plot(handles.axes1,x(:,1))handles.x = x;handles.edit11 = fs;guidata(hObject,handles)
end
四、运行结果
五、matlab版本及参考文献
1 matlab版本
2014a
2 参考文献
[1] 沈再阳.精通MATLAB信号处理[M].清华大学出版社,2015.
[2]高宝建,彭进业,王琳,潘建寿.信号与系统——使用MATLAB分析与实现[M].清华大学出版社,2020.
[3]王文光,魏少明,任欣.信号处理与系统分析的MATLAB实现[M].电子工业出版社,2018.
[4]王怡,涂宇,谭泽涛,吕雅婷.基于Matlab的FIR滤波器设计与仿真[J].电子技术与软件工程. 2020(18)
【滤波器设计】基于matlab GUI窗函数法高通+低通+带通带阻FIR滤波器设计【含Matlab源码 072期】相关推荐
- matlab窗函数带通滤波器,Matlab结合窗函数法设计数字带通FIR滤波器
Matlab结合窗函数法设计数字带通FIR滤波器 课程设计任务书学生姓名: 专业班级: 通信工程 指导教师: 工作单位: 信息工程学院 题 目:利用 Matlab 仿真软件系统结合窗函数法设计一个数字 ...
- matlab线性相位滤波器设计,matlab用窗函数法设计线性相位fir低通滤波器
matlab用窗函数法设计线性相位fir 低通滤波器 %用窗函数法设计线性相位低通滤波器clear all; wp=*pi; ws=*pi; wd=ws-wp; %hanning窗N_hann=cei ...
- 【光学】基于matlab GUI矩阵法和等效界面法光学薄膜对反射率影响【含Matlab源码 2102期】
⛄一.获取代码方式 获取代码方式1: 完整代码已上传我的资源:[光学]基于matlab GUI矩阵法和等效界面法光学薄膜对反射率影响[含Matlab源码 2102期] 点击上面蓝色字体,直接付费下载, ...
- 【Matlab验证码识别】遗传算法和最大熵优化+大津法(OTSU)+自定义阈值数字验证码识别【含GUI源码 1694期】
一.代码运行视频(哔哩哔哩) [Matlab验证码识别]遗传算法和最大熵优化+大津法(OTSU)+自定义阈值数字验证码识别[含GUI源码 1694期] 二.matlab版本及参考文献 1 matlab ...
- 【图像处理】基于matlab GUI多功能图像处理系统【含Matlab源码 1876期】
⛄一.获取代码方式 获取代码方式1: 完整代码已上传我的资源:[图像处理]基于matlab GUI多功能图像处理系统[含Matlab源码 1876期] 点击上面蓝色字体,直接付费下载,即可. 获取代码 ...
- 【电力预测】基于matlab GUI灰色模型电力负荷预测【含Matlab源码 769期】
一.获取代码方式 获取代码方式1: 完整代码已上传我的资源: [电力负荷预测]基于matlab GUI灰色模型电力负荷预测[含Matlab源码 769期] 获取代码方式2: 通过订阅紫极神光博客付费专 ...
- 【运动学】基于matlab GUI三体运动模拟【含Matlab源码 871期】
⛄一.获取代码方式 获取代码方式1: 完整代码已上传我的资源:[运动学]基于matlab GUI三体运动模拟[含Matlab源码 871期] 点击上面蓝色字体,直接付费下载,即可. 获取代码方式2: ...
- 【机械仿真】基于matlab GUI直齿圆柱齿轮应力计算【含Matlab源码 2077期】
⛄一.获取代码方式 获取代码方式1: 完整代码已上传我的资源:[机械仿真]基于matlab GUI直齿圆柱齿轮应力计算[含Matlab源码 2077期] 点击上面蓝色字体,直接付费下载,即可. 获取代 ...
- 【Matlab语音处理】汉宁窗FIR陷波滤波器语音信号加噪去噪【含GUI源码 1711期】
一.代码运行视频(哔哩哔哩) [Matlab语音处理]汉宁窗FIR陷波滤波器语音信号加噪去噪[含GUI源码 1711期] 二.matlab版本及参考文献 1 matlab版本 2014a 2 参考文献 ...
- 【数字信号】基于matlab GUI电话按键识别【含Matlab源码 2382期】
⛄一.获取代码方式 获取代码方式1: 完整代码已上传我的资源:[数字信号]基于matlab GUI电话按键识别[含Matlab源码 2382期] 点击上面蓝色字体,直接付费下载,即可. 获取代码方式2 ...
最新文章
- solr5.5.4 添加mysql数据,实现同步更新
- 架构师之路 — 分布式系统 — gRPC 的 4 种服务定义及调用方式
- facade 模式和gateway模式的区别
- buuoj-crypto 2
- 那些年送出去的交互方案-微博篇
- CAN 多于8字节的拆包组包协议
- C++ Opengl纹理混合源码
- 矫情这一次,感谢这几个人。
- ROS-URDF仿真
- DDIA笔记—第六章 数据分区
- 二叉树面试题:判断树是否为完全二叉树和求二叉树的镜像
- 键盘与鼠标器是微型计算机上最常用的,2016年职称计算机考试WindowsXP考前预测试题5...
- 【转】显卡:ATI和NVIDIA两大主流显卡比较
- MAC编译的JDK执行出错: [libjvm.dylib+0x482a49] PerfDataManager::destroy()+0xab
- trivial destructor
- python powerbi知乎_数据分析-PowerBI
- python蜂鸣器天空之城频率_蜂鸣器版天空之城 - osc_lopdl9qi的个人空间 - OSCHINA - 中文开源技术交流社区...
- python使用pika订阅rabbitmq消息链接被重置问题
- Python简易的HTTP服务器
- android图形动画