# 1/3 Octave Analysis

Good Morning!

I am new in signal processing and I am trying to do a work in noise control of an electronic steering lock device (ESL). My aim is to calculate the loudness (Zwicker Method- ISO 532 B) of this device. To do so, first I need to obtain the 1/3 octave spectrum of a time signal that I measure with a microphone. The problem is I keep getting negative values in $\textrm{dB}$ for the 1/3 Octave bands after filtering the signal in the time domain to obtain the spectrum. I will explain here the procedure I have used and hope that anyone sees what I am doing wrong. Thanks in advance.

I have done the following procedure by now:

1. Sampled the noise signal (impulsive noise) by using a microphone and a data logger (to record the data), which has a sample frequency of $50\textrm{ kHz}$. Then, after this step I have a Curve that it is Amplitude ($\textrm{dBA}$) vs. time ($\textrm{s}$), as shown below. Once the ($\textrm{dBA}$) value of a sound level meter is calculated by: $$10\log_{10}\left( \dfrac{p^2}{p_0^2} \right)$$ where $p_0$ is $2\cdot 10^{-6}\textrm{ Pa}$. I am able to evaluate the pressure variation ($\textrm{ Pa}$) vs. time and use it as INPUT of the 1/3 Octave filters.

2. I get the vector INPUT (with $250000$ points of pressure ($\textrm{ Pa}$)-measurements of $5\textrm{ s}$) and use a function in MATLAB, in order to filter the signal in each each 1/3 octave band.

3. Then, the program calculates the RMS value of the OUTPUT (after filtering). And this is the value that represents each frequency band.

4. Finally, I use the same expression used before to calculate the Magnitude in $\textrm{ dB}$ for each 1/3 Octave band. $10\log_{10}\left( \dfrac{p^2}{p_0^2} \right)$, where $p_0$ is $2\cdot 10^{-6}\textrm{ Pa}$.

The thing is the obtained 1/3 Octave is lower then $0\textrm{ dB}$ and this doesn't make sense once I can hear the noise when I run the device, moreover it doesn't make sense to calculate the loudness following the ISO 532 B if we have negative third octave bands. It seems like the pressure that I have in time domain that is higher then the reference pressure somehow is attenuated and gets lower than the reference pressure after filtering.

Does anybody know what I am doing wrong?

• Looks like your filter outputs are in dBFS so the readings do make sense. I'm not familiar enough with the Zwicker process to say whether it's correct or not. Commented May 27, 2014 at 10:03
• Thanks man for replying. So, what should i do to get the output in dB? What you mean by dBFS? thanks again Commented May 27, 2014 at 10:18
• The most important thing is to have a proper scaling in dB scale. To what value in linear scale your $p_0$ corresponds to? System must be calibrated properly. Is it possible to include your dataset?
– jojeck
Commented May 27, 2014 at 13:12
• is your microphone and instrumentation mic? like from B&K? do you have transfer function data (including scaling) that converts sound pressure level (in Pa) to volts? then, do you know what the scaling is with the ADC and how this gets converted to MATLAB data? Commented Dec 19, 2015 at 5:43
• Don't confuse "dB" (relative unit) with "dBSPL" (absolute unit of sound pressure) or "dBFS" (absolute unit of digital level). Commented Jan 18, 2016 at 15:17

My guess would be that $p_0$ is a constant pressure, you shouldn't assume that it's spread out across all bins of your DFT. In fact, it's only going to contribute to the 0 Hz frequency component. If you look at the spectrum of a signal which has nothing but constant pressure, this should give you a benchmark you're looking for.

Obviously, since this is the entire energy of your idle signal, the the sum of square magnitudes of your spectrum should add up to $p_0^2$, but not every bin individually. In other words, it looks like your comparing energy of each bin separately to the energy of the entire baseline noise signal, so I would indeed expect things to go below 0 most places.

• thanks for replying . The problem is I don't get positive values in any frequency band. The whole spectrum is below 0 dB. Probably you are pretty busy but if you have some time could you take a quick look in the matlab code which I've used to get the 1/3 Octave Bands? could you give me your email or is there any other way for me to show you this file? It is really short it won't take long. thanks in advance Commented May 28, 2014 at 17:04
• @AlissonVieira Can you post a link to your code somewhere? And ideally, some data, too. Commented May 28, 2014 at 17:43
• Yep. Where do you want me to post? is it okay if i put in the dropbox and share the link here? the code isn't mine it is an open source that can be found in mathworks file exchange... I just did some modifications to fit with my data. @Phonon Commented May 28, 2014 at 18:16

this is John BG

http://www.auditory.org/mhonarc/2000/msg00498.html

[y,fs,nbits]=wavread(fname)


with

[y,fs]=audioread(fname)


nbits=8


nbits use the value you find convenient.

3.- Replace input signal file

In Hastings' app there's an default audio file called sin1000.wav

Remove it, copy paste your input file and rename it to sin1000.wav

4.- Run CallSound.m

The app is going to ask you for a reference level, again, the reference level is P0, in dB, not Pa