Matlab spectrogram Hann window

7 views (last 30 days)
matlab learner
matlab learner on 3 Jul 2015
Answered: Star Strider on 3 Jul 2015
Hello, I have an ECG signal 85001Xl that has been sampled with 200 Hz. As it is about the extraction of the heart rate, I want to undersample it at 3Hz. so I used
if true
signal_resampled=resample(signal,3,200);
end
Question: is that right?
No, I want to have the spectrogram base on the Fourier-Transformation.
if true
spectrogram(signal_resampled,WINDOW,NOVERLAP,NFFT,Fs);
end
with:
Fs=3; NFFT = 2^nextpow2(Fs*60); WINDOW= hanning(NFFT); NOVERLAP= floor(length(WINDOW)/2);
(See the plot)
Question: is the choice of my parameters right? How can I define the time point with the most energy out of the spectrogram?
Thank you for your help

Answers (1)

Star Strider
Star Strider on 3 Jul 2015
I would not resample it, since you will lose significant information with a 200 Hz sampling frequency. Heart rate is relatively easy to determine, even if irregular. Depending on the lead that recorded the EKG (rhythm strips are most commonly Lead II), all you need to do is to threshold the signal to detect the R waves. The easiest way to do this is to use the findpeaks function, using the appropriate name-value pair parameters for your signal.
The spectrogram of an EKG is not likely to provide you with much useful information. If you want to reproduce the result of a paper, use the techniques it uses. Otherwise, experiment with the parameters of the spectrogram function to get the result you want. There is probably no one best way to do it.
If the signal is noisy, use a bandpass filter with a passband of 1 Hz to 100 Hz before you do any further analyses. This removes most high-frequency noise and eliminates baseline drift without removing relevant information from your signal. A Butterworth design works well. Use the filtfilt function for the actual filtering. (I outlined the essentials of filter design here.)

Categories

Find more on Time-Frequency Analysis in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!