Vous êtes sur la page 1sur 26

APPLICATION NOTE

Time weightings in acoustics


Implementation in the real-time part of the
dBFA software suite

May 2008 version


TABLE OF CONTENTS

Operating principle of time weightings ............................................................................................................... 3

Behaviour of the RC circuit for periodic signals ................................................................................................ 5

Behaviour of the RC circuit for transient states................................................................................................. 9

Impulse response of a system and convolution product................................................................................... 14

Digital filtering .................................................................................................................................................... 18

Standardisation of time constants...................................................................................................................... 20

Implementation of Fast and Slow time constants in the dBFA software suite............................................... 21

Example of results ............................................................................................................................................... 24


Operating principle of time weightings

The purpose of time weightings, which are also called time constants, was initially to
facilitate the reading of sound pressure levels on measuring instruments like sound
level meters. Sound pressure levels do indeed usually fluctuate and it can be difficult
to follow the motion of an analogue or a digital level meter.

Overload
detector
Microphone

Frequency
weightings RMS detector Display in
Preamplifier Amplifier dB
(A, B, C) Pa

1/1 or 1/3 Time


octave filters constant
(Fast, Slow)

Figure 1: Block diagram of a sound level meter

In a sound level meter, the time constant principle resides in the red ellipse on the
above diagram. Time weightings are based on the principle of a RC (resistor
condenser) electric circuit.

Figure 2: Scheme of a RC circuit

An input voltage called Vin, which is usually proportional to the square of the voltage
originated from the microphone, i.e., to the square of the sound pressure (Pa), is
applied to a 2-terminal circuit made of a resistor (R) and a condenser (C). The output
voltage Vc (that to be displayed) is read at the terminals of the condenser. A
logarithmic operation is applied to this voltage to get the value in decibels, according
to the following formula:

May 2008 version - page 3 / 26


p Vc
Equation 1: Lp(dB) = 10 log 10( ) = 10 log10 ( )
p0 V0
Where Lp is the pressure level in dB; p is the sound pressure in Pa (Pascal); p0 is the
reference sound pressure (20 Pa) and V0 is the reference voltage (Volt).

The reference voltage V0 is related to the sound pressure through the microphone
sensitivity S, which is expressed in mV/Pa, with formula:

Equation 2: V0 = S p 0

In a sound level meter, when the signal that is proportional to the sound pressure is
periodic, e.g., sinusoidal, its square is also periodic.

t
t

Figure 3: Sinusoidal signal and its square

May 2008 version - page 4 / 26


Behaviour of the RC circuit for periodic signals

This circuit is of interest for time-variable voltages only since the current going
through the condenser depends on the tension variation only. We shall consider here
that the voltage variation is a sinusoidal function with an pulse (or frequency f with
=2f; or period T with T=1/f=2/ ).

Vin

Figure 4: Time signal of the sinusoidal function with period T

The same current goes through the resistor and the condenser. The following
relations can be easily derived from electricity laws:
I
Equation 3: Vin = RI +
jC
I
Equation 4: Vc =
jC

From Equation 4, we can derive Equation 5:

Equation 5: I = jC Vc

which, introduced in Equation 3, yields:

Equation 6: Vin = jRC Vc + Vc

Since our purpose is to define output voltage Vc from input voltage Vin, we get
Equation 7:

1
Equation 7: Vc = Vin( )
1 + jRC

May 2008 version - page 5 / 26


It appears that the output voltage will be different if the pulse or the frequency of the
input voltage varies. We shall use the frequency response function (response curve)
to represent this behaviour.

The frequency response function (FRF) of the RC circuit is a complex function (the
impedance of the condenser is a complex function). It represents the response curve
as the amplitude and the phase of the circuit under study, i.e., the ratio of the output
voltage Vc to the input voltage Vin versus frequency.

Vc 1
Equation 8: =
Vin 1 + jRC

Any complex function is represented with a modulus and a phase.


1
Equation 9: FRF modulus =
1 + (RC)
Equation 10: FRF phase = Arc tan g( RC )

The graphs below are an example of the representation for a 100k resistor and a
1F condenser:

10
0
-10
-20
Modulus (dB)

-30
-40
-50
-60
-70
-80
0.1 1 10 100 1000 10000

