260 likes | 601 Views
生醫訊號處理概論 ECG. Electrocardiogram. 蔡哲霖 , 蔡政宏 , 林敬展 , 王沐凱 , 蕭景洲. ECG 訊號之窗型 函數 ( 修改 ). Window of ECG signals. ECG 補零點 ,強度、相位頻譜 (L=512). ECG 補零點 ,強度、相位頻譜 (L=512). L=512; % 補零點, EX: 訊號切 100~200 => 總點數為 100 ,故補比 100 大的數,須為 2 的次方 fs =1024; % 取樣頻率 t=1/ fs ; % 取樣週期 m=0:L-1; % 頻率點數
E N D
生醫訊號處理概論ECG Electrocardiogram 蔡哲霖, 蔡政宏, 林敬展, 王沐凱, 蕭景洲
ECG訊號之窗型函數(修改) Window of ECG signals
ECG 補零點 ,強度、相位頻譜(L=512) L=512; % 補零點,EX:訊號切100~200 =>總點數為100,故補比100大的數,須為2的次方 fs=1024; % 取樣頻率 t=1/fs; % 取樣週期 m=0:L-1; % 頻率點數 fd=1/(L*t); % 頻率間隔 fy=m.*fd; fft_cut_singal=fft(cut_singal,L); figure(2) subplot(411) plot(cut_singal); axis tight; title('切訊號'); subplot(412) plot(fy,fft_cut_singal); axis tight; title('切訊號 補零點 L=512 FFT '); subplot(413) plot(fy,abs(fft_cut_singal)) axis tight title('強度頻譜') subplot(414) plot(fy,angle(fft_cut_singal)) axis tight%貼緊視窗 title('相位頻譜') print('-f2', '-djpeg', '-r300', 'figure2');
切訊號+Hamming window的頻譜 n1=length(cut_singal); tc=(1:n1)/fs; window1=hamming(n1); % Hamming window addwindow1=(cut_singal).*hamming(n1); % 原始訊號乘上 Hamming window figure(10); subplot(121); plot(window1); % Hamming window的頻譜圖 title('Hamming window的頻譜圖'); axis tight; subplot(122); plot(tc,addwindow1); title('原始訊號乘上 Hamming window'); axis tight; xlim('auto'); print('-f10', '-djpeg', '-r300', 'figure10');
切訊號+ Rectangular window的頻譜 window2=rectwin(n1); % Rectangular window addwindow2=(cut_singal).*rectwin(n1); % 原始訊號乘上 Rectangular window figure(11) subplot(121) plot(window2); % Rectangular window的頻譜圖 title('Rectangular window的頻譜圖') axis tight subplot(122) plot(tc,addwindow2); title('原始訊號乘上 Rectangular window') axis tight xlim('auto'); print('-f11', '-djpeg', '-r300', 'figure11');
切訊號+ Hann window的頻譜 window3=hann(n1); % Hann window addwindow3=(cut_singal).*hann(n1); % 原始訊號乘上 Hann window figure(12); subplot(121); plot(window3); % Hann window的頻譜圖 title('Hann window的頻譜圖'); axis tight; subplot(122); plot(tc,addwindow3); title('原始訊號乘上 Hann window'); axis tight; xlim('auto'); print('-f12', '-djpeg', '-r300', 'figure12');
切訊號+ Blackman window的頻譜 window4=blackmanharris(n1); % Blackman window addwindow4=(cut_singal).*blackmanharris(n1); % 原始訊號乘上 Blackman window figure(13) subplot(1,2,1) plot(window4); % Blackman window的頻譜圖 title('Blackman window的頻譜圖') axis tight subplot(1,2,2) plot(tc,addwindow4); title('原始訊號乘上 Blackman window') axis tight xlim('auto'); print('-f13', '-djpeg', '-r300', 'figure13');
切訊號+ Triangular window的頻譜 window5=triang(n1); % Triangular window addwindow5=(cut_singal).*triang(n1); % 原始訊號乘上 Triangular window figure(14) subplot(1,2,1) plot(window5); % Triangular window的頻譜圖 title('Triangular window的頻譜圖') axis tight subplot(1,2,2) plot(tc,addwindow5); title('原始訊號乘上 Triangular window') axis tight xlim('auto'); print('-f14', '-djpeg', '-r300', 'figure14');