(8.D.2.5) NoiseTracking
Overview
DSP Concepts proprietary single-channel Noise Tracking.
Discussion
This module estimates the stationary-noise level of its incoming signal. It is part of the SCNRv4 design, but can be used independently.
The module works in conjunction with the WOLA filterbank modules.
The input pin expects the squared-magnitude of the WOLA-domain noisy signal, while the output pin provides the noise-level estimate in dBs.
The module is single channel, expects real data, and operates on any block size and any sampling rate.
At design time, the initial noise estimate must be set using noiseLevelInitdB.
The noiseAdjustdB parameter is an offset which is added to the estimated noise dB-level. The stationary noise-floor estimation is prone to be lower than the actual noise level. By setting noiseAdjustdB to a positive number, the algorithm will bias the estimated level to be higher.
The estimated level is smoothed out using cross-bin averaging in logarithmic groupings. The noiseSmoothOctave parameter defines how many octaves the averaging should span. Smoothing can be disabled by setting noiseSmoothOctave to 0.
The noise floor (minimum noise-estimate) can be set via noiseFloordB.
The trackingSpeed parameter controls the tracking speed of the algorithm. It can take values between 0 (low speed) and 2 (high speed), with a default value of 1.
The sensitivity parameter controls the sensitivity of the algorithm to small level fluctuations. It affects the estimation bias, but also the overall tracking speed of the algorithm. It is recommended using all 3 parameters (sensitivity, trackingSpeed and noiseAdjustdB) to achieve the desired behaviour. It takes values between 0 (low sensitivity) and 2 (high sensitivity), with a default value of 1.
The module has 2 extra optional inputs:
The ctrlUp and ctrlDown inputs have the same attributes (block size and sample rate) as the noisy signal. They should be valued 0 or 1 only. These are used to freeze the noise trackers on the way up or down, respectively. A value of 1 means adapt, while a value of 0 means freeze.
Type Definition
typedef struct _ModuleNoiseTracking
{
ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure
INT32 noiseAttRelHoldCount; // Hold time translated to the number of blocks.
FLOAT32 noiseAttRelAttCoeff; // Internal coefficient realizing the attack time.
FLOAT32 noiseAttRelRelCoeff; // Internal coefficient realizing the release time.
FLOAT32 noiseSofB0; // Desired first numerator coefficient.
FLOAT32 noiseSofB1; // Desired second numerator coefficient.
FLOAT32 noiseSofA1; // Desired second denominator coefficient.
FLOAT32 noiseAdjustdB; // Noise level bias in dB.
FLOAT32 noiseScaleOffGain; // Scale Offset linear gain.
FLOAT32 noiseSmoothOctave; // Number of octaves for cross-bin logarithmic smoothing.
INT32 snrAttRelHoldCount; // Hold time translated to the number of blocks.
FLOAT32 snrAttRelAttCoeff; // Internal coefficient realizing the attack time.
FLOAT32 snrAttRelRelCoeff; // Internal coefficient realizing the release time.
FLOAT32 snrScaleOff1Offset; // Scale Offset offset.
FLOAT32 snrScaleOff2Offset; // Scale Offset offset.
INT32 snrCtrlAttRelHoldCount; // Hold time translated to the number of blocks.
FLOAT32 snrCtrlAttRelAttCoeff; // Internal coefficient realizing the attack time.
FLOAT32 snrCtrlAttRelRelCoeff; // Internal coefficient realizing the release time.
INT32 snrAdjustAttRelHoldCount; // Hold time translated to the number of blocks.
FLOAT32 snrAdjustAttRelAttCoeff; // Internal coefficient realizing the attack time.
FLOAT32 snrAdjustAttRelRelCoeff; // Internal coefficient realizing the release time.
INT32 snrAdjustAttRel2HoldCount; // Hold time translated to the number of blocks.
FLOAT32 snrAdjustAttRel2AttCoeff; // Internal coefficient realizing the attack time.
FLOAT32 snrAdjustAttRel2RelCoeff; // Internal coefficient realizing the release time.
FLOAT32 snrAdjustScaleOffOffset; // Scale Offset offset.
FLOAT32 araScaleOffOffset; // Scale Offset offset.
FLOAT32 araAlphaCalcUpScaleOff2Offset; // Scale Offset offset.
FLOAT32 noiseFloordB; // Noise floor level in dB.
FLOAT32 noiseFloorLinear; // Noise floor level linear.
FLOAT32 trackingSpeed; // Noise-tracking speed.
FLOAT32 sensitivity; // Sensitivity to small-level fluctuations.
INT32 enableControlInputs; // Tracker for input control pins enable
FLOAT32 noiseAttRelAttack; // Attack time in ms.
FLOAT32 snrSmoothingHoldTimeMsDef; // SNR smoothing hold time default in ms.
FLOAT32 snrSmoothingHoldTimeMsMaxDev; // SNR smoothing hold time max deviation in ms.
FLOAT32 snrSmoothingReleaseTimeMsDef; // SNR smoothing release time default in ms.
FLOAT32 snrSmoothingReleaseTimeMsMaxDev; // SNR smoothing release time max deviation in ms.
FLOAT32 signalPathSmoothingHz; // Estimation-path smoothing low-pass-filter cutoff-frequency in Hz.
FLOAT32 noiseSmoothStartFreq; // Start frequency for cross-bin smoothing.
FLOAT32 snrAttRelAttack; // Attack time in ms.
FLOAT32 snrAttRelRelease; // Release time in ms.
FLOAT32 snrAttRelHold; // Hold time in ms.
FLOAT32 noiseSmoothWidth; // Control-chain cross-bin linear-smoothing coefficient (fraction of sample rate).
FLOAT32 snrSmoothStartFreq; // Start frequency for cross-bin smoothing.
FLOAT32 noiseStepUpdBDef; // Noise step up default in dB/s.
FLOAT32 noiseStepUpdBMaxDev; // Noise step up max deviation in dB/s.
FLOAT32 noiseStepDowndB; // Noise step down in dB/s.
FLOAT32 snrCtrlAttRelAttack; // Attack time in ms.
FLOAT32 snrCtrlAttRelRelease; // Release time in ms.
FLOAT32 snrCtrlAttRelHold; // Hold time in ms.
FLOAT32 snrAdjustAttRelAttack; // Attack time in ms.
FLOAT32 snrAdjustAttRelRelease; // Release time in ms.
FLOAT32 snrAdjustAttRelHold; // Hold time in ms.
FLOAT32 snrAdjustAttRel2Attack; // Attack time in ms.
FLOAT32 snrAdjustAttRel2Release; // Release time in ms.
FLOAT32 snrAdjustAttRel2Hold; // Hold time in ms.
FLOAT32 snrAdjustThreshdB; // SNR adjustment threshold in dB.
FLOAT32 snrAdjustClipAsymUpper; // Asymmetric-clip upper limit.
FLOAT32 alphaReleaseTimeMs; // Alpha down release time in ms.
FLOAT32 snrThreshdB; // SNR threshold in dB.
FLOAT32 snrThreshdBDef; // SNR threshold default in dB.
FLOAT32 snrThreshdBMaxDev; // SNR threshold max deviation in dB.
FLOAT32 alphaAttackTimeMsDef; // Alpha up (raw) attack time default in ms.
FLOAT32 alphaAttackTimeMsMaxDev; // Alpha up (raw) attack time max deviation in ms.
FLOAT32 logisticOffset; // Logistic function offset.
FLOAT32 logisticSlope; // Logistic function gain.
FLOAT32 noiseLevelInitdB; // Initial noise level state in dB.
INT32* aCtrlValues; // Array with ctrl signal values.
FLOAT32* aNoiseAttRelEnvState; // Attack-release envelope state.
INT32* aNoiseAttRelHoldState; // Attack-release hold state.
FLOAT32* aNoiseSofState; // SOF first state.
INT32* aNoiseSmoothStartIdx; // Starting index for the averaging process.
INT32* aNoiseSmoothEndIdx; // Ending index for the averaging process.
FLOAT32* aNoiseSmoothOneOverN; // Precomputed 1/N for averaging.
FLOAT32* aSnrNoiseTrackFb; // Control-path noise-tracking feedback.
FLOAT32* aSnrNoiseLevelFb; // Control-path noise-level feedback.
FLOAT32* aSnrAttRelEnvState; // Attack-release envelope state.
INT32* aSnrAttRelHoldState; // Attack-release hold state.
INT32* aSnrSmoothStartIdx; // Starting index for the averaging process.
INT32* aSnrSmoothEndIdx; // Ending index for the averaging process.
FLOAT32* aSnrSmoothOneOverN; // Precomputed 1/N for averaging.
FLOAT32* aSnrCtrlAttRelEnvState; // Attack-release envelope state.
INT32* aSnrCtrlAttRelHoldState; // Attack-release hold state.
FLOAT32* aSnrCtrlAttRelFb; // Attack-release output feedback.
FLOAT32* aSnrAdjustAttRelEnvState; // Attack-release envelope state.
INT32* aSnrAdjustAttRelHoldState; // Attack-release hold state.
FLOAT32* aSnrAdjustAttRel2EnvState; // Attack-release envelope state.
INT32* aSnrAdjustAttRel2HoldState; // Attack-release hold state.
FLOAT32* aAraFb; // ARA feedback line.
} ModuleNoiseTrackingClass;
Variables
Properties
Name | Type | Usage | isHidden | Default value | Range | Units |
noiseAttRelHoldCount | int | derived | 0 | 4800 | Unrestricted | Â |
noiseAttRelAttCoeff | float | derived | 0 | 1 | Unrestricted | Â |
noiseAttRelRelCoeff | float | derived | 0 | 2.6047e-05 | Unrestricted | Â |
noiseSofB0 | float | derived | 0 | 0.00098079 | Unrestricted | Â |
noiseSofB1 | float | derived | 0 | 0.00098079 | Unrestricted | Â |
noiseSofA1 | float | derived | 0 | 0.99804 | Unrestricted | Â |
noiseAdjustdB | float | parameter | 0 | 6 | -24:24 | dB |
noiseScaleOffGain | float | derived | 0 | 3.9811 | Unrestricted | Â |
noiseSmoothOctave | float | parameter | 0 | 0.1 | 0:1 | Â |
snrAttRelHoldCount | int | derived | 0 | 480 | Unrestricted | Â |
snrAttRelAttCoeff | float | derived | 0 | 1 | Unrestricted | Â |
snrAttRelRelCoeff | float | derived | 0 | 0.0020812 | Unrestricted | Â |
snrScaleOff1Offset | float | derived | 0 | 0.00041667 | Unrestricted | Â |
snrScaleOff2Offset | float | derived | 0 | -0.0020833 | Unrestricted | Â |
snrCtrlAttRelHoldCount | int | derived | 0 | 48 | Unrestricted | Â |
snrCtrlAttRelAttCoeff | float | derived | 0 | 1.7881e-07 | Unrestricted | Â |
snrCtrlAttRelRelCoeff | float | derived | 0 | 0.010363 | Unrestricted | Â |
snrAdjustAttRelHoldCount | int | derived | 0 | 4800 | Unrestricted | Â |
snrAdjustAttRelAttCoeff | float | derived | 0 | 1 | Unrestricted | Â |
snrAdjustAttRelRelCoeff | float | derived | 0 | 4.1664e-05 | Unrestricted | Â |
snrAdjustAttRel2HoldCount | int | derived | 0 | 4800 | Unrestricted | Â |
snrAdjustAttRel2AttCoeff | float | derived | 0 | 1 | Unrestricted | Â |
snrAdjustAttRel2RelCoeff | float | derived | 0 | 2.0862e-06 | Unrestricted | Â |
snrAdjustScaleOffOffset | float | derived | 0 | 20 | Unrestricted | Â |
araScaleOffOffset | float | derived | 0 | 0.99979 | Unrestricted | Â |
araAlphaCalcUpScaleOff2Offset | float | derived | 0 | 0.99999 | Unrestricted | Â |
noiseFloordB | float | parameter | 0 | -120 | -150:0 | dB |
noiseFloorLinear | float | derived | 0 | 1e-12 | Unrestricted | Â |
trackingSpeed | float | parameter | 0 | 1 | 0:2 | Â |
sensitivity | float | parameter | 0 | 1 | 0:2 | Â |
enableControlInputs | int | const | 1 | 0 | Unrestricted | Â |
noiseAttRelAttack | float | const | 1 | 0 | Unrestricted | Â |
snrSmoothingHoldTimeMsDef | float | const | 1 | 100 | Unrestricted | Â |
snrSmoothingHoldTimeMsMaxDev | float | const | 1 | 100 | Unrestricted | Â |
snrSmoothingReleaseTimeMsDef | float | const | 1 | 800 | Unrestricted | Â |
snrSmoothingReleaseTimeMsMaxDev | float | const | 1 | 500 | Unrestricted | Â |
signalPathSmoothingHz | float | const | 1 | 15 | Unrestricted | Â |
noiseSmoothStartFreq | float | const | 1 | 0 | Unrestricted | Â |
snrAttRelAttack | float | const | 1 | 0 | Unrestricted | Â |
snrAttRelRelease | float | const | 1 | 10 | Unrestricted | Â |
snrAttRelHold | float | const | 1 | 10 | Unrestricted | Â |
noiseSmoothWidth | float | const | 1 | 0.25 | Unrestricted | Â |
snrSmoothStartFreq | float | const | 1 | 0 | Unrestricted | Â |
noiseStepUpdBDef | float | const | 1 | 20 | Unrestricted | Â |
noiseStepUpdBMaxDev | float | const | 1 | 10 | Unrestricted | Â |
noiseStepDowndB | float | const | 1 | -100 | Unrestricted | Â |
snrCtrlAttRelAttack | float | const | 1 | 100000 | Unrestricted | Â |
snrCtrlAttRelRelease | float | const | 1 | 2 | Unrestricted | Â |
snrCtrlAttRelHold | float | const | 1 | 1 | Unrestricted | Â |
snrAdjustAttRelAttack | float | const | 1 | 0 | Unrestricted | Â |
snrAdjustAttRelRelease | float | const | 1 | 500 | Unrestricted | Â |
snrAdjustAttRelHold | float | const | 1 | 100 | Unrestricted | Â |
snrAdjustAttRel2Attack | float | const | 1 | 0 | Unrestricted | Â |
snrAdjustAttRel2Release | float | const | 1 | 10000 | Unrestricted | Â |
snrAdjustAttRel2Hold | float | const | 1 | 100 | Unrestricted | Â |
snrAdjustThreshdB | float | const | 1 | 10 | Unrestricted | Â |
snrAdjustClipAsymUpper | float | const | 1 | 10 | Unrestricted | Â |
alphaReleaseTimeMs | float | const | 1 | 100 | Unrestricted | Â |
snrThreshdB | float | derived | 1 | 30 | Unrestricted | Â |
snrThreshdBDef | float | const | 1 | 30 | Unrestricted | Â |
snrThreshdBMaxDev | float | const | 1 | 5 | Unrestricted | Â |
alphaAttackTimeMsDef | float | const | 1 | 1700 | Unrestricted | Â |
alphaAttackTimeMsMaxDev | float | const | 1 | 1000 | Unrestricted | Â |
logisticOffset | float | const | 1 | 0 | Unrestricted | Â |
logisticSlope | float | const | 1 | 100 | Unrestricted | Â |
noiseLevelInitdB | float | const | 1 | -50 | Unrestricted | Â |
aCtrlValues | int* | state | 1 | [1 x 33] | Unrestricted | Â |
aNoiseAttRelEnvState | float* | state | 1 | [1 x 33] | Unrestricted | Â |
aNoiseAttRelHoldState | int* | state | 1 | [1 x 33] | Unrestricted | Â |
aNoiseSofState | float* | state | 1 | [1 x 33] | Unrestricted | Â |
aNoiseSmoothStartIdx | int* | derived | 1 | [33 x 1] | Unrestricted | Â |
aNoiseSmoothEndIdx | int* | derived | 1 | [33 x 1] | Unrestricted | Â |
aNoiseSmoothOneOverN | float* | derived | 1 | [33 x 1] | Unrestricted | Â |
aSnrNoiseTrackFb | float* | state | 1 | [1 x 33] | Unrestricted | Â |
aSnrNoiseLevelFb | float* | state | 1 | [1 x 33] | Unrestricted | Â |
aSnrAttRelEnvState | float* | state | 1 | [1 x 33] | Unrestricted | Â |
aSnrAttRelHoldState | int* | state | 1 | [1 x 33] | Unrestricted | Â |
aSnrSmoothStartIdx | int* | state | 1 | [33 x 1] | Unrestricted | Â |
aSnrSmoothEndIdx | int* | state | 1 | [33 x 1] | Unrestricted | Â |
aSnrSmoothOneOverN | float* | state | 1 | [33 x 1] | Unrestricted | Â |
aSnrCtrlAttRelEnvState | float* | state | 1 | [1 x 33] | Unrestricted | Â |
aSnrCtrlAttRelHoldState | int* | state | 1 | [1 x 33] | Unrestricted | Â |
aSnrCtrlAttRelFb | float* | state | 1 | [1 x 33] | Unrestricted | Â |
aSnrAdjustAttRelEnvState | float* | state | 1 | [1 x 33] | Unrestricted | Â |
aSnrAdjustAttRelHoldState | int* | state | 1 | [1 x 33] | Unrestricted | Â |
aSnrAdjustAttRel2EnvState | float* | state | 1 | [1 x 33] | Unrestricted | Â |
aSnrAdjustAttRel2HoldState | int* | state | 1 | [1 x 33] | Unrestricted | Â |
aAraFb | float* | state | 1 | [1 x 33] | Unrestricted | Â |
Pins
Input Pins
Name: sig
Description: Audio inputs
Data type: float
Channel range: 1
Block size range: Unrestricted
Sample rate range: Unrestricted
Complex support: Real
Output Pins
Name: level
Description: Output signal
Data type: float
Scratch Pins
Channel count: 1
Block size: 34
Sample rate: 48000
Â
Channel count: 1
Block size: 33
Sample rate: 48000
MATLAB Usage
File Name: noise_tracking_module.m
M = noise_tracking_module(NAME)
Single-channel stationary-noise tracker. This module estimates
stationary-noise levels per subband. Part of the SCNRv4 design.
Arguments:
NAME - name of the module.
CTRL_PINS_ENABLE - creates pins for up-down-tracking control.
NOISE_LEVEL_INIT - sets initial noise-level estimate.