-1
$\begingroup$

For a project, I recorded the sounds of a boccee ball impacting with some ping pong balls in a container using Audacity. I also used a sound pressure level meter to record the maximum dB C that was produced from the impact. How do I analyse this data to find the energy in the sound wave.

$\endgroup$

3 Answers 3

0
$\begingroup$

I don't know if you can do this directly in Audacity. But you can process the signal to estimate what you want as follows.

  1. Compute the amplitude of the signal from the sound pressure level.

  2. Normalize your signal to have an amplitude according to the previous step.

  3. Compute the time integral of the square of your signal.

If you use SI units you should obtain a value in Joules.

$\endgroup$
0
$\begingroup$

Probably use some kind of reference sound. You can play a tone, and than use app for your mobile phone, to measure, how loud the sound is. How is app for your mobile phone calibrated is than another question. Another way would be, to have a simple tone generator and measure, how much power does it consume (eg. buzzer connected to 9V battery). Then you make approximation, that almost all energy is transferred to sound (not nessesery true). But then you must take into account some facts:

  1. Audacity measures amplitude of signal voltage as function of time. The correlation between voltage and air pressure is not necessary linear.
  2. Sound is produced as combination of signals with different frequencyes. Energy of waves depends on frequency. You can either make Fourier transform and integrate it as $\int E(\nu) d\nu$ or calculate energy numerically.
  3. Sensitivity of sensor (microphone) is generally function of frequency $\nu$. You have to compensate that.
  4. Distance between source(speaker) and microphone is important.

So, given nature of your project I would either connect small speaker on Arduino or buzzer to battery, measure current and voltage using multi-meter, and calculate power used, and say, that this is energy of sound waves. I would put microphone directly next to reference speaker/buzer and calibrate scale in audacity in units of pressure amplitude (can be calculated back from power used to drive speaker). Then I would found the lowest frequency of your sound (generally is the loudest) and assume, that you have only signal of that frequency, and calculate energy from frequency and pressure amplitude. I would ignore point 3.

BUT, If you are recording sound of balls it is likely, that you will find some shock waves (N-wave) or other weird-shaped sound-waves. In that case you would generally need to make Fourier transform numerically or make some kind of ugly approximation.

Probably check Google play for some app. There might be something which shows energy of sound, between all guitar tuners, "make physics laboratory from phone apps" etc...

Bear in mind that neither phone app or Audacity aren't calibrated. If you have some simple school project, potential app (decibel meter) should be ok, but If you want to know the real value of energy, you should calibrate your microphone somehow.

$\endgroup$
1
  • $\begingroup$ Sorry, I missed that you are already using dB meter. So calibrate your setup with it. But not with sound of balls, which will be wierd-shaped, but with sine wave. After that you have calibrated Auacity measurement. $\endgroup$
    – Vid
    May 4, 2021 at 22:35
0
$\begingroup$

As some other contributors have already stated, calculation of the energy would require some steps like those mentioned below.

  1. Calibrate your system.
  2. Integrate the squared sample amplitudes of your signal.

Now, I'm gonna break those steps down to provide some more insight on what each step achieves and show why we need to perform those actions. Please note here that I am going to omit a lot of technical details in an attempt to convey the information and stimulate the intuition behind the concepts.

1. Calibrate your system

First of all, let's make note that by "system" I mean the whole signal chain up to the signal's introduction to Audacity (or any other software for that purpose).

Now, in order to be able to say from your digital (dimensionless!!!) samples what the corresponding sound pressure (or sound pressure level) is you have to establish a correspondence between the two values. Let's take the chain from beginning to end and see what we have to do in each step.

$$p_{s} \xrightarrow{Acoustic-to-Electrical} V_{mic} \xrightarrow{Analogue-to-Digital Conversion (ADC)} A_{samp}$$

where $p_{s}$ is the sound pressure at the microphone diaphragm, $V_{mic}$ is the voltage at the output of the microphone (here assuming an analogue microphone) and $A_{samp}$ is the amplitude of the digital sample.

1.1 Acoustic-to-Electrical conversion

Initially, we must note that we assume linear operation of the system in all steps. This means that the conversion from the acoustical to the electrical domain is a linear conversion given by a function

$$ f \left( x \right) = \alpha x + \beta \tag{1}\label{1}$$

where $\alpha$ is the proportionality constant and $\beta$ is usually considered to be equal to zero, $\beta = 0$. It could very well be given a value close to the noise floor of the transducer (or the system) to provide for a lower possible value. The value of $x$ represents the sound pressure (linear value, not in dB) and $f \left( x \right)$ is the voltage output of the microphone.

In our case, $\alpha$ is given by the sensitivity of the microphone. Please note again that in our description we are gonna use an analogue microphone. The sensitivity values usually given in $\frac{mV}{Pa}$ most often lie in the range $\left[2, 50 \right]$ with the lower limits approached by dynamic microphones and the upper limits by well manufactured measurement microphones. So, equation \eqref{1} becomes for our purpose

$$ V_{out} = s_{mic} \cdot p_{s} \tag{2}\label{2}$$