Frequency (Hz)

Figure 5: Modulus of the Frequency Response Function in dB

May 2008 version - page 6 / 26


0
-10
-20
-30
Phase ()

-40
-50
-60
-70
-80
-90
-100
0.1 1 10 100 1000 10000

Frequency (Hz)

Figure 6: Phase of the Frequency Response Function in degrees

The two graphs constitute the Bode diagram of the frequency response function. It is
to be noted that the representation of the modulus on a logarithmic frequency scale
regularly decreases toward higher frequencies. A -20 dB/decade slope (-6 dB/octave)
is then observed.

The phase tends to -90 (- /2) toward high frequencies. The output voltage Vc is late
by one phase quadrature with respect to the input voltage Vin.

The RC circuit acts then a low-pass filter (which lets lower frequencies through),
called a first-order filter.

The cut-off frequency of a filter is the frequency at which the output signal is reduced
by half in dB (-10log10(2), about -3 dB), i.e., its amplitude is reduced by a 2 factor
and drops to about 71% (1/ 2 ) of the amplitude of the input signal (and, at
equivalent current, the power is then reduced by a half).

In the case of a first-order filter (RC filter), i.e., of a filter made up of a resistor and a
condenser, the cut-off frequency can be expressed as follows:

1
Equation 11: Fc =
2RC

In the above example, the cut-off frequency Fc will be equal to 1.59 Hz and for this
frequency, voltage Vc will have a -/4 (-45) phase difference with respect to V in.

At high frequency, i.e., if >> 1/RC, the condenser has no time to charge and the
voltage at its terminals remains low.

Hence: VR Vin

May 2008 version - page 7 / 26


Vin
And the intensity in the circuit is then:
I
R
t t
1 1
Since Vc =
C
Idt , hence Vc =
0
RC
Vin dt .
0

The voltage at the condenser terminals integrates then the input voltage and the
circuit behaves like an integrating set-up for high frequencies.

At low frequency, i.e., if << 1/RC, the condenser has time for an almost
complete charge and:

Vc = Vin

Integrating circuit

Figure 7: Shape of input and output voltages for the RC circuit

The RC circuit behaves then as an integrating circuit. For a sinusoidal input signal,
the output signal will be a sinusoidal signal with the same frequency and with a
different phase.

Only sinusoidal voltages are taken into account to study the RC circuit. The
behaviour would be the same for random signals (e.g., white or pink noise),
assuming that they consist of an infinite number of frequencies.

May 2008 version - page 8 / 26


Behaviour of the RC circuit for transient states

For pulse signals, which by definition have large amplitude and a short period, one
can assume that the input voltage Vin has only two states (0 or Vin) for a better
understanding of the behaviour of the RC circuit.
V

Vin

0
0 t1
t (s)
Figure 8: Example of a pulse signal

At instant t = 0s, the condenser is initially discharged. At this moment, the input
voltage goes from 0 to Vin. Let I(t) be the current going through the circuit at instant t.
Electrons (negative electric charge) move in the opposite direction to I. They leave
the upper frame of the condenser, which then becomes positively charged, to go to
the lower frame, which becomes negatively charged. Let q(t) and Vc(t) be the charge
of the upper frame and the potential difference at the terminals of C, respectively (by
convention I, q, Vc, Vin are positive values).

+++++++

--------
-
Circulation of electrons e

Figure 9: The current and the electrons circulate in opposite directions

Using Ohms rule, one can write:


(See Eq. 3): Vin = RI + Vc

Knowing that q=CVc and that I=dq/dt (dq is the charge increase during dt), one can
define the first-order differential equation:

May 2008 version - page 9 / 26


dq q
Equation 12: Vin = R +
dt C
Or else:
dq
Equation 13: VinC = RC +q
dt

which can be expressed as

dq
Equation 14: VinC q = RC
dt

Or:
dt dq
Equation 15: =
RC VinC q

The primitive function (the function, the derivative of which is Equation 15) is then:

t For a function u, with a derivative u,


Equation 16: ln( VinC q) = u'
RC the primitive of function is
u
ln u + C
With ln, Napierian logarithm.

Let
t

Equation 17: VinC q = Ae RC

