0
$\begingroup$

From audio file [y,FS]=something.wav

So the y is typically N cross 2 matrix

I want calculate energy so i.e sum(abs(y.^2))

So when I apply these I end with two answer for each column. So I want only one energy for whole signal what to do???

$\endgroup$
  • $\begingroup$ Hi Rohith, what don't you act to your previous questions? You've got answers? Please clarify them before asking a new one. $\endgroup$ – Fat32 May 25 at 10:53
  • $\begingroup$ Sounds like a stereo sound file to me. $\endgroup$ – robert bristow-johnson May 25 at 15:40
  • $\begingroup$ @robert : Sounds like you are binaural, aren't you? $\endgroup$ – Laurent Duval May 25 at 16:12
1
$\begingroup$

That really depends on what you need to use the energy for and how exactly you define "energy" in your application.

You can either take the sum of the energies or do a more advanced mode taking into account the inter-channel correlation and the spectral correlation of stereo playback. If you want anything like "physical" energy, you need a calibration.

| improve this answer | |
$\endgroup$
0
$\begingroup$

If you have two channels after reading a file then you probably have a stereo audio file. If both signals are similar then you can delete one of the channels:

x = x(:,1)

If both channels are important then it depends on what you want to do. You can sum both values and obtain the total energy

sum(sum(x.^2))

or calculate average

mean(sum(x.^2))

RMS = sqrt(mean(x.^2))

| improve this answer | |
$\endgroup$
  • $\begingroup$ you shouldn't delete either channel. you should just add their energies before the sqrt() $\endgroup$ – robert bristow-johnson May 25 at 23:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.