0
$\begingroup$

I have a question about calculating the power and Energy of an audio recording.

I have imported a waveform of an audio recording in WAV format into Matlab and then calculated the energy and power in the time and frequency domain. Using Parseval's theorem, the energy in time and frequency is the same.

 clear all; close all;

 %Wav File einlesen und die Daten in data und Abtastrate in Fs
 [data,Fs]=audioread('120A_v20_05s.wav');  %Ermittlung der Arraygröße
 [nSamples,nChannels]=size(data); %Länge der Audiodatei ermitteln
 waveFileLength=nSamples/Fs;


 t=[0:length(data)-1] / Fs;


 %Signal darstellen figure 
 plot(t,data) 
 ylim([-0.3 0.3]) 
 title('120A v20') 
 grid on xlabel('Zeit')
 label('X(t)')


 E1_timedomain=sum(abs(data.^2)); % Energy time domain

 L=length(data);
 Ptime=(norm(data)^2)/L;  % Power time domain

 y = fft(data);

 Pfrequ=sum(y.*conj(y))/(L^2); %Compute power with proper scaling.
 E1_frequdomain=sum(abs(y.^2))/nSamples; % Energy frequency domain

enter image description here

E1_timedomain = 4.003 Ptime = 1.8154e-04

My question is which units have the energy and power in this case? Joule and Watts or do I have to consider a factor?

Many Thanks! Greetings Mathias

$\endgroup$
2
$\begingroup$

In principal, you get $\text{Ws}=\text{J}$ for energy and $\text{W}$ for power, but as you are calculating these measures from a wav-file, you do not get any unit. What you get is just a ratio to the maximum possible value of a wav-file. A square wave with amplitude one has a level (power) of $0\text{ dBFs}$, which means dB Fullscale. Your signal has roughly $-75\text{ dBFs}$, so that would be a valid result. If you want to get a result in actual physical units, you will need to know several things:

  • the sensitivity of the sensor (e.g. a microphone), that was used for audio recording. This is usually given in $\text{dBV/Pa}$
  • the calibration of the A/D converter used, usually given in form of the overload point in $\text{dBV}$, meaning that a sine wave with this level just drives the ADC to fullscale ($0\text{ dBFs}$), any increasing of the voltage leading to clipping.

With this information, you could calculate back the real power the actual sound event had at the point of the microphone.

$\endgroup$

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.