語(yǔ)言信號(hào)處理asp第5章作業(yè)_第1頁(yè)
語(yǔ)言信號(hào)處理asp第5章作業(yè)_第2頁(yè)
語(yǔ)言信號(hào)處理asp第5章作業(yè)_第3頁(yè)
已閱讀5頁(yè),還剩3頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡(jiǎn)介

1、第七小組題 1:function y=frame2volume(volume)waveFile=朝辭 frameSize=256;overlap=128;間_T.wav;y,bits=wavread(waveFile);fprf(Length of %s is %g sec.n, waveFile, length(y)/fs); frameMat=buffer(y, frameSize, overlap);fram=size(frameMat, 2);m, 1);%計(jì)算音量大小m, 1);volume1=zeros(fravolume2=zeros(frafor i=1:framframe=f

2、rameMat(:,i);frame=frame-mean(frame); % zero-justifiedvolume1(i)=sum(abs(frame);% method 1volume2(i)=10*log10(sum(frame.2); % method 2endtime=(1:length(y)/fs; frameTime=(0:fram-1)*(frameSize-overlap)+0.5*frameSize)/fs;subplot(3,1,1); plot(time, y); ylabel(waveFile);subplot(3,1,2); plot(frameTime, vo

3、lume1, .-); ylabel(Volume (Abs. sum);subplot(3,1,3); plot(frameTime, volume2, .-); ylabel(Volume (Decibels); xlabel(Time (sec);題 2: wavefile=myvoice.wav; framesize=256;overlap=128;%量y,bits=wavread(wavefile);framemat=buffer(y,framesize,overlap);%矩陣清音框 fram=size(framemat,2);%幀數(shù)賦值volume1=zeros(fravolum

4、e2=zeros(fram,1);m,1);for i=1:framframe=framemat(:;i);%逐幀求解 frame=frame-mean(frame); volume1(i)=sum(abs(frame);%method1volume2(i)=10*log(sum(frame.2);%method2endvolume=wave2volume(wavefile,fra題 3:% fs=16000; % 取樣頻率時(shí)間% duration=4; % channel=1; % 單聲道% %bits=8;% fprf(按任意鍵后開(kāi)始 %g 秒% fprf(中.);:, duration)

5、; pause% y=wavrecord(duration*fs, fs, channel);% duration*fs 是資料點(diǎn)數(shù)% fprf(結(jié)束n);% fprf(按任意鍵后開(kāi)始% wavplay(y,fs);:); pauses and Settingsstud桌面第五章實(shí)驗(yàn)myVoie2% wavfiles=C:% wavwrite(y,fs,wavfiles);s and Settingsstud桌面第五章實(shí)驗(yàn)myVoie2.wav;waveFile=C:frameSize=512; overlap=352;y, fs, nbits=wavRead(waveFile);fprf(L

6、ength of %s is %g sec.n, waveFile, length(y)/fs); frameMat=buffer(y, frameSize, overlap);fram=size(frameMat, 2);volume1=zeros(fravolume2=zeros(fram, 1);m, 1);for i=1:framframe=frameMat(:,i);frame=frame-mean(frame); % zero-justifiedvolume1(i)=sum(abs(frame);% method 1volume2(i)=10*log10(sum(frame.2);

7、 % method 2endtime=(1:length(y)/fs; frameTime=(0:fram-1)*(frameSize-overlap)+0.5*frameSize)/fs;subplot(3,1,1); plot(time, y); ylabel(waveFile);subplot(3,1,2); plot(frameTime, volume1, .-); ylabel(Volume (Abs. sum);subplot(3,1,3); plot(frameTime, volume2, .-); ylabel(Volume (Decibels); xlabel(Time (s

8、ec);總結(jié):如果發(fā)音時(shí)肺活量相同,則音量的大小和嘴型是沒(méi)有關(guān)系的!題 4:第一小題:Fs = 16000; % 采樣頻率% 時(shí)間長(zhǎng)度% 采樣點(diǎn)數(shù)% 聲音頻率T = 0.5;n = Fs*T; f = 440;y = 0.8*sin(2*pi*f*T*linspace(0,1,n+1);sound(y,Fs); time=(1:length(y)/Fs; plot(time,y);第二小題:BFs = 16000; % Tn f y=2;Fs*T; 440;% % % sin(2*pi*f*T*linspace(0,1,n+1);sound(y,Fs,8); time=(1:length(y)

9、/Fs;plot(time,y);感想:這道題的難點(diǎn)是分辨率不知道怎么加進(jìn)去,最后結(jié)果與題目有出入,不知道是不是分辨率,聲音聽(tīng)起來(lái)和題目也有出入.題 5:音頻 a:waveFile=朝辭 frameSize=100;overlap=50;間_T.wav;%音框長(zhǎng)度為 100 時(shí)%量 50y, fs, nbits=wavRead(waveFile); %導(dǎo)入fprf(Length of %s is %g sec.n, waveFile, length(y)/fs); frameMat=buffer(y, frameSize, overlap);%切音框fram=size(frameMat, 2)

10、;%計(jì)算音量volume=zeros(fram, 1);for i=1:framframe=frameMat(:,i);frame=frame-median(frame); volume(i)=sum(abs(frame);% method 1endframeSize1=200; overlap1=100;frameMat1=buffer(y, frameSize1, overlap1);fram1=size(frameMat1, 2);volume1=zeros(fram1, 1);for i=1:fram1frame1=frameMat1(:,i);frame1=frame1-median

11、(frame1);volume1(i)=sum(abs(frame1);% method 1endframeSize2=300; overlap2=150;frameMat2=buffer(y, frameSize2, overlap2);fram2=size(frameMat2, 2);volume2=zeros(fram2, 1);for i=1:fram2frame2=frameMat2(:,i);frame2=frame2-median(frame2); volume2(i)=sum(abs(frame2);% method 1endframeSize3=400; overlap3=2

12、00;frameMat3=buffer(y, frameSize3, overlap3);fram3=size(frameMat3, 2);volume3=zeros(fram3, 1);for i=1:fram3frame3=frameMat3(:,i);frame3=frame3-median(frame3); volume3(i)=sum(abs(frame3);% method 1endframeSize4=500; overlap4=250;frameMat4=buffer(y, frameSize4, overlap4);fram4=size(frameMat4, 2);volum

13、e4=zeros(fram4, 1);for i=1:fram4frame4=frameMat4(:,i);frame4=frame4-median(frame4); volume4(i)=sum(abs(frame4);% method 1endtime=(1:length(y)/fs; frameTime=(0:fra frameTime1=(0:fra frameTime2=(0:fra frameTime3=(0:fra frameTime4=(0:fram-1)*(frameSize-overlap)+0.5*frameSize)/fs;m1-1)*(frameSize1-overl

14、ap1)+0.5*frameSize1)/fs; m2-1)*(frameSize2-overlap2)+0.5*frameSize2)/fs m3-1)*(frameSize3-overlap2)+0.5*frameSize3)/fs m4-1)*(frameSize4-overlap2)+0.5*frameSize4)/fssubplot(2,1,1); plot(time, y); ylabel(waveFile);subplot(2,1,2);plot(frameTime,volume,frameTime1,volume1,frameTime2,volume2,frameTime3,

15、volume3,frameTime4,volume4); ylabel(Volume (Abs. sum);音頻 b: waveFile=E:ScourceFile朝辭間_T;frameSize=100;overlap=50;y, fs, nbits=wavRead(waveFile);fprf(Length of %s is %g sec.n, waveFile, length(y)/fs); frameMat=buffer(y, frameSize, overlap);fram=size(frameMat, 2);volume=zeros(fram, 1);for i=1:framfram

16、e=frameMat(:,i);frame=frame-median(frame); volume(i)=sum(abs(frame);% method 1endframeSize1=200; overlap1=100;frameMat1=buffer(y, frameSize1, overlap1);fram1=size(frameMat1, 2);volume1=zeros(fram1, 1);for i=1:fram1frame1=frameMat1(:,i);frame1=frame1-median(frame1); volume1(i)=sum(abs(frame1);% metho

17、d 1endframeSize2=300; overlap2=150;frameMat2=buffer(y, frameSize2, overlap2);fram2=size(frameMat2, 2);volume2=zeros(fram2, 1);for i=1:fram2frame2=frameMat2(:,i);frame2=frame2-median(frame2); volume2(i)=sum(abs(frame2);% method 1endframeSize3=400; overlap3=200;frameMat3=buffer(y, frameSize3, overlap3

18、);fram3=size(frameMat3, 2);volume3=zeros(fram3, 1);for i=1:fram3frame3=frameMat3(:,i);frame3=frame3-median(frame3); volume3(i)=sum(abs(frame3);% method 1endframeSize4=500; overlap4=250;frameMat4=buffer(y, frameSize4, overlap4);fram4=size(frameMat4, 2);volume4=zeros(fram4, 1);for i=1:fram4frame4=frameMat4(:,i

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 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ì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論