[x Fs] = wavread('akord_M1.wav');
sig=segment_signal(x,0.02*Fs,0.02*Fs);

f=0:500:4000;

B=4000/9;

subplot(2,1,1);
plot(x);

N=size(sig, 1);
out=zeros(N, 9);
spektrum=zeros(29, 81);
E=zeros(9, 1);

for ii=1:N,
    tmp = abs(fft(sig(ii, :)));
    spektrum=tmp(1:81);
    for jj=0:8,
        E(jj+1)=1/9*sum((spektrum(((jj*9)+1):(jj+1)*9)).^2);
    end
    out(ii, :)=E;
end


subplot(2, 1, 2)
imagesc(out');

