This is discrete cosine transform code taken from net , i want to use it but didnt understand what happening in this code specially whole for loop Statements ?

10 views (last 30 days)
[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

Answers (0)

Categories

Find more on Elementary Math in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!