02-06-2015 10:55 AM
Hi,
I created in Matlab a .F32 (float 32) file, which simply encodes the input voltage to be sent to a speaker. This signal is represented in the picture below, time in samples is on the x axis, and voltage values on the y axis.
Using the VI "Read from binary files", I cannot find back these specific values (I obtain crazy values like 10 to the power -17 or 25 ...). Does anyone know how to achieve reading from a F32 file?
Thanks a lot,
Gaelle
02-06-2015 11:08 AM - edited 02-06-2015 11:09 AM
try little endian. 😉
If this does not work, attach your file and tell us what values you expect. I am not sure about these matlab files. Are they flat binary or do they contain some header?
02-06-2015 11:29 AM
I know Matlab likes to use little endian. So definately make sure you have that set in your Read Binary File. Also, make sure you are trying to read SGL (Single Precision Floating Point numbers) since those are 32 bit. DBL are 64 bit.
02-06-2015 11:33 AM
.F32 is IEEE single precision, raw (i.e. no header).
I cannot find how to attach my .F32 on the post... do you know how?
Sorry for being a dummy :]
02-06-2015 11:40 AM
gaelle_c wrote:I cannot find how to attach my .F32 on the post... do you know how?
Put it inside a zip file. 😄
02-06-2015 11:54 AM - edited 02-06-2015 11:54 AM
This should be all you need.
02-06-2015 12:01 PM
Yes I tried that but I keep on having the error "Error Code: Invalid File Type" ... I could send it via email ?
02-06-2015 12:02 PM
Thx crossrulz, I'll have a look at that !
02-06-2015 12:38 PM
The little endian does not do the trick unfortunately 😞 (I have pretty much the same block diagram as the one above)
02-06-2015 12:43 PM