[data fs]=wavread('os1.wav');
for i=1:size(data,1)/256
block(:,i)=data((i-1)*256+1:i*256,1);
end
for i=1:size(data,1)/256
enerjy(i)=sum(block(:,i).^2)/256;
end
for i=1:size(data,1)/256
temp=block(:,i);
counter=0;
for j=1:255
if temp(j)*temp(j+1)<0
counter=counter+1;
end
end
zc(i)=counter;
end
|