Speech Level Meter DSP C Code
implements the ITU P.56 Speech Level Meter function (Method B). The P.56
function is intended primarily for speech level measurement. Over a time
interval, the algorithm obtains the active level of an irregular signal
such as speech by discerning and measuring in only the active signal periods.
In parallel, the long-term level is measured as the true RMS value of
the signal overall, irrespective of active and inactive signal periods.
A further result given by the process is the activity factor, that is
the proportion of the total active signal period to the total measurement
The C code is suitable for
any processor with an ANSI-compliant C compiler. It is designed especially
for efficient operation on low-cost fixed-point DSP- and general-purpose
micro-processors. All data memory is specified as 16-bit integer words.
Multiplies are integer 16x16-bit with 32-bit products.
The software is in the form of three
callable subroutines: one is for initialisation where a user-set measurement
time in samples is input, one is for processing of each new sample, and
one is for computing the results. If required, the results routine can
be called at any time prior to the expiry of the set measurement time.
Otherwise, the results are calculated automatically at the end of the
set time. Further calls of the main per-sample routine cause the process
to be repeated. The sample rate can be 8kHz, 9.6kHz, or 16kHz.
The user is responsible for sample
input and for accepting the three results: long-term level, active level,
and activity factor. The software can be operated in a multi-channel mode:
a pointer is set to each per-channel block of memory at each sub-routine
call. By making multiple sub-routine calls, the code can be operated on
blocks of samples. The code is load-balanced so that, except when the
results are computed, there is no MIPS variation per sample. A comprehensive
user's guide is provided with the code.
74 hours (8ksam/s) in sample periods
in level measurement, 0.1% in activity factor
*activity-related results accuracies are subject to the P.56 measurement
#example figures from compiling for the TI TMS320C5000(C55x) DSP processor;
at 8kHz sample rate
NOW - sale is under licence - integration support offered