Apply noise gate with hysteresis.
- Parameters
-
| pcm | Input PCM samples (DC-removed) |
| output | Output buffer (gated samples, zero if gate closed) |
Definition at line 157 of file signal_conditioner.cpp.hpp.
157 {
158 const size count = pcm.size();
161
162 const i16 openThreshold =
mConfig.noiseGateOpenThreshold;
163 const i16 closeThreshold =
mConfig.noiseGateCloseThreshold;
164
165 for (size i = 0; i < count; ++i) {
166 const i16
sample = pcm[i];
168
169
171
172 if (absSample >= openThreshold) {
174 }
175 } else {
176
177 if (absSample < closeThreshold) {
179 }
180 }
181
182
184 }
185}
bool mNoiseGateOpen
Noise gate state.
SignalConditionerConfig mConfig
CRGB sample(const CRGB *grid, const XYMap &xyMap, float x, float y, SampleMode mode)
Sample a pixel from a 2D CRGB grid at floating-point coordinates.
References mConfig, mNoiseGateOpen, fl::sample(), and fl::span< T, Extent >::size().
Referenced by processSample().