【文章內(nèi)容簡(jiǎn)介】
e 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 mand line output from handles structurevarargout{1} = 。 % Executes on button press in tag_start.function tag_start_Callback(hObject, eventdata, handles)% hObject handle to tag_start (see GCBO)% eventdata reserved to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)axes()cla。global z0。global yy。fs=22050。nbits=32。[yy,fs,nbits]=wavread(39。D:\39。)。 %語(yǔ)音信號(hào)加載sound(yy,fs)。 %回放語(yǔ)音z0=yy。axes()。plot(yy)。title(39。時(shí)域采樣信號(hào)波形39。)。grid onn=length(yy)。 %求出語(yǔ)音信號(hào)的長(zhǎng)度Y=fft(yy,n)。 %傅里葉變換axes()。plot(20*log10(abs(Y)))。title(39。時(shí)域采樣信號(hào)頻譜39。)。guidata(hObject,handles)。grid on % Executes on button press in tag_ditong.function tag_ditong_Callback(hObject, eventdata, handles)% hObject handle to tag_ditong (see GCBO)% eventdata reserved to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)axes()cla。global z1。global yy。global ba1。global aa1。global Fp。global Fs。fp=1000。ft=5500。fs=1200。wp=2*pi*fp/ft。ws=2*pi*fs/ft。Fp=2*ft*tan(wp/2)。Fs=2*ft*tan(ws/2)。[n,Omgc]=buttord(Fp,Fs,1,100,39。s39。)。 [z,p,k]=buttap(n)。B=k*real(poly(z))。A=real(poly(p))。[b1,a1]=lp2lp(B,A,Omgc)。[ba1,aa1]=bilinear(b1,a1,ft)。 %模擬轉(zhuǎn)數(shù)字z1=filter(ba1,aa1,yy)。[Ha,w]=freqz(ba1,aa1)。 %求頻率相應(yīng)plot(w*ft/(2*pi),20*log10(abs(Ha)))。title(39。IIR 低通濾波器39。)。xlabel(39。頻率/HZ39。)。ylabel(39。幅值39。)。 % Executes on button press in tag_gaotong.function tag_gaotong_Callback(hObject, eventdata, handles)% hObject handle to tag_gaotong (see GCBO)% eventdata reserved to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)axes()cla。global yy。global z2。global B3。global ba3。global aa3。global Fp。global Fs。fp=5000。ft=25000。%取抽樣頻率fs=4800。Rp=1。As=100。wp=2*pi*fp/ft。%通帶頻率ws=2*pi*fs/ft。%截止頻率Fp=2*ft*tan(wp/2)。Fs=2*ft*tan(ws/2)。[n,Omgc]=ellipord(Fp,Fs,Rp,As,39。s39。)。 %計(jì)算階數(shù)n和截止頻率[z,p,k]=ellipap(n,Rp,As)。B3=k*real(poly(z))。A3=real(poly(p))。[b3,a3]=lp2hp(B3,A3,Omgc)。[ba3,aa3]=bilinear(b3,a3,ft)。z2=filter(ba3,aa3,yy)。[Ha,w]=freqz(ba3,aa3)。plot(w*ft/(2*pi),20*log10(abs(Ha)))。title(39。IIR高通濾波器39。)。xlabel(39。