I'm looking for FFT analysis to EEG or ECG signals in MATLAB.
I have tested some codes. Nevertheless I don't know how to obtain a normalized result.
I have read in the documentation that I need to normalize by sample length and sampling rate as well as the window energy, but I don't know if MATLAB functions applied a normalization before…
This is my code for ECG analysis of RR intervals:
{Hwelch=spectrum.welch('Hann',winwidth,50);psdperiodo = psd(Hwelch,RR,'nfft',nfft/2,'Fs',freqinterpol,'SpectrumType','onesided');PSD = psdperiodo.data /(size(RR,1)*(freqinterpol * size(psdperiodo.data,1)));% find the indexes corresponding to the VLF, LF, and HF bands
iVLF= find((psdperiodo.frequencies>VLFmin) & (psdperiodo.frequencies<=VLFmax)); iLF = find((psdperiodo.frequencies>LFmin) & (psdperiodo.frequencies<=LFmax)); iHF = find((psdperiodo.frequencies>HFmin) & (psdperiodo.frequencies<=HFmax));% calculate raw areas (power under curve), within the freq bands (ms^2)
aVLF=trapz(psdperiodo.frequencies(iVLF),PSD(iVLF))*10^6; aLF=trapz(psdperiodo.frequencies(iLF),PSD(iLF))*10^6; aHF=trapz(psdperiodo.frequencies(iHF),PSD(iHF))*10^6;}
Best Answer