Dithering audio before quantization
4 views (last 30 days)
Show older comments
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 Comments
Answers (0)
See Also
Categories
Find more on Audio and Video Data in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!