Dithering audio before quantization

조회 수: 7 (최근 30일)
walzer91
walzer91 2013년 12월 6일
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개)

카테고리

Help CenterFile Exchange에서 Audio and Video Data에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by