infile='she_is_aware'

spch=wavread( infile ); %extracts info on wav file, only need the array output

fs=11025;       %Sampling Rate in Hz
winlength=220;     %Window length in sampls (approx 20ms)
movewin=winlen/2;   %Number of smaples to move window

winstart=1;             %Start position of first window
winend =winlen;         %End Position of first window
endspeech = length(Y);   %Last speech position

wn=hamming(winlen);

index = 1;                      %Start indx of energy array
while(winend<endspeech)         %AvgEnergy = sum mag^2
    xn=spch(winstart:winend);   %Extract a section of speech
    yn=xn.*wn;                  %Multiply by hamming window
    energy(index)=sum(yn.^2);   %Sum of energy squared
    winstart=winstart+movewin;  %Move window
    winend=winstart+winlen-1;   %Preserve window length
    index=index+1;

end

for(index=1;index<=220;index++)
        X=sum(energy(index));

    end
        

E=mean(X, winlength )
