✅作者簡介:熱愛科研的Matlab仿真開發者,修心和技術同步精進。
🍎個人首頁:Matlab科研工作室
🍊個人信條:格物緻知。
更多Matlab仿真内容點選👇
智能優化算法 神經網絡預測 雷達通信 無線傳感器
信号處理 圖像處理 路徑規劃 元胞自動機 無人機 電力系統
⛄ 内容介紹
結合數字濾波器的理論基礎和設計方法,在MATLAB程式語言環境下,設計出有限長機關脈沖響應(FIR)數字濾波器,同時利用GUI界面設計FIR數字濾波器人機互動平台,該系統平台界面直覺、操作簡單且功能齊全,可實作對加噪語音信号的去噪濾波功能.平台主要包括語音信号、加噪信号、FIR數字濾波器設計和去噪信号四個子產品,使用者可根據讀入的語音信号及噪聲信号特點調整濾波器技術名額,實作濾波器的優化設計,最終達到FIR數字濾波器對語音信号的去噪處理效果.
⛄ 部分代碼
function varargout = untitled(varargin)
% UNTITLED MATLAB code for untitled.fig
% UNTITLED, by itself, creates a new UNTITLED or raises the existing
% singleton*.
%
% H = UNTITLED returns the handle to a new UNTITLED or the handle to
% the existing singleton*.
%
% UNTITLED('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in UNTITLED.M with the given input arguments.
%
% UNTITLED('Property','Value',...) creates a new UNTITLED or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before untitled_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to untitled_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 untitled
% Last Modified by GUIDE v2.5 12-Jan-2020 11:58:18
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @untitled_OpeningFcn, ...
'gui_OutputFcn', @untitled_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Executes just before untitled is made visible.
function untitled_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 untitled (see VARARGIN)
% Choose default command line output for untitled
handles.output = hObject;
% --- 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)
global x fs
sigLength=length(x);%信号長度
t=(0:sigLength-1)/fs;
x1 = fft(x,sigLength);%傅裡葉變換
halflength=floor(sigLength/2); %取一半
f=fs*(0:halflength)/sigLength; %頻率範圍.
axes(handles.axes1)
plot(t,x) %時域圖
xlabel('t/s');
ylabel('幅度');
axes(handles.axes3)
plot(f,abs(x1(1:halflength+1)));%原始信号頻譜圖
xlabel('頻率/Hz');
ylabel('幅度');
axes(handles.axes2)
cla
axes(handles.axes4)
cla