含噪语音matlab界面处理Word格式文档下载.docx
- 文档编号:14974467
- 上传时间:2022-10-26
- 格式:DOCX
- 页数:16
- 大小:142.62KB
含噪语音matlab界面处理Word格式文档下载.docx
《含噪语音matlab界面处理Word格式文档下载.docx》由会员分享,可在线阅读,更多相关《含噪语音matlab界面处理Word格式文档下载.docx(16页珍藏版)》请在冰豆网上搜索。
二、实验原理和内容
详见试验讲义
3、主要仪器设备
Matlab仿真软件
四、实验步骤与操作方法
五、试验题目及程序代码、结果
程序代码:
functionvarargout=noisedeal(varargin)
gui_Singleton=1;
gui_State=struct('
gui_Name'
mfilename,...
'
gui_Singleton'
gui_Singleton,...
gui_OpeningFcn'
@noisedeal_OpeningFcn,...
gui_OutputFcn'
@noisedeal_OutputFcn,...
gui_LayoutFcn'
[],...
gui_Callback'
[]);
ifnargin&
&
ischar(varargin{1})
gui_State.gui_Callback=str2func(varargin{1});
end
ifnargout
[varargout{1:
nargout}]=gui_mainfcn(gui_State,varargin{:
});
else
gui_mainfcn(gui_State,varargin{:
functionnoisedeal_OpeningFcn(hObject,eventdata,handles,varargin)
handles.output=hObject;
guidata(hObject,handles);
functionvarargout=noisedeal_OutputFcn(hObject,eventdata,handles)
varargout{1}=handles.output;
functionUntitled_1_Callback(hObject,eventdata,handles)
functionopen_Callback(hObject,eventdata,handles)
a='
part1.wav'
;
p=mfilename('
fullpath'
)
i=findstr(p,'
\'
p=(1:
i(end));
b=cd;
[y,fs,nbite]=wavread(fullfile(b,a));
handles.y=y;
handles.fs=fs;
axes(handles.axes1)
subplot(121);
plot(y);
len=length(y);
handles.len=len;
ts=(len-1)/fs;
t=0:
1/fs:
ts;
y1=y;
fy=fft(y1);
f=(0:
length(t)-1)*fs/length(t)-fs/2;
subplot(122);
plot(f,fftshift(abs(fy)));
axes(handles.axes2);
guidata(hObject,handles);
functionsave_Callback(hObject,eventdata,handles)
wavwrite(handles.q,'
new'
);
functionfir_Callback(hObject,eventdata,handles)
handles.k1=get(handles.fir,'
value'
ifhandles.k1==1
set(handles.listbox1,'
visible'
'
on'
set(handles.listbox2,'
off'
set(handles.iir,'
0);
end;
functioniir_Callback(hObject,eventdata,handles)
ifhandles.k2==1
set(handles.fir,'
functionlistbox1_Callback(hObject,eventdata,handles)
functionlistbox1_CreateFcn(hObject,eventdata,handles)
ifispc&
isequal(get(hObject,'
BackgroundColor'
),get(0,'
defaultUicontrolBackgroundColor'
))
set(hObject,'
white'
functionsure_Callback(hObject,eventdata,handles)
k=get(handles.fir,'
ifk==1
runParameter;
else
runsetting
functionsound_Callback(hObject,eventdata,handles)
functionregional_Callback(hObject,eventdata,handles)
wavplay(handles.y,handles.fs);
functiondials_Callback(hObject,eventdata,handles)
wavplay(handles.q,handles.fs);
functionpaint_Callback(hObject,eventdata,handles)
k1=get(handles.fir,'
k2=get(handles.iir,'
ifk1>
k2
handles.l=getappdata(0,'
l'
handles.f=str2num(getappdata(0,'
f'
));
handles.kp1=str2num(getappdata(0,'
pk1'
handles.kp2=str2num(getappdata(0,'
pk2'
handles.sk1=str2num(getappdata(0,'
sk1'
handles.sk2=str2num(getappdata(0,'
sk2'
handles.apl=str2num(getappdata(0,'
apl'
handles.asl=str2num(getappdata(0,'
asl'
choose=getappdata(0,'
choose'
ifchoose=='
3'
wp=[handles.kp1handles.kp2];
wr=[handles.sk1handles.sk2];
else
wp=handles.kp1;
wr=handles.sk1;
end
ch=get(handles.listbox1,'
switchch
case1
[N,Wn]=buttord(wp/pi,wr/pi,handles.apl,handles.asl);
[b,a]=butter(N,Wn,handles.l);
case2
[N,Wn]=cheb1ord(wp/pi,wr/pi,handles.apl,handles.asl);
[b,a]=cheby1(N,handles.apl,Wn,handles.l);
case3
[f,w]=freqz(b,a);
f_mag=abs(f);
plot(w/pi,abs(f_mag));
handles.a=a;
handles.b=b;
handles.h=getappdata(0,'
h'
handles.n=str2num(getappdata(0,'
n'
handles.wc=str2num(getappdata(0,'
wc'
cl=get(handles.listbox2,'
ifhandles.h==1
chr='
low'
else
high'
switchcl
b=fir1(handles.n,handles.wc,chr,boxcar(handles.n+1));
b=fir1(handles.n,handles.wc,chr,hamming(handles.n+1));
stem(b);
functionlistbox2_Callback(hObject,eventdata,handles)
functionlistbox2_CreateFcn(hObject,eventdata,handles)
functioneffect_Callback(hObject,eventdata,handles)
q=filtfilt(handles.b,handles.a,handles.nos);
figure;
plot(q);
ts=(handles.len-1)/handles.fs;
1/handles.fs:
fy=fft(q);
length(t)-1)*handles.fs/length(t)-handles.fs/2;
handles.q=q;
functionnois_Callback(hObject,eventdata,handles)
functiongaosi_Callback(hObject,eventdata,handles)
functionbai_Callback(hObject,eventdata,handles)
nos=0.001*rand(handles.len,1);
handles.nos=handles.y+nos;
plot(
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 语音 matlab 界面 处理