LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

High sampling rate output problem still...

Hi all,

Kudos to Lucither who got us far along with this problem (see our original post below)...We hare closer, but still have a weird problem.  See attached code and screen shot.  We took L's advice and things got much  better but the signal at the AIoutput stage does not look at all like a sine wave.  Take a look at the attached plot of the same signal read and plotted via matlab from the same binary file (16 bit signed integers) containing 5 seconds of a 9kHz, 1V amplitude sine wave.   You can download this file to try in the code at http://www.keck.ucsf.edu/~schenk/testlabview9k.int16

 

I am trying to get this labview code that an NI engineer wrote for us to work (the engineer wrote it for us about a year ago but the project got tabled until now...he is no longer with NI!).  What we need is code that can read a binary file of voltage data from the disk and stream it out through an analog output channel on a NIdaq 6251 to an ultrasonic capable speaker at high (350kHz) sampling rates.  (We are outputing synthesized ultrasonic mouse vocalizations).  Unfortunately I am a LabView newbie so I am really lost.  The code is attached.  We have contacted NI about helping with this but they have been clueless...I hope one of you can help!  I think the idea, if I remember correctly, is for the code to read the data into a software buffer so that reading from the disk, which I am assumming may be slow, will not interfere with the data going out to the speaker at the desired sampling rate...Right now it does not work (gives no errors that we can see) but the buffer does not seem to be filling...  To test it download a file I made that contains a binary file (16 bit signed integers) containing 5 seconds of a 90kHz, 1V amplitude sine wave sampled at 360kHz here http://www.keck.ucsf.edu/~schenk/testlabview.int16

 


Thanks again! 

finnsmama

 

0 Kudos
Message 1 of 5
(2,481 Views)

Could you re-post in 2009,

 

Rgs,

 

Lucither.

------------------------------------------------------------------------------------------------------
"Everything should be made as simple as possible but no simpler"
0 Kudos
Message 2 of 5
(2,471 Views)

Finns,

 

You need to read it little-endian:

 

Read graph.png

 

This gives you the graph you are after.

 

Change accordingly in your main application. Ensure you do it for each read function.

 

Rgs,

 

Lucither.

------------------------------------------------------------------------------------------------------
"Everything should be made as simple as possible but no simpler"
Message 3 of 5
(2,465 Views)

Finns,

 

What was the score with the original software, was it never tested? The reason i asked is because it actually looks like a piece of software that was working at one point but then sabotaged. Just so many little things that all would stop it from ever working. For instance where you are dividing the incoming array by another array with 1 element would cause it to never work and it seems as though someone has gone out of the way to disguise it by removing the index display. Just wondered.

 

Rgs,

 

Lucither.

------------------------------------------------------------------------------------------------------
"Everything should be made as simple as possible but no simpler"
0 Kudos
Message 4 of 5
(2,458 Views)

Hi Guys,

 

This kind of application is a little tricky but I coded something up that reads samples from a file and writes them. I tested it out and it seemed to work fine. I've attached this VI as well the VI I used to generate the data as well. Both are for LV 2009. Hope this helps!

Sean Ferguson
Application Engineering Specialist | RF and Reconfigurable Test
Download All
0 Kudos
Message 5 of 5
(2,418 Views)