(8.D.1.2) STSoundDetect
Overview
ST Sound Detector module
Discussion
SoundDetector has the function of discriminating between stationary noise and sound. To do so, it has a noise estimator which tracks the slow changes of the noise. Two configurable thresholds (to allow hysteresis) are then used to decide the state flag value (active or inactive). A minimum noise power level can be adjusted in order to lower-limit the noise estimator. At last, an hangover period from active to inactive state is configurable, in order to avoid state toggling. This module intentionally uses simple estimator algorithms in order to provide a low MIPS solution. The current implementation internally uses 24 bits input format, mono signal only.
The minimum input frame is 96 and the maximum input frame is 480 stereo samples.
Type Definition
typedef struct _ModuleSTSoundDetect
{
ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure
INT32 nAPIResult; // Return status for last call into the ST API
INT32 LearningFrameNumber; // Learning Frame Number
INT32 enable; // Block enable
INT32 ratio_thr1_dB; // Inactive to active threshold in dB
INT32 ratio_thr2_dB; // Active to Inactive threshold in dB
INT32 noise_pwr_min_dB; // Minimum power noise value dBFS
INT32 hangover_nb_frame; // Number of frames of hangover
INT32 output_state; //
INT32 output_nrj; //
INT32 output_noise_pwr; //
INT32 output_thr1; //
INT32 output_thr2; //
void * pGlobals; // Points to the global variables structure
} ModuleSTSoundDetectClass;
Variables
Properties
Name | Type | Usage | isHidden | Default value | Range | Units |
nAPIResult | int | state | 0 | 1 | Unrestricted | Â |
LearningFrameNumber | int | const | 0 | 4 | Unrestricted | Â |
enable | int | parameter | 0 | 1 | 0:1:1 | Â |
ratio_thr1_dB | int | parameter | 0 | 9 | 1:1:40 | dB |
ratio_thr2_dB | int | parameter | 0 | 7 | 1:1:40 | dB |
noise_pwr_min_dB | int | parameter | 0 | -60 | -87:1:0 | dB |
hangover_nb_frame | int | parameter | 0 | 20 | 1:1:40 | Â |
output_state | int | state | 0 | 0 | Unrestricted | Â |
output_nrj | int | state | 0 | 0 | Unrestricted | Â |
output_noise_pwr | int | state | 0 | 0 | Unrestricted | Â |
output_thr1 | int | state | 0 | 0 | Unrestricted | Â |
output_thr2 | int | state | 0 | 0 | Unrestricted | Â |
pGlobals | void * | const | 1 | Â | Unrestricted | Â |
Pins
Input Pins
Name: in
Description: audio input
Data type: fract32
Channel range: 1
Block size range: 96:480
Sample rate range: 8000, 16000, 44100, 48000
Complex support: Real
Output Pins
Name: out
Description: audio output
Data type: fract32
Scratch Pins
Channel count: 1
Block size: 96
Sample rate: 8000
MATLAB Usage
File Name: st_sound_detect_module.m
M = st_sound_detect_module(NAME, LEARNING_FRAME_NUMBER)
Audio Weaver wrapper for the ST Sound Detect module. Arguments:
NAME - name of the module.
LEARNING_FRAME_NUMBER - 2 to 20 frames
Copyright (c) 2017 DSP Concepts, Inc. All Rights Reserved.
Author: Chris Perry
Â