NI Home > Community > NI Discussion Forums

LabVIEW

Reply
Member
Jaspal
Posts: 48
0 Kudos

FFT based Power spectral density

Hi,

I am trying to compute the FFT based Power Spectral Density (PSD) but do not really understand it.

 

My signal is a real time r-r interval signal. I am interpolating it and resampling it at 100Hz and then pasing it to the FFT Power spectral Density.vi

 

I am not sure if my PSD calculation is correct. Can someone suggest where am I going wrong. I am posting a snapshot of the block diagram and front panel. 

 

Thanks.

 

Member
Mark M
Posts: 122
0 Kudos

Re: FFT based Power spectral density

Hi,

 

Thank you for posting at NI Fourm.

 

I don't see any problem for the PSD calculation part. Are you getting some results you are not expecting in the end?

 

Right click the PSD VI and select help for further information on how to use this VI.

 

Thanks,

Best regards,

Mark M.
Applications Engineer
National Instruments UK & Ireland
Member
Jaspal
Posts: 48
0 Kudos

Re: FFT based Power spectral density

Hi Mark,

I am not getting the results as expected.

I had a look at the processing in detail and also used my r-r signal on Labview HRV analysis toolkit.

It seems that I need to detrend my signal before calculating the PSD.

 

THe most common technique is the Wavelet Detrend V I in the Advanced signal processing toolkit. This removed the baseline trend in the signal.

Is there a way of computing this without using the ASPT. 

Alternately can I get an evaluation version of the toolkit to check if this serves the purpose?

 

Cheers,

 

Member
Mark M
Posts: 122
0 Kudos

Re: FFT based Power spectral density

Hi,

 

I think it is worth to use the evaluation version of the toolkit to check if the issue you have really lies in the PSD.

 

The other possible cause is your input signal. You said you resampled it at 100Hz, what is the highest frequency of your input signal?

Best regards,

Mark M.
Applications Engineer
National Instruments UK & Ireland
Member
Jaspal
Posts: 48
0 Kudos

Re: FFT based Power spectral density

Hi Mark,

 

I am acquiring a pulse signal from the finger using a led and photodiode sesnsor. This signal is in the range of 0-4Hz

 I thne calculate peaks in the signal and take the difference in time between the consecutivepeaks. this is the rr singal.

It is this signal that I wish to calcluate the PSD for. Hoever if u imagine that the time difference in two peaks (the rr value) ranges from 0.6s to 0.8s and plotted at the time of second peak. This signal has a frequency range of 0-0.5 HZ . this is discrete data and the points are not equally placed. Hence following interpolation and resampling the signal is given to the PSD function.

To answer your question, this signal too is in the range of 0-0.5Hz.

I have attached a jpg which shows sampling and cubic interploation.

 

Trusted Enthusiast
Coq_Rouge
Posts: 2,187
0 Kudos

Re: FFT based Power spectral density

HI Mark and Jaspal

The reason for not getting the results as expected is this. You are passing an array to the FFT and PSD functions. The correct input is a waveform with waveform timing details (dt). The timing details are essential for both this functions. Remember then doing signal processing timing details. Either as dt or sample frequency are required in almost all types of calculations. Pay attention to details :smileywink: 

By the way. If you are working with beat to beat heart rate variability. You should not use a function based on standard FFT algorithm. The reason for this is that this type of calculations requires a constant sample rate. The interval between is heart beat is not constant. You should use the "Unevenly Sampled Signal Spectrum VIYou find an example here .....National Instruments\LabVIEW 8.6\examples\math\sig_proc.llb\Generalized Fourier Spectrum.vi   



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)