Homework2 姓名:陳裕旻 學號:MA020129 1. Load the ex2_1.csv as attached (1) Plot the original waveform(the base line adjust to 0.0) Ans:如圖一是將時基線調整至 0.0 之原始訊號 原始訊號 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0 -0.1 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 4 4.5 5 圖一:原始訊號 (2) Add the noise ( -30 db) to the original waveform Ans: SNR=-30db 5 4 3 2 振幅 1 0 -1 -2 -3 -4 0 0.5 1 1.5 2 2.5 TIME(s) 3 3.5 圖二:加入-30DB 之雜訊 (3)Compute the heart rate( beat/min, mean +- standard deviation) of (2) Ans:84 下/分鐘,平均值=0.66秒以及標準差=0.008 (4)Using the template technique to compute the heart rate of (2) Ans:84 下/分鐘 (5)Compare the spectrum between (1) and (2) Ans: 頻率在低頻時訊號比較好,在高頻時訊號較不好且會產生雜訊。 頻率響應圖 40 35 30 25 20 15 10 5 0 0 10 20 30 40 50 60 Frequency (Hz) 70 80 90 100 圖三:頻率響應圖 (6)Use the Welch method to estimate the power spectrum of (1) ( choice the optimal window and overlap parameter) Ans:我是使用 Kaiser Window 與 Harming 由圖三可知從 0HZ to 20HZ 的能量較 強,頻率越高時能量頻譜較低。 -3 2.5 Power Spectrum (Welch Method) x 10 Power Spectrum 2 1.5 1 0.5 0 0 10 20 30 40 50 60 Frequency (Hz) 70 80 90 100 圖三:Kaiser 視窗 圖四:Harming 視窗 (7)Tell me your finding Ans:原始訊號加入一雜訊後雜訊也跟著被放大且不易計算出心跳值。程式方面九 十六下是在MATLAB中加入以下這段%x=pl_Signal(o-70:o+71); rxy=xcorr(pl_Signal,pl_Signal(614:755)); rxy=rxy(i1:(2*i1-1))/max(rxy); L=[];j=0; for i=1:141:length(rxy)-141 j=j+1; rxy1=rxy(i:i+141); L1=find(rxy1==max(rxy1)); L=[L,L1+i]; end 2. Use sig_noise to generate a 512 points array that contains two closely spaced sinusoid at 150 and 180 Hz both with an SNR of -20 dB, assumes a sampling rate of 1 kHz. Use the Welch method and find the spectrum of waveform for segment length 512 (no overlap), and 128 point overlap. Ans: Power Spectrum (Welch Method) 0.01 0.009 0.008 Power Spectrum 0.007 0.006 0.005 0.004 0.003 0.002 0.001 0 0 50 100 150 200 250 300 Frequency (Hz) 圖五 350 400 450 500 圖六