LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

binary file is too big in size

Solved!
Go to solution

Hi,

 

I wrote a simple VI to do playback of sound files and to record signals. It seems to do what I want (although I appreciate general feedback on good programming habits). The bigger issue I have is that the binary file it is saving is way too big in size. A few seconds of recording gives a few megabytes of data. Although I can open the binary file in matlab and analyze the data just fine, the big file size doesn't sound right. 

 

Does anyone know why this is the case? I tried saving the data in something other than doubles, but it still gives large file sizes. Played around with the byte order too without much success. Any help is appreciated (LV 2009 file attached).

 

Thanks.

 

FA

0 Kudos
Message 1 of 7
(3,188 Views)
Solution
Accepted by topic author farn

If your DAQ unit is 16 bit or less, simply store data as I16. you store data as DBL and that is 8 bytes pr number. It is no problem making wav files in I16 format. However wav files (in Labview at least) is not a compressed. So the file size will be much bigger than MP3 files that is a compressed file format.



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
Message 2 of 7
(3,181 Views)

That's a good piece of advice and was one of the first things I tried. It did make the file 2-3 times smaller, but still a few seconds of continuous measurement gave a 1mb file even for I16, which still sounded a bit too big for me. Maybe I'm expecting too much?

0 Kudos
Message 3 of 7
(3,164 Views)

What is your data acquisition rate?

Message 4 of 7
(3,158 Views)

Uncompressed CD audio requires roughly 1 MB for every six seconds.  Hopefully that sets the scale for your expectations.

Message 5 of 7
(3,152 Views)

I am sampling at 'cd quality' (44.1kHz) for various reasons (including recording sound files), so maybe I was expecting too much. Thanks for the replies anyway.

 

FA

0 Kudos
Message 6 of 7
(3,148 Views)

44.1 kHz of 16 bit data will cost you 88.2 KB/sec.  A binary file for double float data (8 bytes), will cost you 352.8 KB/sec.

0 Kudos
Message 7 of 7
(3,144 Views)