04-24-2014 10:17 AM
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?
Solved! Go to Solution.
04-24-2014 10:50 AM - edited 04-24-2014 11:19 AM
The feedback forum is not for tenchical questions. I try to have this moved to the LabVIEW forum (since you mention LabVIEW).
04-24-2014 11:37 AM - edited 04-24-2014 11:38 AM
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)
04-24-2014 12:07 PM
I thought this was.. yoou have the direct link?
04-24-2014 12:09 PM
Then how would I take the sum(PSD). Since the PSD come in a cluster....
04-24-2014 12:19 PM - edited 04-24-2014 12:24 PM
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)
04-24-2014 12:49 PM
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
04-24-2014 01:24 PM - edited 04-24-2014 01:30 PM
You probably want something more like this:
but thats a guess...
04-24-2014 02:36 PM
Perfect!