Dithering audio before quantization
10 次查看(过去 30 天)
显示 更早的评论
Hi everyone, my name's Walter and I'm Italian (sorry for my terrible English). I'm trying to solve an exercise my teacher gave me, but I found some problems. I have to write a matlab script that implements the audio dithering. The script receives as input a wav audio file (coded at 44.1kHz and 16 bit) and it has to be compressed at 2-3 bit! I have to show the difference between using a normal quantization and a quantization after dithering. I think I succeed in doing an easy version of quantization, but I have no idea how to apply the dithering. I made an easy version of quantization... can someone help me? I paste the code i wrote
function [fileQU,error]=quantizzazione(file,n_bit)
% Quantization function of a stereo file wav
% Normalization of the two tracks
fileQL = file(:,1)/max(abs(file(:,1)));
fileQR = file(:,2)/max(abs(file(:,2)));
% Quantization by rounding
fileQU(:,1)=round(fileQL*2^(n_bit-1))/(2^(n_bit-1));
fileQU(:,2)=round(fileQR*2^(n_bit-1))/(2^(n_bit-1));
error = file - fileQU;
end
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Audio and Video Data 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!