LabVIEW MathScript RT Module

cancel
Showing results for 
Search instead for 
Did you mean: 

cross power spectral density

Hello,
 
I want to calculate the coherence between two signals (pressure vs time)
as far as I know for that I need to calculate Cross Power Spectral Density,
not Cross power Spectrum but as the LabView does not have Cross Power
Spectral Density. I have tried to use MATLAB to calculate Cross Power
Spectral Density but it seems that there is something wrong with my program
would you please help me.
 
and if you know other way to calculate the coherenece between two signals
I really appreciate any help.
 
PS. I attached my Vi with data.
       Sampling Frequency : 100 Hz 
0 Kudos
Message 1 of 7
(10,549 Views)
Hello,

We will investigate adding a cross power spectral density function to a future version of MathScript.  In the meantime, you may wish to look at the cohere function.  As a second choice, you can look at the csd function, too.  Note that there will be some scaling issues to deal with if you use csd.

Grant M.
Staff Software Engineer | LabVIEW Math & Signal Processing | National Instruments
0 Kudos
Message 2 of 7
(10,538 Views)

kiarash,

I believe the problem you are having is because of the datatype of the inputs to the MATLAB Script Node.  By default, an input to a script node is "Real" (double precision scalar).  To change the datatype to "1-D Array of Real" to match the data from the measurement file, right click each of the script node inputs and select "Chose Data Type".  This way, the data being sent to MATLAB will match the datatype expected by the CPSD function.

Also note that you can convert the Dynamic Data directly to a numeric 1-D array with the "Convert from Dynamic Data" function.  Currently, the data is being converted to a Waveform datatype, which is not necessary.  Double click the "Convert from Dynamic Data" function, then select "1D array of scalars - automatic".

Chris M

Message 3 of 7
(10,523 Views)

Hi Chris,

Yes you are completely right. Thanks for your help 🙂

Kiarash

0 Kudos
Message 4 of 7
(10,515 Views)

Dear kiarash and Chris:

 

I do the same method as you write.

But I also have the error.

Could you help me to solve it?

 

Thank you

 

I attached my program here.

 

 

 

Download All
0 Kudos
Message 5 of 7
(9,149 Views)

Hello,
I have a problem with the spss. Could you please help how to calculate regulation time, memory effect, spectral density function?????

0 Kudos
Message 6 of 7
(7,725 Views)

asddddd wrote:

I have a problem with the spss. Could you please help how to calculate regulation time, memory effect, spectral density function?????


Do you think your question is directly related to this 2 year old discussion about cross power spectrum? If not, you should really start a new thread. To be clear, you should also spell out acronyms (such as spss), because they have multiple meanings.

 

Thanks.

0 Kudos
Message 7 of 7
(7,721 Views)