LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Power Spectrum to TDMS

Hello,

   I am reading some bluetooth data from a LabVIEW VST instrument. X is Freq and Y is Amplitude. The data appears to me a a cluster containing "x0", "dx" and an array of "y". I would like to place this data into a TDMS file. How would I go about this.

Many thanks, Alec

0 Kudos
Message 1 of 11
(3,475 Views)

build waveform from that cluster and write it to tdms?

 

0 Kudos
Message 2 of 11
(3,462 Views)

If you write a waveform data type to a TDMS file, the Y values will be written as samples to a channel.  The d0 and dt will be written as properties of that channel.  This is an efficient way of recording the data, but some times you might want it to be presented as XY data, where you have a time value for each Y value.  For this you need to generate the two 1D arrays, one for time, one for the Y values.  This is less efficient because you are writing two data points for each sample, instead of just one with some meta data.

Message 3 of 11
(3,454 Views)

@pawhan11 wrote:

build waveform from that cluster and write it to tdms?

 

 


I just knew somone would suggest thatSmiley Very Happy

That "Clustery looking thing" the OP is seeing is a waveform indicator.

 

Hooovahh is absolutly correct just wire it to a channel and write to TDMS handles it fine.  If you do need to record each time point as well use "Get Waveform Time Array.vi" On the waveform pallete.  (Hard to find since the displayed name is odd)

it looks like this:

Capture.PNG

 


"Should be" isn't "Is" -Jay
Message 4 of 11
(3,442 Views)

I don't understand. When I wire it directly I get an error. 

2014-11-25 17_04_34-Error list.png

0 Kudos
Message 5 of 11
(3,427 Views)

Ah, I missed that its in the freq domain!

 

Capture.PNG

 

I would use something like this

 


"Should be" isn't "Is" -Jay
Message 6 of 11
(3,417 Views)

I kudo'd you because I never knew that function existed, but am curious why the always copy is needed.  Also is a sub VI really needed for finding the size of the waveform?

0 Kudos
Message 7 of 11
(3,404 Views)

@Hooovahh wrote:

I kudo'd you because I never knew that function existed, but am curious why the always copy is needed.  Also is a sub VI really needed for finding the size of the waveform?


(Speaking of the AC inside get waveform time array)

 

Probably because some improper buffer sharing bug used to exist and the subvi is likely used all over that library "Code it ONCE!"

 

The darn thing is hard to find on the palette with the screwy display name in the *mnu.  The palatte commitee overlooked that problem or had to compromize for some other localization.


"Should be" isn't "Is" -Jay
0 Kudos
Message 8 of 11
(3,400 Views)

Thank you! Just out of interest, how did you take that 'snippet' that I can drag onto a block diagram?

May thanks!

0 Kudos
Message 9 of 11
(3,355 Views)

Hmm, is that correct? All is seems to do is mangle my data.

Bluetooth.png

 

tdms problem.png

 

An example of the created TDMS file can be found here

 

Root Name Title Author Date/Time Groups Description dx x0
26.11.2014-10.23.45 _ TP-TRM-CA-05-C- TX Output Spectrum - 20dB Bandwidth_Data 1 10000 2478500000
Group Channels Description
Untitled 456
Untitled
Channel Datatype Unit Length Minimum Maximum Description NI_ArrayColumn Start Index
Channel 00 - Power (dBm) DT_DOUBLE 2 0
Channel 00 - Frequency (Hz) DT_DOUBLE 2 1
Untitled 2 DT_DOUBLE 158 2
Untitled 3 DT_DOUBLE 158 3
Untitled 4 DT_DOUBLE 158 4
Channel 01 - Power (dBm) DT_DOUBLE 2 0
Channel 01 - Frequency (Hz) DT_DOUBLE 2 1
Channel 02 - Power (dBm) DT_DOUBLE 2 0
Channel 02 - Frequency (Hz) DT_DOUBLE 2 1
Channel 03 - Power (dBm) DT_DOUBLE 2 0
Channel 03 - Frequency (Hz) DT_DOUBLE 2 1
Channel 04 - Power (dBm) DT_DOUBLE 2 0
Channel 04 - Frequency (Hz) DT_DOUBLE 2 1
0 Kudos
Message 10 of 11
(3,348 Views)