LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Convert audio (.wav) to bitstream and vice versa

hello everyone,

1-I want to convert the audio signal into a bitstream and apply digital modulation schemes

2- At the receiver side then recover the output audio signal.

3- put at the output side I cannot recover the complete and clear signal.

i also attached the screenshot of the code.

 

suggestions are welcome...

thanks in advance.

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

One problem could be that you're casting your floats (doubles or singles) to integers (type unknown), and then to an I8. A 4 or 8 byte float won't fit in an I8, so you'll loose 1/4th or 1/8th of your data. We can't see this from an image.

 

Try to cast the array of floats to an array of bytes (without the for loop).

 

It would be easier to spot problems if the code is clean. Bugs hide in messy code. 'Highlight' of the mess is the init array wire going to the right, then up, to the left, and down again. Can't imagine this works well for you, imagine how it is for us, seeing this for the first time...

0 Kudos
Message 2 of 5
(2,837 Views)

thanks for your reply,

i convert dbl to fxp and than to i8.

i attached the snippet of this code. please see this code and guide.what exactly the issue is ?

0 Kudos
Message 3 of 5
(2,828 Views)

@Aht22 wrote:

thanks for your reply,

i convert dbl to fxp and than to i8.


No, you're casting a dbl to a fxp, and then convert it to i8.

 

Put a probe on the dbls and fxps to see that the fxps don't have anything to do with the dbls. I was assuming you'd want to send the binary doubles, but if you want to send values with a range from -128 to +128 casting is the wrong tool. The fxps are not really needed, you can simply convert (not cast) the dbls to i8s.

0 Kudos
Message 4 of 5
(2,824 Views)

This is something new to me.  I just assumed all audio formats were formatted as integer numbers representing sample amplitude at that integer type - e.g., a byte for 8-bit encoding, a word for 16-bit encoding, etc...

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 5 of 5
(2,822 Views)