How do I convert a .wav file, to generate a binary bit stream?

8 views (last 30 days)
I have used wavread to get the .wav file, then I have used quantiz to quantize the data. Now, what do i do to generate a binary bit stream out of it?
  3 Comments
Lorenzo
Lorenzo on 22 Aug 2014
Geoff - What I want to do is to generate the binary representation (1,0) of a wav file. As I have said, I have used the quantiz function, then de2bi and lastly, the reshape function to generate the binary data. But I am not sure that what I have generated is the proper binary representation of the wav file.
Geoff Hayes
Geoff Hayes on 22 Aug 2014
Lorenzo - I'm guessing that since you are using de2bi you have converted all wav data to positive integers? (Before or after the quantization?) I don't have the Communications System Toolbox but based on the documentation at de2bi, this function converts a nonnegative decimal integer d to a binary row vector. Note in the examples how the binary number is read left to right rather than the right to left. So 2 is 0 1 0 0 0 0 and not 0 0 0 0 1 0 (unless you use the flag 'left-msb').
What is the purpose of the reshape? And even the purpose of the conversion to binary? Is this a steganography application?

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!