Constant A is provided by initial conditions: at t = 0, one had q = 0, hence A = VinC,


hence:
t

Equation 18: q( t ) = VinC(1 e RC )

Knowing that q = CVc, and using Equation 18:


t

Equation 19: Vc = Vin(1 e RC )

Again for a 100 k resistor and a 1 F condenser, the voltage Vc evolution curve is
represented below for a value of t1 = 2 s and an input voltage of Vin = 1 V.

May 2008 version - page 10 / 26


1,2

Vc 0,8

0,6

0,4

0,2

0
0 0,2 0,4 0,6 0,8 1 1,2 1,4 1,6 1,8 2
s

Figure 10: Evolution voltage Vc versus time

One can see on this curve that it takes some time for voltage Vc to reach its
maximum value, without reaching it entirely though. The charging time depends on
the RC product. This time is determined by time constant expressed in seconds:

Equation 20: = RC

In our example of a 100 k resistor and a 1F condenser, the time constant will be
equal to 0.1 s.
Upon charging, the time constant indicates the time required for condenser C to be
charged at 63% of the input voltage (in our example: 0.63 V). The charge current has
decreased by 63% after a time . When t = in Equation 19, the exponential term
becomes indeed e-1 (1/e with e = 2.718, hence e-1 = 0.37).
During the next time period, the condenser gets charged with 63% of the remaining
voltage value (0.37 x 63% = 0.2331 V, hence 0.63 + 0.2331 = 0.8631 V total), and so
on until voltage Vin, i.e., 1 V in our example.

In practice, one can assume that the condenser is fully charged after a time of 5 (0.5
s in the present example). The condenser having reached its limit charge of q0 = VinC
= VcC, the input voltage goes from Vin to 0 at t1. In order to make the next
explanations simpler, we shall consider that this operating phase is a new sequence.
The value of t1 is then equal to 0.
The current has then changed its direction: the electrons leave the lower frame to go
toward the upper frame; charge q(t) decreases in time.

May 2008 version - page 11 / 26


+++++++++

---------
-
Circulation of electrons e

Figure 11: The current and the electrons circulate in opposite directions

Still using convention that I, q, Vc are positive, Ohms rule can be written as:

Equation 21: RI = Vc

With q = VcC = VinC and I = dq/dt.

Since q decreases, dq / dt < 0, and the following equation can be written:

dq q
Equation 22: R =
dt C

i.e.,
dq dt
Equation 23: =
q RC

The primitive of Equation 23 leads to:

t
t
Equation 24: ln q = + cst q = Be RC
RC

Constant B is provided by initial conditions:

At t = 0, q = q0 = C Vin, hence B = C Vin and then


t

Equation 25: q = CVine RC

The condenser voltage Vc can be written taking into account initial conditions:
t

Equation 26: Vc = Vine RC

In the present example (100 k resistor and 1F condenser), the Vc voltage evolution
curve will be as shown in Figure 12 when voltage Vin goes from 1 V to 0 V.

May 2008 version - page 12 / 26


1,2

0,8
Vc

0,6

0,4

0,2

0
0 0,2 0,4 0,6 0,8 1 1,2 1,4 1,6 1,8 2
s

Figure 12: Evolution of Vc versus time during the condenser discharge

One can observe on this curve that it takes some time for voltage Vc to reach the
minimum value.
The discharge time depends on the RC product. Like for the charge, this time is
determined by the time constant of Equation 21, expressed in seconds.

In the present example (100 k resistor and 1F condenser), the time constant is
equal to 0.1 s.
During the discharge process, the time constant indicates the time required by
condenser C to discharge down to 63% of the initial voltage (i.e., 0.37 V in our
example). The discharge current has decreased by 63 % after a time period of .
During the next time period , the condenser gets discharged with 63% of the
remaining voltage (0.37 x 63% = 0.2331V, hence 0.37 0.2331 = 0.1369 V total),
and so on down to practically 0 V in the above example.
In practice, it is assumed that the condenser is fully discharged after a time period of
5 (0.5 s in the example).

Considering a series of short-time pulses, the behaviour of the RC circuit, or


integrating circuit, will be as shown in Figure 13.

Integrating circuit:

Figure 13: Behaviour of the RC circuit to a series of pulses

