how to write a program in matlab for to identify the energy level in given speech signal

I wrote this program. is this correct...?
x=wavread('E:\project\kani imp\akk');
l=size(x)
s=1;
for t=[4000:4000:l]
sum=0;
for t1=[s:t]
sum=sum+abs(x.^2);
en=sum;
e=en+1;
end
end
y=length(e)
plot(y,e);

Answers (1)

I think you need to define for us what you mean by energy level
If you just mean the norm of the vector, the speech sample, then
norm(x)
gives you the 2-norm.
If you mean DC level, that is just:
mean(x)
or
xdft = fft(x);
1/length(x)*xdft(1)

Tags

Asked:

on 5 Nov 2012

Community Treasure Hunt

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

Start Hunting!