Encoding the signal with 16 bits

I have a sound wave
I have a code
[f,Fs] = wavread('wolf.wav');
sound(f, Fs);
please tell how to encode the soundwave by 16 bits

Respuestas (1)

Wayne King
Wayne King el 13 de Sept. de 2012
Editada: Wayne King el 13 de Sept. de 2012
Have you tried using the 'native' option when you read the data.
[f,Fs] = wavread('wolf.wav','native');
class(f)

7 comentarios

Pat
Pat el 13 de Sept. de 2012
Thanks Wayne i Tried
[y, fs, nbits]=wavread('wolf.wav');
y0=y*(2^nbits/2)+(2^nbits/2);
but i get class as double ,can u tell where i made mistake plz
Wayne King
Wayne King el 13 de Sept. de 2012
Did you try using the 'native' option as I suggested? See my example.
Pat
Pat el 13 de Sept. de 2012
Editada: Pat el 13 de Sept. de 2012
As per your code the class is int16
[f,Fs] = wavread('wolf.wav','native');
class(f)
i tried by
[f1,Fs1] = wavread('wolf.wav');
y0=f1*32768 ,i get the same values
the minimum and maximum values are same for y0 and f
but the class is different ,i get class as double
i tried this code because i need for 14bit also ,
please help
y0 = int16(f1 * 32768);
Pat
Pat el 14 de Sept. de 2012
Thanks walter,for decomposing a soundwave wave by dwt haar wavelet i tried
[c,l] = wavedec(f,1,'Haar');f is my sound signal,is it correct
Walter Roberson
Walter Roberson el 14 de Sept. de 2012
I am not familiar with the wavelet functions.
Pat
Pat el 15 de Sept. de 2012
ok walter Thanks

Iniciar sesión para comentar.

Categorías

Más información sobre Discrete Multiresolution Analysis en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

Pat
el 13 de Sept. de 2012

Community Treasure Hunt

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

Start Hunting!

Translated by