May 2008 version - page 13 / 26


Impulse response of a system and convolution product

A system is known thanks to its response (amplitude and phase) to all sinusoidal
excitations, regardless of the frequency. The pulse response of a system h(t), i.e., the
response to a Dirac pulse (t), allows then identifying the system and predicting the
response to any excitation.

The Dirac pulse, which is also called distribution and noted as (t), is the
mathematical modelling of a signal with infinite amplitude over an infinitely short
time at date 0 and obeying:

Equation 27: (t) dt = 1


It is represented as follows:

1
t

Figure 14: Graphic representation of the Dirac distribution

Value 1 on the y axis corresponds to the pulse area and not to its amplitude since it
is infinite. The amplitude is then represented with an arrow.

h(t) is then defined as the response to a Dirac pulse (see Fig. 15).

System
under
study

Figure 15: h(t) is the impulse response of the system under study

May 2008 version - page 14 / 26


In the case of the RC circuit (see Fig. 2), the impulse response h(t) can be calculated
as follows:

Let Vin be the input voltage and Vc the output voltage.

The previous equations (see Eqs. 12 and 13) show that the following differential
equation can be written:

dVc
Equation 28: RC + Vc = Vin
dt

Setting out Vin = (t), the impulse response of the RC circuit (solution of first-order
differential equation 28) is expressed as:

t
e RC
Equation 29: Vc ( t ) = h( t ) = y( t )
RC

With y(t) defined as the grade function: y(t)=1 if t 0 and y(t)=0 if t<0.

Figure 16: Impulse response of the RC circuit

One can easily derive that voltage Vc is the result of the convolution between the
input voltage Vin and the impulse response.

Equation 30: Vc ( t ) = h( t ) Vin ( t ) with : convolution product

More generally, the previous equation is expressed as a convolution integral:


+

Equation 31: Vc (t ) = V in (u).h(t u)du


May 2008 version - page 15 / 26


A geometric interpretation of the convolution product can be achieved, based on:

Time inversion

By expressing h(-u), Figure 16 becomes:

h(-u) h(-t)

ut

Figure 17

Time shift t

By expressing h(t-u), i.e., a delay, Figure 17 becomes:

h(t-u)

tu
0 t

Figure 18

Combining the previous two figures allows expressing the convolution product for an
input signal Vin as defined by Figure 8. The convolution calculation illustrated in
Figure 19 consists then in calculating the area of product Vin(u)h(t-u). The pulse
response h(t-u) is simply the initial pulse response h(u), reversed in time to give h(-u),
then translated by t.
By calculating then all areas obtained by shifting h, i.e., for all t shifts, one gets the
convolution product for any t, hence the output voltage Vc(t):

May 2008 version - page 16 / 26


Figure 19: Graphic illustration of the convolution product

The behaviour of the RC circuit in transient state is be easily recognised.

It is to be noted that the FOURIER transform of the impulse response will yield the
transfer function as expressed in Equation 8.

May 2008 version - page 17 / 26


Digital filtering

As shown above, the RC circuit behaves like a low-pass filter in the frequency
domain and like an integrating circuit with a time constant of =RC in the time
domain.
Most acoustic measurements are now performed by digital systems based on signal
sampling, i.e., that transform the continuous analogue signal in a series of signal
samples with variable amplitudes and recorded on a regular time basis (sampling
period Ts).

sampler
0 Ts 2Ts

Figure 20: The continuous input signal e(t) is transformed into a discrete digital signal e*(t)

The sampling frequency fs is then defined as fs=1/Ts.

Since the implementation of time weightings will be achieved digitally, one will then
need to characterise digital models for RC circuits.

Analogue filters (using passive R, L, C components and active components like


operating amplifiers) are designed for continuous signals. Digital filters deal with
magnitudes resulting from sampling and analogue to digital conversion. They play the
same role as analogue filters. These filter deal then with numbers. Digital filtering can
be achieved by a central processing unit or by a more specific circuit, such as a
digital signal processor (DSP).

A digital filter can be defined as an algorithm using 3 elementary operators:

 Addition (+)
 Multiplication (x)
 Time shifting

A digital filter is defined by a recurrence equation (or by its transfer function).

