This is discrete cosine code taken from the net. I want to use it but didnt understand whats happening in this code, especially whole for loop Statements.

[A1, f] = wavread('A1.wav');

windowSize = 8192;

samplesHalf = windowSize / 2;

samplesQuarter = windowSize / 4;

samplesEighth = windowSize / 8;

funkyCompressed2 = [];

funkyCompressed4 = [];

funkyCompressed8 = [];

for i=1:windowSize:length(A1)-windowSize

windowDCT = dct(A1(i:i+windowSize-1))

funkyCompressed2(i:i+windowSize-1) = idct(windowDCT(1:samplesHalf), windowSize);

funkyCompressed4(i:i+windowSize-1) = idct(windowDCT(1:samplesQuarter), windowSize);

funkyCompressed8(i:i+windowSize-1) = idct(windowDCT(1:samplesEighth), windowSize);

end

Similar questions and discussions