Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

24 bit wave format files

I'm acquiring 4 channels of wave data via a 24 bit c RIO-9233. I'm sampling at 25000 S/s. The actual data acquisition seems fine and is in 24 bit resolution. All the data displays properly. The customer wants the data in *.wav formated files. I'm using the Sound File Open.vi with the proper sound format to save this data. I'm also assuming that a 24 bits per sample resolution is acceptable.
 
When I read back the wave file using Sound File Read.vi, my data is clipped. Using sound File Info.vi seems to verify that my sample rate, number of channels and bits per sample are correct. However, my guess is that this is simply info in the header. Do the NI *.wav file functions actually deal with 24 bit data? If so, how can I make sure that my data is not clipped?
0 Kudos
Message 1 of 3
(3,380 Views)

I stand corrected, the actual warning message that I get is:

Warning -4824 occurred at Sound File Write (DBL).vi->WaveForm_File_OpenWriteClose.vi->DDS_Staff_Analyzer.vi

Possible reason(s):

LabVIEW:  (Hex 0xFFFFED28) Clipped Floating-point data to fit the range [-1.0, 1.0].

The flag is being set from: long SoundWriteFileData(long refnum, void *data, unsigned long *samplesRead, short int typeCode);

Why is the data being clipped?

 

cb

0 Kudos
Message 2 of 3
(3,378 Views)
cb,

Thanks for posting to the NI Forums.  The wave file format maps the bits of resolution to floating point numbers between -1.0 and 1.0.  To prevent clipping you should attenuate your signal to between -1 and 1 before attempting to write it to the file.  You can do this by multiplying your signal by some number less than zero.  For example if your signal varies between -4  and 4 you should multiply your signal by .25 so the signal is now contained between -1 and 1.  Hope this helps.

Regards,

Neil S.
Applications Engineer
National Instruments
0 Kudos
Message 3 of 3
(3,359 Views)