Download - 個人報告
![Page 1: 個人報告](https://reader036.vdocuments.pub/reader036/viewer/2022082818/56813095550346895d96716d/html5/thumbnails/1.jpg)
個人報告
老師:侯春茹學生:陳勤明
1. 濾波2. FIR與移動平均濾波3. 功率頻譜密度
![Page 2: 個人報告](https://reader036.vdocuments.pub/reader036/viewer/2022082818/56813095550346895d96716d/html5/thumbnails/2.jpg)
濾波程式
![Page 3: 個人報告](https://reader036.vdocuments.pub/reader036/viewer/2022082818/56813095550346895d96716d/html5/thumbnails/3.jpg)
濾波後強度頻譜比較
![Page 4: 個人報告](https://reader036.vdocuments.pub/reader036/viewer/2022082818/56813095550346895d96716d/html5/thumbnails/4.jpg)
濾波後強度頻譜程式
![Page 5: 個人報告](https://reader036.vdocuments.pub/reader036/viewer/2022082818/56813095550346895d96716d/html5/thumbnails/5.jpg)
M點移動平均濾波器
![Page 6: 個人報告](https://reader036.vdocuments.pub/reader036/viewer/2022082818/56813095550346895d96716d/html5/thumbnails/6.jpg)
M點移動平均濾波器程式 M=5; yy=[]; for i=1:1:N-M+1 yy1=f7(i:i+M-
1);
yy2=mean(yy1); yy=[yy yy2]; end yy5=yy; %10 M=10; yy=[];
for i=1:1:N-M+1 yy1=f7(i:i+M-1); yy2=mean(yy1); yy=[yy yy2]; end yy10=yy; fs=1024; T=1/fs; r_yy_M5=xcorr(FIR5',FIR5')
; ff t_r_yy_M5=ff t(r_yy_M5); N=length(r_yy_M5) fd=1/(N*T); fy=(0:(N-1)).*fd;
![Page 7: 個人報告](https://reader036.vdocuments.pub/reader036/viewer/2022082818/56813095550346895d96716d/html5/thumbnails/7.jpg)
FIR與移動平均濾波器
![Page 8: 個人報告](https://reader036.vdocuments.pub/reader036/viewer/2022082818/56813095550346895d96716d/html5/thumbnails/8.jpg)
FIR程式%FIRM1=5; b1=ones(M1,1)/5;FIR5=filtfilt(b1,1,f7); M2=10;b2=ones(M2,1)/5FIR10=filtfilt(b2,1,f7);
![Page 9: 個人報告](https://reader036.vdocuments.pub/reader036/viewer/2022082818/56813095550346895d96716d/html5/thumbnails/9.jpg)
功率頻譜密度 -直接法
![Page 10: 個人報告](https://reader036.vdocuments.pub/reader036/viewer/2022082818/56813095550346895d96716d/html5/thumbnails/10.jpg)
功率頻譜密度 -間接法
![Page 11: 個人報告](https://reader036.vdocuments.pub/reader036/viewer/2022082818/56813095550346895d96716d/html5/thumbnails/11.jpg)
功率頻譜密度程式 xcorr_SignalData_detrend=xcorr(f7,f7); N=length(f7); xx1=xcorr_SignalData_detrend(N:(2*N-
1)); % Indirect method xf1=fft(xx1); xpsd1=abs(xf1(1:N/2)); % Direct method xf2=fft(f7); xpsd2=abs(xf2(1:N/2)).^2; f=2.*(0:N/2-1);
fi gure(7) plot(f,xpsd1) xlabel('f/fs') ylabel('Magnitude') title('Power
Spectral Density Indirect method')
fi gure(8) plot(f,xpsd2) xlabel('f/fs') ylabel('Magnitude') title('Direct
method')