Dithering audio before quantization
5 ビュー (過去 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!