LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

phase of cross spectrum

Hi,

I am trying to quantify the phase between 2 signals. I have used to Cross Power Spectrum VI found in LabView but it gives me a large amount of noise that I should not be seeing. I proceeded to write my own cross spectrum program which also resulted in a large amount of noise (it was however, different to the Cross Power Spectrum VI). I expected some noise, but not a constant fluctuation over 0. I have tried many times to see what is wrong but as far as I can see, I am doing everything right. I don't believe there is anything wrong with my data either, as power spectra VI's work fine with it. I have attached my VI which has a cross spectra I wrote myself and a part using the LabView VIs. Also attached is sample Data to use with the VI.

Kind regards

Peter
Download All
0 Kudos
Message 1 of 6
(4,560 Views)

Hi Cave Man,

My guess is that the results you are reading are noisy due to the nature of the cross power spectrum.  Even if you input two sine waves, completely identical except for a very slight phase shift, the phase output still appears to be quite noisy.

Are you sure that your results are not what is expected?  Have you tried calculating what the value should be at particular points in order to compare it to the results you are getting programmatically?

Regards,

Lauren

Applications Engineering
National Instruments
0 Kudos
Message 2 of 6
(4,532 Views)
Hi,

Thanks for the advice Lauren. The nature of the cross spectrum is what I thought might be the problem because the power spectra of each signal is correct. But my wiring is consistent to just about every formula out there for cross spectra and phase, even the one appearing in the LabView help.

My data is of blood pressure values and heart beat intervals (R-R intervals), as is the attached picture. The cross spectrum (both the LabView one and my own contructed one) should produce a phase periodogram similar to the ones in the attached picture (the dotted lines). They do have a bit of noise, but nothing oscillating about 0 like mine. My results should be consistent with the the attached picture whether I use the LabView written Cross Power Spectrum VI or my own. And neither work.

I just don't see what is wrong. Even if my own constructed version is wrong (I don't believe it is), the LabView one should be right.
Do you have anymore suggestions?


Kind regards,


Peter
0 Kudos
Message 3 of 6
(4,524 Views)

Hi Peter,

The LabVIEW function should operate correctly.  The input data is the only factor that could affect the output, so if there is an error, I believe that it is in relation to the data.  How are you acquiring the data?  If you are reading it externally, have you tried varying the number of samples you are reading?  In your first post, where you attached your data, I was unable to open it.  Could you include a small portion of the information, so I can specifically look into points?

Where did you get the information in the attached pdf?  Are you sure that the output graph corresponds to your situation (data) and the cross power spectra?  The LabVIEW function operates as described, so it seems that the problem could only be that the data is inconsistent or you are using the wrong function for the situation.

Regards,

Lauren

Applications Engineering
National Instruments
0 Kudos
Message 4 of 6
(4,505 Views)
Hi,


I've attached a VI (it's a different name to the one it wants, but it works) that will open the data. Sorry, that's why you couldn't read it. I am acquiring the data through a labview DAQ and then processing it to give me the appropriate variables, i.e. heart beat times (R wave times) and blood pressure values.

The pdf picture was taken from this paper.

JA Taylor, DL Eckberg. Fundamental Relations Between Short-term RR Interval and Arterial Pressure Oscillations in Humans. Circulation. 1996;93:1527-1532

I'm trying to do the same, look at the phase and coherence between blood pressure and heart rate. They use cross spectral analysis found in a paper

RW DeBoer, JM Karemaker, J Strackee. Hemodynamic fluctuations and baroreflex sensitivity in humans: a beat-to-beat model. Am J Physiol. 1987;253:H680-H689

And I've followed exactly what it says. And yes, I thought it'll be something to do with the input data or what I was doing before it went into the Labview function but it appears fine. And as you will see when it opens, the Labview power spectrum function works fine on it as does my own written one.

Thanks for your continuing help,

Kind regards,

Peter
0 Kudos
Message 5 of 6
(4,497 Views)

Hi Peter,

Due to the nature of the cross power spectrum, even the slightest amount of noise results in a completely skewed phase output.  I tried graphing the phase output of the cross power spectrum using two sine waves as inputs, with a frequency difference of only 0.01 Hz.  The phase output resulted in the bottom graph in the attached picture.  Then I added some noise, and the resulting output is completely different, as you can see on the graph.

Basically, even the smallest amount of noise will drastically change the phase output.  Unless you can filter the incoming signal to eliminate all noise, I am not sure if you will be able to read a satisfactory cross power spectrum.  If you decide to try to clean the signal up as much as possible, I would recommend posting on the DAQ forums for specifics.

Regards,

Lauren

Applications Engineering
National Instruments
0 Kudos
Message 6 of 6
(4,477 Views)