(Page 5 of 8 in this chapter)
5.4 Using the Energy Detector
AG boards are capable of running an energy detector which examines the inband signal, distinguishing between silence and energy. The energy detector generates the following events:
A
DIEVN_SILENCE_DETECTED
ADIEVN_ENERGY_DETECTED
ADIEVN_ENERGY_DETECT_DONE
You can manually start or stop the energy detector using these functions:
To...
Use ...
Start the energy detector
adiStartEnergyDetector
Stop the energy detector
adiStopEnergyDetector
5.4.1 Energy Detection Parameters
adiStartEnergyDetector
takes two qualification time parameter arguments:
energyqual
- The time in milliseconds in which energy must be present to report an energy event.
silencequal
- The time in milliseconds in which energy must not be present to report a silence event.
Additional energy detector parameter information is stored in the
ADI_ENERGY_PARMS
structure, which is defined in the
AG Access Function Reference Manual
.
You can modify the energy detector's default behavior by specifying the following arguments when invoking
adiStartEnergyDetector
:
thresholdampl
-The noise level in dBm, below which is considered silence. Noise above this level is further qualified as energy.
deglitch
-The minimum time in milliseconds before a transition between energy and silence is recognized.
autostop
- Controls whether the energy detector continues running after the first event. By default, automatic stop is enabled.
Figure 15
illustrates the energy detection parameters stored in
ADI_ENERGY_PARMS
:
Figure 15. Energy Detection Parameters
5.4.2 Terminating Energy Detection
The
adiStopEnergyDetector
function immediately terminates energy/silence detection. AG Access generates an
ADIEVN_ENERGYDETECT_DONE
event with the value set to
CTA_REASON_STOPPED
, which means that the operation was stopped by application request.
AG Access may also generate the
ADIEVN_ENERGYDETECT_DONE
event with an error code,
ADIERR_xxx
or
CTAERR_xxx
, or with the value set to
CTA_REASON_FINISHED
. When set to
autostop
(one-shot), the value is set to
CTA_REASON_FINISHED
and the
size
field contains either
ADIEVN_ENERGY_DETECTED
or
ADIEVN_SILENCE_DETECTED
.
(Page 5 of 8 in this chapter)
tech_support@nmss.com
Copyright © 1997, Natural MicroSystems, Inc. All rights reserved.