LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to take the sum of an a cluster

Solved!
Go to solution

Hey Im trying to convert a matlab code into labview and i came across this issue with clusters. can anybody help?

  let's say:

[Pxx,w]=periodogram (mydata, [],[],var]

     time=sum(mydata.^2)/length(mydata)

     freq=sum(Pxx)

     Pxx=Pxx*time/freq

     Pxx=sqrt(Pxx)

     loglog(w,Pxx)

 

I manage to do the PSD of mydata, and translate time into labview code..

     but how do I take the sum of Pxx which is clearly going to be a cluster of 3 elements (magnitude, df, f0).. help?

0 Kudos
Message 1 of 9
(4,499 Views)

The feedback forum is not for tenchical questions. I try to have this moved to the LabVIEW forum (since you mention LabVIEW).

0 Kudos
Message 2 of 9
(4,493 Views)

I'd just run the waveform through FFT Power Spectrum and PSD VI found on the waveform measurements vis palatte.  (LabVIEW uses a default Hanning window so to match Matlab make sure you wire a "Rectangle" to the window input)


"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 9
(4,467 Views)

I thought this was.. yoou have the direct link?

0 Kudos
Message 4 of 9
(4,452 Views)

Then how would I take the sum(PSD). Since the PSD come in a cluster....

0 Kudos
Message 5 of 9
(4,448 Views)

Sure, Right Here

 

Export mode changes the output between PSD (Matlab Pxx = periodogram(x,window)) and Power Spectrum.  Esentiall the same as:

 Pxx = periodogram(x,window,power)

 

beyond that "summing" f0, df and an array of magitudes is adding apples to a bag of carrots what measurement are you expecting? (My Matlab is a bit rusty)


"Should be" isn't "Is" -Jay
0 Kudos
Message 6 of 9
(4,440 Views)
Solution
Accepted by topic author ritch_by_nature

My point exactly! so i decided to unbundle the Psd and do the sum of the magnitude array elements. then rebundle it with the f. and dt... not sure if that will work

0 Kudos
Message 7 of 9
(4,423 Views)

You probably want something more like this:

!1.png

 

but thats a guess... 

 


"Should be" isn't "Is" -Jay
0 Kudos
Message 8 of 9
(4,409 Views)

Perfect!

0 Kudos
Message 9 of 9
(4,385 Views)