with $s_{mic}$ being the microphone sensitivity.

The information provided above allows us to calculate the measured sound pressure (and convert that to sound pressure levels if we want) from the voltage output of the microphone. We will use a hypothetical microphone with sensitivity $30 \frac{mV}{Pa}$. So, for a microphone output voltage of $54.7 mV$ we calculate

$$ V_{out} = s_{mic} \cdot p_{s} \implies p_{s} = \frac{V_{out}}{s_{mic}} \implies p_{s} = \frac{54.7 mV}{30} \frac{Pa}{mV} \implies p_{s} \approx 1.823 Pa$$

You may know that electronics are designed to manipulate signals with higher voltage values (for good reason but this is out of the scope of this answer). Thus, most often than not, the microphone output has to be amplified in order to reach a "usable" range. This is the job of a pre-amplifier (even if you don't use one explicitly, many audio equipment have one integrated to condition the signal). The amplification of the pre-amplifier has to also be taken into account when performing the conversion. If a pre-amplifier with a constant gain of $12$ dB (chosen for simplicity) is used, which means a four-fold increase of the signal voltage values, then $V_{out}$ will change in equation \eqref{2}, so we have to include this change to the right-hand side of the same equation. Thus, we multiply with the same factor the right-hand side of equation \eqref{2}. We could very well incorporate this value in the sensitivity $s_{mic}$ but for clarity we won't. Thus, equation \eqref{2} becomes

$$ V_{out} = s_{mic} \cdot g_{amp} \cdot p_{s} \tag{3}\label{3}$$

where $g_{amp}$ is the pre-amplification gain. So, in our example, using the aforementioned pre-amplifier ($12$ dB gain) gives us

$$ V_{out} = s_{mic} \cdot g_{amp} \cdot p_{s} \implies p_{s} = \frac{V_{out}}{s_{mic} \cdot g_{amp}} \implies p_{s} = \frac{54.7 mV \cdot 4}{30 \frac{mV}{Pa} \cdot 4} \implies p_{s} \approx 1.823 Pa$$

which of course is the same number as it should. Please note that the voltage output is also multiplied by $4$ since a pre-amplifier is used.

1.2 Digitisation of the signal

After the signal is appropriately conditioned, you have to digitise it in order to manipulate it in the digital domain (Audacity in your case). In the simplest case, in PCM coding, a voltage range is chosen that will be digitised. Then, the amplitude resolution is specified by choosing the number of bits (since we are in the base $2$ numbering system) to be used. If, for example, $16$ bits are chosen (which is the CD resolution), then there will be $2^{16}$ available quantisation levels for the amplitude to use. The general formula is

$$ N_{l} = 2^{N_{bits}} \tag{4}\label{4}$$

where $N_{l}$ is the number of available levels and $N_{bits}$ is the number of bits used for the coding.

In the simplest, and most used case, the levels are linear in amplitude, meaning that the difference between them is constant. If the voltage range to be quantised is $V_{range}$, then the difference (in voltage) between two neighbouring levels, denoted $\delta V$ is given by

$$ \delta V = \frac{V_{range}}{2^{N_{bits}}} \tag{5}\label{5} $$

An example would be to quantise the range $\left[ -10 V, 10 V \right]$ with $16$ bits resolution. Using equation \eqref{5}, this would give

$$ \delta V = \frac{V_{max} - V_{min}}{2^{N_{bits}}} \implies \delta V = \frac{10 V - \left( -10 V \right)}{2^{16}} \implies \delta V = \frac{20 V}{65536} \implies \delta V \approx 305.18 \mu V$$

Note that the voltage range is calculated in its algebraic form (maximum value minus the minimum value).

We can now calculate the corresponding voltage value for each sample if we know the sample value. From equation \eqref{5} we can calculate the value increase based on the sample value. This is given by

$$ V_{out} = A_{samp} \cdot \delta V \tag{6}\label{6}$$

where $A_{samp}$ is the value of the sample in the range $\left[0, 2^{N_{bits}} - 1 \right]$.

Equation \eqref{6} will give us the voltage value corresponding to the sample value if the lower value of our range is $0$ V. Now that our range is not $0$ V we have to translate the whole range by the minimum of the range. This results in

$$ V_{out} = \left( A_{samp} \cdot \delta V \right) + V_{min} \tag{7}\label{7}$$

Assuming symmetric range, we can use the fact that $V_{min} = - \frac{1}{2} V_{range}$ and write equation \eqref{7} like

$$ V_{out} = \left( A_{samp} \cdot \delta V \right) - \frac{V_{range}}{2} \implies V_{out} = A_{samp} \cdot \frac{V_{range}}{2^{N_{bits}}} - \frac{V_{range}}{2} \implies \\ \implies V_{out} = V_{range} \left( \frac{A_{samp}}{2^{N_{bits}}} - \frac{1}{2} \right) \tag{8}\label{8}$$

where we have used equation \eqref{5} to expand $\delta V$. Note that the term in the parentheses is actually the sample amplitude value normalised and then $0.5$ is subtracted to bring it down by half the range (due to symmetry).

Let's do an example to make the process clear. Let's consider the case where a single sample has the value $49152$ (please note that this value is dimensionless). This "manufactured" value happens to be (on purpose of course) $\frac{3}{4}$ of the maximum value of the voltage range. Using equation \eqref{8} we can write

$$ V_{out} = V_{range} \left( \frac{A_{samp}}{2^{N_{bits}}} - \frac{1}{2} \right) \implies V_{out} = 20 V \left( \frac{49152}{2^{16}} - \frac{1}{2} \right) \implies V_{out} = 20 V \left( \frac{49152}{65536} - \frac{1}{2} \right) \implies V_{out} = 20 V \left( \frac{3}{4} - \frac{1}{2} \right) \implies V_{out} = 20 V \cdot \frac{1}{4} \implies V_{out} = 5 V$$

So, now we know that this sample value corresponds to a voltage value of $5$ V.

At this stage we have the voltage corresponding to the chosen sample value. From this we can use what we found in 1.1 Acoustic-to-Electrical Conversion to convert that back to sound pressure. We show that next.

1.3 Putting it all together

At this final stage, we can put all information we have so far together to calculate the sound pressure based on the value of a sample.

Utilising equation \eqref{3}, using equation \eqref{8} to represent $V_{out}$ and solving for $p_{s}$ we have

$$ p_{s} = \frac{V_{range} \left( \frac{A_{samp}}{2^{N_{bits}}} - \frac{1}{2} \right)}{s_{mic} \cdot g_{amp}} \tag{9}\label{9}$$

Now, using the values we have used so far we get for the sample used in 1.2 Digitisation of the Signal to find the corresponding sound pressure. The value of the analogue interface (microphone sensitivity and pre-amplifier gain are the same as above). So, with equation \eqref{9} we have

$$ p_{s} = \frac{V_{range} \left( \frac{A_{samp}}{2^{N_{bits}}} - \frac{1}{2} \right)}{s_{mic} \cdot g_{amp}} \implies p_{s} = \frac{20 V \left( \frac{49152}{2^{16}} - \frac{1}{2} \right)}{30 \frac{mV}{Pa} \cdot 4} \implies p_{s} = \frac{5 V \left( \frac{49152}{65536} - \frac{1}{2} \right)}{30 \frac{mV}{Pa}} \implies p_{s} = \frac{5 V \left( \frac{3}{4} - \frac{1}{2} \right)}{30 \frac{mV}{Pa}} \implies p_{s} = \frac{5 V \frac{1}{4}}{30 \frac{mV}{Pa}} \implies p_{s} = \frac{5}{4 \cdot 30} \cdot 10^{3} Pa \implies p_{s} \approx 41.67 Pa$$

which of course, if you want to convert it to SPL you can do

$$ SPL = 20 \log_{10} \left( \frac{41.67}{20 \cdot 10^{-6}} \right)\implies SPL \approx 126 dB_{SPL} ~~ re ~ 20 \mu Pa$$

2. Calculate energy

There's various references both online and in textbooks showing that the sound intensity of a point source (which may or may not be a good approximation of your source, but it's a rather good starting point) is given by

