音樂(lè)信號(hào)的處理 matlab_第1頁(yè)
音樂(lè)信號(hào)的處理 matlab_第2頁(yè)
音樂(lè)信號(hào)的處理 matlab_第3頁(yè)
音樂(lè)信號(hào)的處理 matlab_第4頁(yè)
音樂(lè)信號(hào)的處理 matlab_第5頁(yè)
已閱讀5頁(yè),還剩21頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶(hù)提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、1、音樂(lè)信號(hào)的音譜和頻譜觀察 y,fs,bit=wavread(2); sound(y,fs); plot(y); y1=y(:,1); M=512; fh1=fft(y1,M); w=2/M*0:M-1; figure;plot(w,abs(fh1); 2、音樂(lè)信號(hào)的抽取(減抽樣) y,fs,bit=wavread(2); sound(y,fs); figure; subplot(1,2,1); plot(y); title(原音樂(lè)信號(hào)波形); y1=y(:,1); M=512; fh1=fft(y1,M); w=2/M*0:M-1; subplot(1,2,2); plot(w,fh1);

2、 title(原音樂(lè)信號(hào)頻譜); grid on; j=0; d=10; %減抽樣間隔 取3和10 代表混疊與非混疊 y3=y1(1:100000); for i=1:d:length(y3); j=j+1; yd(j)=y1(i); end sound(yd,fs/d); figure; subplot(1,2,1); plot(yd); title(減抽樣時(shí)域); fh2=fft(yd); l1=length(fh2); w2=2/l1*(0:l1-1); subplot(1,2,2); plot(w2,abs(fh2); title(減抽樣頻域); 3、音樂(lè)信號(hào)的AM調(diào)制和巴特沃斯IIR

3、濾波器濾波 w,fs,bit=wavread(2); w1=w(:,1); l=length(w1); ww=2/l*(0:l-1); n=0:length(w1)-1; t1=w1.*cos(0.6*pi*n); T1=fft(t1); plot(t1); title(AM低/高頻調(diào)制后波形); figure; plot(ww,abs(T1); title(AM低/高頻調(diào)制后頻譜); sound(t1,fs); t2=t1.*cos(0.6*pi*n); T2=fft(t2); figure; plot(t2); title(AM低/高頻解調(diào)后波形); figure; plot(ww,abs

4、(T2); title(AM低/高頻解調(diào)后頻譜); sound(t2,fs); N,wc=buttord(0.2,0.3,2,15); b1,a=butter(N,wc); h,wi=freqz(b1,a); figure; plot(wi/pi,abs(h); title(iir濾波器頻譜); %用iir對(duì)信號(hào)濾波 y=filter(b1,a,t2); Y=fft(y); figure; plot(y); title(低/高頻解調(diào)濾波后時(shí)域); figure; plot(ww,abs(Y); title(低/高頻解調(diào)濾波后的頻域); sound(y,fs); 用窗函數(shù)法設(shè)計(jì)FIR濾波器(矩形

5、窗和布萊克曼窗) w,fs,bit=wavread(2); w1=w(:,1); n=0:length(w1)-1; t1=w1.*cos(0.6*pi*n); j1=t1.*cos(0.6*pi*n); %用FIR對(duì)信號(hào)同步解調(diào) N=55;wc=pi/4;% boxcar N取9 hd=ideal(N,wc); w=blackman(N);%blackman和boxcar h=hd.*w; M=512; fh=fft(h,M); ww=2/M*(0:M-1); plot(ww,abs(fh); title(矩形窗fir濾波器頻率響應(yīng)); y=conv(j1,h); Y=fft(y,M); f

6、igure plot(y); title(矩形窗fir濾波后時(shí)域); figure plot(ww,abs(Y); title(矩形窗fir濾波后頻域); sound(y,fs); 三余弦和白噪聲的實(shí)驗(yàn) y,fs,bit=wavread(2); y1=y(:,1); f=fft(y1); l=length(f); ww=2/l*(0:l-1); n=0:length(y1)-1; x=0.05*(cos(2*pi*3000*n/fs)+cos(2*pi*5000*n/fs)+cos(2*pi*8000*n/fs); fx1=fft(x); plot(ww,abs(fx1); title(三余弦

7、噪聲頻譜); r=rand(size(y1),1)-0.5; fx2=fft(r); figure plot(ww,abs(fx2); title(隨機(jī)白噪聲頻譜); x1=y1+x; figure plot(x1); title(加三余弦噪聲的信號(hào)音譜); fx3=fft(x1); figure plot(ww,abs(fx3); title(加三余弦噪聲的信號(hào)頻譜); x2=y1+r; figure plot(x2); title(加白噪聲的信號(hào)音譜); fx4=fft(x2); figure plot(ww,abs(fx4); title(加白噪聲的信號(hào)頻譜); sound(x1,fs)

8、; sound(x2,fs); 三余弦噪聲濾波 y,fs,bit=wavread(2); y1=y(:,1); f=fft(y1); l=length(f); ww=2/l*(0:l-1); n=0:length(y1)-1; x=0.05*(cos(2*pi*3000*n/fs)+cos(2*pi*5000*n/fs)+cos(2*pi*8000*n/fs); fx1=fft(x); plot(ww,abs(fx1); title(三余弦噪聲頻譜); x1=y1+x; figure plot(x1); title(加三余弦噪聲的信號(hào)音譜); fx3=fft(x1); figure plot(

9、ww,abs(fx3); title(加三余弦噪聲的信號(hào)頻譜); sound(x1,fs); N,wc=buttord(0.1,0.14,5,20); b1,a=butter(N,wc); R=filter(b1,a,x1); fr=fft(R); figure plot(R); title(濾波去噪后信號(hào)的音譜); figure plot(ww,abs(fr); title(濾波去噪后信號(hào)頻譜); sound(R,fs); 隨機(jī)白噪聲濾波 y,fs,bit=wavread(2); y1=y(:,1); f=fft(y1); l=length(f); ww=2/l*(0:l-1); n=0:l

10、ength(y1)-1; r=rand(size(y1),1)-0.5; fx2=fft(r); figure plot(ww,abs(fx2); title(隨機(jī)白噪聲頻譜); x2=y1+r; figure plot(x2); title(加白噪聲的信號(hào)音譜); fx4=fft(x2); figure plot(ww,abs(fx4); title(加白噪聲的信號(hào)頻譜); N,wc=buttord(0.06,0.1,2,20); b1,a=butter(N,wc); G=filter(b1,a,x2); fg1=fft(G); figure plot(G); title(濾波去噪后信號(hào)的音

11、譜); figure plot(ww,abs(fg1); title(濾波去噪后信號(hào)頻譜); sound(x2,fs); sound(G,fs); 設(shè)計(jì)低通濾波器 y,fs,bit=wavread(2); y1=y(:,1); fx1=fft(y1); l=length(fx1); ww=2/l*(0:l-1); figure; plot(ww,abs(fx1); title(原信號(hào)頻譜); N,wc=buttord(0.1,0.15,1,20); b1,a=butter(N,wc); h,wi=freqz(b1,a); figure; plot(wi/pi,abs(h); title(濾波器

12、特性曲線); y=filter(b1,a,y1); fx2=fft(y); figure; plot(ww,abs(fx2); title(濾波后頻譜); sound(y1,fs); sound(y,fs); 設(shè)計(jì)高通濾波器 y,fs,bit=wavread(1); y1=y(:,1); fx1=fft(y1); l=length(fx1); ww=2/l*(0:l-1); figure; plot(ww,abs(fx1); title(原信號(hào)頻譜); N,wc=buttord(0.15,0.2,1,20); b1,a=butter(N,wc,high); h,wi=freqz(b1,a,whole); figure; plot(wi/pi,abs(h); title(濾波器特性曲線); y2=filter(b1,a,y1); fx2=fft(y2); figure; plot(ww,abs(fx2); title(濾波后頻譜); sound(y1,fs); sound(y2,fs); 幅

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶(hù)所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶(hù)上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶(hù)上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶(hù)因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論