How can represent a recorded speech signal(.wav format) as a binary matrix?

3 visualizaciones (últimos 30 días)
A audio(in wav format) is read to variable 'p' using wavread().The sample values p contain vary between -1 and +1.what i exactly need is a binary row matrix which represent that wav file as 0's and 1's.
And how can i convert that binary row matrix back to the same audio?

Respuesta aceptada

Walter Roberson
Walter Roberson el 22 de Feb. de 2017
[data, fs] = wavread(FileName, 'native');
Now your data is probably integers or convertible to integers. After that you use dec2bin() and transpose and reshape.
  10 comentarios
Walter Roberson
Walter Roberson el 28 de Feb. de 2017
If class(data) shows up as int16 rather than uint16, then
data_u16 = typecast(data, 'uint16');
row = reshape( (dec2bin(data_u16, 16) - '0').', 1, [] );
ANJANA KRISHNAN A
ANJANA KRISHNAN A el 28 de Feb. de 2017
restoring original values :
recovered16 = uint16( bin2dec( char( reshape(row, 16, []).' + '0' ) ) );
recovered = typecast(recovered16, class(data));

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Multichannel Audio Input and Output en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by