LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

WA Detrend for Unevenly sampled signals

Hi,

I am stumped trying to analyze an unevenly sampled signal (such as R-R intervals of an ECG signal, for those familiar)

Before applying "Unevenly Sampled Signal Spectrum" VI I want to detrend the signal and am trying to use "WA Detrend" VI for this purpose.

 

What I don't understand is how to apply this detrending VI to my unevenly sampled signal.

 

If I just feed it the array of values, then it mistakes them for evenly spaced values from what I can tell looking at the attached screenshot of the signal before detrend (with the correct spacing between points) and the detrending signal (where I can see the uneven spacing disappear):

Untitled.png

Anybody can help me here?

Thanks in advance

Peter

0 Kudos
Message 1 of 6
(2,936 Views)

You should be able to resample your waveform to obtain "Evenly spaced" samples interpolated from the original data

!0.png

 


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 6
(2,921 Views)

Interestingly, looking in an example in Labview's own Biomedical toolkit, I think they are making the same mistake detrending an unevenly spaced signal. Here is a screenshot of the example called "HRV Anayzer":

 

Untitled.png

 

They are feeding the "WA Detrend" an unevenly sampled signal but nowhere does the VI know what the spaces between the points are. It therefore will produce a wrong result, to the best of my understanding.

LabView, are you sure you're not having a big bug here?

 

P

 

Message 3 of 6
(2,920 Views)

@SenSLabs wrote:

Interestingly, looking in an example in Labview's own Biomedical toolkit, I think they are making the same mistake detrending an unevenly spaced signal. Here is a screenshot of the example called "HRV Anayzer":

 

 

They are feeding the "WA Detrend" an unevenly sampled signal but nowhere does the VI know what the spaces between the points are. It therefore will produce a wrong result, to the best of my understanding.

LabView, are you sure you're not having a big bug here?

 

P

 



Nice catch!  Without looking at the rest on the cases I can only assume somebody missed a use case whipping up that example


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 6
(2,918 Views)

Jeff,

 

thanks, that would be defeating the purpose of using Lomb periodigram (which is implemented in "Unevenly Sampled Signal Spectrum" VI) in that it does not require an evenly spaced signal and actually produces a superior result to using an FFT on a resampled signal (based on some literature I saw online). So, resampling the signal, then detrending it, I might as well use a regular FFT and it would be suboptimal.

 

There definitely should be a way to detrend unevenly sampled signals using wavelets, here is an example article: Comparison of Detrending Methods in Spectral Analysis of Heart Rate Variability

 

I think LabView simply did not implement the method correctly, based on my other comment above re: their own example of using it in their Biomedical toolkit. But I could be wrong...

 

Thanks for the reply!

 

P

 

0 Kudos
Message 5 of 6
(2,917 Views)

I hope it is OK to bump this thread.

I am coming back to this issue after putting it aside back in August.

If anybody has any suggestion, I'd appreciate it very much.

0 Kudos
Message 6 of 6
(2,841 Views)