$$ I = \frac{p^{2}}{\rho c} \tag{10}\label{10}$$

where $\rho$ is the density of the medium, which for air is $\rho_{air} \approx 1.204 \frac{kg}{m^{3}}$ at $20 ^{o}C$ and $c$ the speed of sound usually taken to be $c \approx 343 \frac{m}{s}$ under "normal" conditions.

Since we know that intensity is the integral over area of the power which in turn is the time integral of energy, we can conclude (skipping proofs here) that energy is indeed proportional to intensity. As shown in equation \eqref{10}, intensity is proportional to the square of the sound pressure, so all you have to do is integrate the squared pressure of your signal. You can do this at any step of the aforementioned process as long as you take care of the calculations to be correct.

So, in order to calculate the energy of the recorded signal, all you have to do is integrate $p_{s}^{2}$ that you calculate from your samples. This would look like

$$ E_{s} = \sum_{n = 0}^{N - 1} p_{s}^{2}$$

with $n$ being the index of the sample (the index on the horizontal $x$ axis) and $N$ the number of samples. Please note that integration has been replaced with a sum since we have a finite amount of samples and not an analogue signal anymore.

Extra stuff

Since you mention that you have measured C-weighted values, before you perform the square-and-sum function you have to first reverse the weighting in order to acquire unweighted data. This is most easily done in the frequency domain where you can weight the magnitude of your signal with the inverse of the C filter.

Important Note

Please note that the resulting energy you will calculate will be an approximation (due to many other effects not taken into account) of the sound energy arriving at the position of the microphone diaphragm. In order to calculate the energy emitted by the source (whatever that may be), you would have to take many (infinitely many if you would like to be "mathematically" correct) measurements on a surface surrounding your source in order to get the energy in each and every (or as many as possible for practical applications) point on the surface and sum it up. A similar process is described in ISOs 3744, 3745 and 3746, where the specifications for Survey, Engineering and Precision sound power measurement methods are described. You could very well convert the measured power to energy from that.

$\endgroup$

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.