LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

read f32 files

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,

GaelleLabviewShowExampleSound.png

0 Kudos
Message 1 of 20
(3,552 Views)

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?

0 Kudos
Message 2 of 20
(3,550 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 20
(3,539 Views)

.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 :]

0 Kudos
Message 4 of 20
(3,533 Views)

gaelle_c wrote:

I cannot find how to attach my .F32 on the post... do you know how?


Put it inside a zip file. 😄

0 Kudos
Message 5 of 20
(3,524 Views)

This should be all you need.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 20
(3,510 Views)

Yes I tried that but I keep on having the error "Error Code: Invalid File Type" ... I could send it via email ?

0 Kudos
Message 7 of 20
(3,503 Views)

Thx , I'll have a look at that !

0 Kudos
Message 8 of 20
(3,502 Views)

The little endian does not do the trick unfortunately 😞 (I have pretty much the same block diagram as the one above)

0 Kudos
Message 9 of 20
(3,483 Views)
"Pretty much" or "exactly" the same? For example if you would wire a sgl array instead of a scalar to the type input, it would expect prepended size information and will no longer work
0 Kudos
Message 10 of 20
(3,476 Views)