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???

  • $\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, 2020 at 10:53
  • $\begingroup$ Sounds like a stereo sound file to me. $\endgroup$ May 25, 2020 at 15:40
  • $\begingroup$ @robert : Sounds like you are binaural, aren't you? $\endgroup$ May 25, 2020 at 16:12

2 Answers 2


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.


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


or calculate average


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

  • $\begingroup$ you shouldn't delete either channel. you should just add their energies before the sqrt() $\endgroup$ May 25, 2020 at 23:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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