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

Antworten (1)

Wayne King
Wayne King am 13 Sep. 2012
Bearbeitet: Wayne King am 13 Sep. 2012

0 Stimmen

Have you tried using the 'native' option when you read the data.
[f,Fs] = wavread('wolf.wav','native');
class(f)

7 Kommentare

Pat
Pat am 13 Sep. 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 am 13 Sep. 2012
Did you try using the 'native' option as I suggested? See my example.
Pat
Pat am 13 Sep. 2012
Bearbeitet: Pat am 13 Sep. 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 am 14 Sep. 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 am 14 Sep. 2012
I am not familiar with the wavelet functions.
Pat
Pat am 15 Sep. 2012
ok walter Thanks

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Discrete Multiresolution Analysis finden Sie in Hilfe-Center und File Exchange

Tags

Gefragt:

Pat
am 13 Sep. 2012

Community Treasure Hunt

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

Start Hunting!

Translated by