Sound quantization on matlab

Hello,
We need for a project at school , to use matlab to quantize a sound (.wav) , we searched on internet but found nothing about that , if someone know how to do that , it would be great
Thanks in advance

1 Kommentar

NITIN
NITIN am 30 Aug. 2022
load voice.mat
subplot(3,1,1);
[x,fs]=audioread('voice.wav');
info = audioinfo( 'voice.wav');
N=length(x);
T=2.9520;
t=linspace(0,T,N);
plot(t,x);
xlabel('time')
ylabel('x(t)')
y=abs(fftshift(fft(x)));
F=linspace(-fs/2,fs/2,N);
subplot(3,1,2);
plot(F,y);
xlabel('frequency')
ylabel('x(f)')
Xmax=max(x);
Xmin=min(x);
xd = Xmax - Xmin ;
L=4;
Delta =(xd/L);
q=(Xmin-Delta/2):Delta:(Xmax+Delta/2);
q=q(2:end-1);
DTV=zeros(1,L-1);
for i=1:(L-1)
DTV(i)=(q(i+1)+q(i))/2;
end
[i,Xq]=quantiz(x,DTV,q);
subplot(3,1,3);
plot(t,Xq);

Melden Sie sich an, um zu kommentieren.

Antworten (2)

Loïc Leb
Loïc Leb am 22 Jun. 2015

0 Stimmen

Thanks a lot , it worked with that , just a last question , do u know how to do non uniform quantization ?
Thanks for ur help

2 Kommentare

Annisaa Auliyaa Septianthy
Annisaa Auliyaa Septianthy am 22 Dez. 2017
Can I ask for the script u made? thx.
Walter Roberson
Walter Roberson am 22 Dez. 2017
quantiz does non-uniform quantization if the partitions are non-uniform.

Melden Sie sich an, um zu kommentieren.

Gefragt:

am 22 Jun. 2015

Kommentiert:

am 30 Aug. 2022

Community Treasure Hunt

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

Start Hunting!

Translated by