1

I would like to develop an android app to meassure sound pressure level but i am not sure how to implement time weighting. For the moment my algorithm works as follows:

  1. Record 20ms of audio (160 samples @ 8000Hz)
  2. Compute RMS
  3. Calculate SPL
  4. Update displayed value and start again

Here you can see the main part of the algorithm:

// The Google ASR input requirements state that audio input sensitivity
// should be set such that 90 dB SPL at 1000 Hz yields RMS of 2500 for
// 16-bit samples, i.e. 20 * log_10(2500 / mGain) = 90.

double Gain = 2500.0 / Math.pow(10.0, 90.0 / 20.0);


// This method is called every 20ms:
@Override
public void processAudioFrame(short[] audioFrame) {

  // Compute the RMS value.
  double rms = 0;
  for (int i = 0; i < audioFrame.length; i++) {
    rms += audioFrame[i]*audioFrame[i];
  }
  rms = Math.sqrt(rms/audioFrame.length);

  final double rmsdB = 20.0 * Math.log10(rms / Gain) + refSPL;
  // refSPL is obtained by calibration with a professional spl meter
}

I know that the grade of sound level meter can be Fast, Slow, or Impulse time weighted. But i am not sure how and where to implement this time weighting in my algorithm.

Q: Does time weighting means after which time i update the meassured dB value?

Q: Should i simply change the update interval to 125ms to get a fast weighted result or am i completly wrong?

Thanks for your support

beleza_pura
  • 63
  • 1
  • 6

1 Answers1

0

When sound level meters were first created, as with most instruments, digital technology was not readily available and readings were presented to the user via analogue displays. In the case of sound meters this was a needle that moved back and forth across a scale to give a reading. Therefore, these time weightings just provide "meter ballistic" as discussed in this comment. A major issue soon came to light with these needles due to different manufacturers producing them to different specifications. As noise very rarely stays at a constant level, the needle was always in a constant state of motion. Longer and shorter needs would react at different speeds to the same amount of sound producing different results.

A set of standards known as Time Weightings were created. These weighting specified the speed at which the needle had to move. This ensured that different sound meters could be calibrated to these weightings making measurements comparable with each other.

As such, fast and slow time weighting correspond to (in digital domain) an equivalent low pass filter with a time constant $\tau = RC$. How this is a low pass filter ans why it is needed is discussed here.