Any useful definition for power or energy in audio signals depends highly on context and application. While you can formally sum the squares of the samples and call it energy, the result isn't really useful for anything. It is NOT
- The energy delivered to the speakers
- The energy consumed by the amplifier
- Energy that the power supply needs to provide or that is drawn of the the wall outlet
- Acoustic energy radiated from the speaker
- Any measure on how loud it it.
All these are very different things and only loosely correlated. Without a specific goal of what you need "power" or "energy" for, it's difficult to properly define the term.
For example it's very easy to construct two signals, A and B, where A has twice the "energy" of B but is only half as loud as B.
Answer from Hilmar on Stack ExchangeAny useful definition for power or energy in audio signals depends highly on context and application. While you can formally sum the squares of the samples and call it energy, the result isn't really useful for anything. It is NOT
- The energy delivered to the speakers
- The energy consumed by the amplifier
- Energy that the power supply needs to provide or that is drawn of the the wall outlet
- Acoustic energy radiated from the speaker
- Any measure on how loud it it.
All these are very different things and only loosely correlated. Without a specific goal of what you need "power" or "energy" for, it's difficult to properly define the term.
For example it's very easy to construct two signals, A and B, where A has twice the "energy" of B but is only half as loud as B.
No, energy is not the same as power. Power is energy per unit of time. An analogy- energy is like distance, while power is like speed.
The easiest way to determine energy in the frequency domain is to take the signal and do an FFT. The Fourier Transform preserves energy, i.e. the transform has the same exact energy as the signal does in the time domain. You can then find the energy of each frequency bin by multiplying its value with its complex conjugate.
Signal power represents how quickly it delivers energy. In the context of audio it correlates with how loud the sound is, though there is not a 1-to-1 correspondence.
Videos
Any useful definition for power or energy in audio signals depends highly on context and application. While you can formally sum the squares of the samples and call it energy, the result isn't really useful for anything. It is NOT
- The energy delivered to the speakers
- The energy consumed by the amplifier
- Energy that the power supply needs to provide or that is drawn of the the wall outlet
- Acoustic energy radiated from the speaker
- Any measure on how loud it it.
All these are very different things and only loosely correlated. Without a specific goal of what you need "power" or "energy" for, it's difficult to properly define the term.
For example it's very easy to construct two signals, A and B, where A has twice the "energy" of B but is only half as loud as B.
Answer from Hilmar on Stack ExchangeThat 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
sum(sum(x.^2))
or calculate average
mean(sum(x.^2))
RMS = sqrt(mean(x.^2))
It seems to me that the energy carried by a sound wave should be proportional to frequency squared.
Why? What makes you think that this is the case ?
But in DSP they are all considered to have the same signal energy (integral of x(t) squared)
The concept of associating power or energy with a a digital signal is somewhat tricky. Digital signals are just a bunch of numbers so assigning actual physical properties to them doesn't really work unless you carefully define the context.
Mostly the concept is used assuming that the digital signal is an accurate representation of an analog signal that has actual physical properties. If this relationship is well defined and constant you can compare the sum-of-squares of two different digital signals and draw some conclusions on the energy difference of the actual analog situations. However, that really requires "all things being equal" and there are actually a lot of things that need to be equal for this to hold.
STEP 1: basic physics of power
Power, intensity or energy are typically defined or calculated as the product of two field quantities (not one). In electricity power is defined as the product of of voltage and current. Simple example: if your signals were defined as "voltage over a one Ohm resistor", than you can indeed calculate the power by summing the squares and it would be the same power for all of your three examples since the current is proportional to the voltage.
If it were the voltage over an ideal inductor or capacitor then the answer would be wrong. Average power over one of these would be zero in all cases. For an ideal inductor voltage and current are 90 degrees out of phase and the average power is therefore zero.
STEP 2: physics of sound
The two field quantities that make up a sound wave are sound pressure and particle velocity. First you need to define which one your digital signal actually represents. Most of the time it's pressure but many second order microphones (cardioid, dipoles) will create a signal that's proportional to the particle velocity. If you are far enough away from the sound source than pressure and velocity are in-phase and proportional to each other and the proportionality factor is the free field impedance of air (density times speed of sound). In this case you can actually calculate the intensity at the microphone position by simply squaring and scaling. If you are close to a sound source that doesn't work anymore and you actually need to measure both signals.
As others have said: per it's physical definition sound can't exist at 0 Hz. Sound pressure is a variation of pressure around a steady-state average and if there is no variation there is no sound.
Step 3: human perception
Sound energy and perceived loudness are only loosely related. Human perception is very dependent on frequency and its quite non-linear. Building good loudness models is quite difficult. Simple example: 1 Watt of sound at 1kHz radiated into a typical residential room would extremely loud and quite painful. At 50 kHz it would be utterly inaudible, even though it's the exact same amount of physical sound power.
your complete system, if you wanna consider your ear another microphone with it's own preamp is:
$\qquad \qquad x(t) \rightarrow$ loudspeaker $\rightarrow$ air $\rightarrow$ microphone
both the loudspeaker and microphone are transducers that convert between an electrical signal and an acoustic wave. as components, both of those devices have no gain (that is $-\infty$ dB) at DC. that is they're transfer function at DC is zero:
$$ H(j\omega) \Bigg|_{\omega=0} = 0 $$
$x(t) = \tfrac{1}{\sqrt{2}}$ is a purely DC signal. if you applied it to a resistor, energy would be transferred and dissipated in the resistor. but applied to a loudspeaker, all that does is move the piston away from its equilibrium position without wiggling it and generating an acoustic wavefront, which is what loudspeakers, as transducers, are supposed to do.