Input
Entre Output
Sortie
FILTER
FILTRE
xn yn

Figure 21: Digital filter

May 2008 version - page 18 / 26


The recurrence equation gives the expression for the output magnitude yn at time
t=nTs. The filter is called non recursive filter if the output depends only on the input
signal values. The algorithm is expressed as:
yn=f(xn,xn-1,...)

If the output depends on input signals and on the previous output values, the filter is
called recursive filter. The recurrence equation is expressed as follows:
yn=f(yn-1,yn-2,...,xn,xn-1,...)

To each sample of the input signal corresponds a sample of the output signal.

For the RC circuit, Equation 28 showed the following relation:

dVc( t )
RC + Vc( t ) = Vin( t )
dt

Sampling of the analogue input voltage Vin(t) allows getting numerical values at
instants nTs. When the sampling period Te is small, it is easy to approximate the
derivative of the output voltage Vc(t) with a finite difference:

dVc (t ) Vc Vc Vc ( nTs ) Vc (( n 1)Ts )


Equation 32: = =
dt T Ts Ts
Equation 28 then becomes:

Vc ( nTs Vc (( n 1)Ts )
Equation 33: Vin ( nTs ) = Vc ( nTs ) + RC
Ts

The following recurrence allows calculating the nth term of Vc knowing its (n-1)th term
and the nth term of Vin.

Equation 34:
RC Ts
Vc ( nTs ) = Vc (( n 1)Ts )( )+( )Vin ( nTs )
Ts + RC Ts + RC

RC
Setting out = , V ( nT ) = yn and Vin ( nTs ) = xn , Equation 34 becomes:
Ts + RC c s

Equation 35: yn = yn1 + (1 )xn

Equation 35 defines the recurrence equation of the integrating circuit (low-pass filter)
and will be implemented into the dBFA software suite. It is to be noted that constant
depends on the desired time constant and on the signal sampling frequency. This
equation is equivalent to a sliding exponential average and will allow respecting the
characteristics (frequency response function, time constant, pulse response, etc.) of
the RC circuit behaviour, as explained previously.

May 2008 version - page 19 / 26


Standardisation of time constants

In Standard IEC 61672-1 relative to sound level meter specifications, nominal time
constants are equal to 0.125 s for the F (Fast) time weighting and 1 s for the S (Slow)
time weighting.
For time weighted sound pressure levels, the decay time constant is specified based
on the response to the sudden removal of a 4 kHz permanent sinusoidal electrical
input signal. Further to this deletion, the decay rate for the displayed sound pressure
level, plus the extended measurement uncertainty, must be at least 25 dB/s for the F
time weighting and must range from 3.4 dB/s to 5.3 dB/s for the S time weighting.
This prescription applies to all calibres.

Many sound level meters available on the market also include time constant I
(Impulse), which is equal to 35 ms. The standard mentions that different
investigations have concluded that the I time weighting was not convenient to assess
impulse sounds noise with respect to their loudness. Also, this weighting is suitable
neither to assess the risk of hearing loss nor to determine the impulsive character of
a sound. Because of possible erroneous results, using the I time weighting is not
recommended.

This time weighting is therefore not implemented in the real time part of the dBFA
software suite.

May 2008 version - page 20 / 26


Implementation of Fast and Slow time constants in the dBFA
software suite

Equation 35 shows the recursivity principle of the RC circuit by using coefficient ,


which depends on the desired time constant and on the sampling frequency.

Taking a sampling frequency fs equal to 51200 Hz, constants and 1- of


Equation 35 become:

Time constant 1-
RC = = 125 ms 0.999843774 1.56225589e-4
RC = = 1s 0.999980469 1.95308685e-5

Table 1: Values of the constants of the recurrence equation

The sound pressure level can be calculated using the real-time processing called
Leq, as shown in the figure below.

Figure 22: Parameters of the Leq processing in the dBRTA software

9 processings are available in the real time part of dBRTA, among which the linear
average Leq.

Figure 23: List of calculations available for the Leq processing


For processings using a Fast or Slow time constant, with a signal sampled at, e.g.,
51200 Hz, a 100 ms time step means that 5120 samples (xi with i = 1 5120) are
used to yield a result.

May 2008 version - page 21 / 26


Figure 24: Time block of 5120 points
This time block is subjected to the following calculation:
1. Each sample is squared (xi). The result corresponds to the instant energy of
the signal at each sampling step.

Figure 25: Evolution of the energy of the 5120-point time block

2. All energy values are then processed according to the recurrence equation
(Eq. 35): y i = y i 1 + (1 )x i . 5120 weighted values are thus obtained.

May 2008 version - page 22 / 26


Figure 26: Evolution of the weighted energy of the 5120 points with a Fast time constant

3. For each time weighting, there are 4 processing variants:


o Inst corresponds to the 5120th weighted value
o Leq corresponds to the energy average of the 5120 weighted values
o Max corresponds to the maximum value of the 5120 weighted values
o Min corresponds to the minimum value of the 5120 weighted values

4. For the next 100-ms time block, the value of the previous block obtained in
step 3, is stored in the memory and integrated in step 2 as the 1st value of the
new time block. There are then 5121 values, and so on.

The time step (ms) corresponds to the time elapsed between the storage of two
results. It is characteristic of the period over which the calculation is performed.
The step number (#) is the number of results recorded at the end of the analysis.
When its value is zero, the processing can only be stopped manually.

May 2008 version - page 23 / 26


Example of results

The signal presented below corresponds to one of the test signals used by Standard
IEC 61672-1. It is composed of bursts of 4 sinusoidal periods of 4 kHz, lasting 1 ms
and at 1 s intervals.

Envelop [ID=4] Ch. 1 - Record s;Pa 0 0.141 0 0.141


0.15
0.10
0.05
0.00
-0.05
-0.10
-0.15
0 5 10 15 20 25 30 35 40 45 50 55
[ID=4] Ch. 1 - Record s;Pa0.0189453 -8.145e-030.0199609 -5.253e-03
0.15

0.10

0.05

0.00

-0.05

-0.10

-0.15
0.0185 0.0190 0.0195 0.0200 0.0205 0.0210

Figure 27: The entire signal and a zoom on a burst

FastLeq and SlowLeq calculations using the A time weighting are performed on
this signal with a 10-ms step. The result is plotted below.

May 2008 version - page 24 / 26


Envelop [ID=15] Ch. 5 - Enregistrement - Leq s;dB(A) [2.000e-05 Pa] 0 16.5 59.74 24.6

50

40

30

20

10

0 5 10 15 20 25 30 35 40 45 50 55
Envelop [ID=16] Ch. 5 - Enregistrement - Leq s;dB(A) [2.000e-05 Pa] 0 8.0 59.74 42.7

40

30

20

10

0 5 10 15 20 25 30 35 40 45 50 55

Figure 28: The entire FastLeq calculation (top) and SlowLeq calculation (bottom)

Zooming in on a calculated burst precisely shows the decays of time weightings.


0 5 10 15 20 25 30 35 40 45 50 55
[ID=15] Ch. 5 - Enregistrement - Leq s;dB(A) [2.000e-05 Pa] 11.8 53.4 12.2 39.9

55
50
45
40
35
30
25
20
15
10
5
0
-5

11.6 11.8 12.0 12.2 12.4 12.6 12.8 13.0 13.2 13.4 13.6

Figure 29: Zoom in on the FastLeq calculation

One can easily note a 13.5 dB attenuation for the Fast time constant over a 40-ms
time period, hence 34 dB/s, i.e., compliant with the standard (> 25 dB/s).

May 2008 version - page 25 / 26


0 5 10 15 20 25 30 35 40 45 50 55
[ID=16] Ch. 5 - Enregistrement - Leq s;dB(A) [2.000e-05 Pa] 11.81 46.8 12.21 45.0

45
40
35
30
25
20
15
10
5
0
-5

11.4 11.6 11.8 12.0 12.2 12.4 12.6 12.8 13.0

Figure 30: Zoom in on the SlowLeq calculation

Again, for the Slow time constant, the attenuation is 1.8 dB for 400 ms, i.e., 4.5 dB/s,
which falls between 3.4 and 5.4 dB/s, in accordance with the standard.

Jacky Dumas, the 10th of may, Limonest

May 2008 version - page 26 / 26

Vous aimerez peut-être aussi