MCPcopy Create free account
hub / github.com/FastLED/FastLED / zcf

Method zcf

src/fl/audio/audio.h:150–156  ·  view source on GitHub ↗

"Zero crossing factor". High values > .4 indicate hissing sounds. For example a microphone rubbing against a clothing. These types of signals indicate the audio should be ignored. Low zero crossing factors (with loud sound) indicate that there is organized sound like that coming from music. This is so cheap to calculate it's done automatically. It should be one of the first signals to reject or ac

Source from the content-addressed store, hash-verified

148 // Returns: a value -> [0.0f, 1.0f)
149 // O(1) - pre-computed in constructor
150 float zcf() const FL_NOEXCEPT {
151 const fl::size n = pcm().size();
152 if (n < 2) {
153 return 0.f;
154 }
155 return float(mZeroCrossings) / static_cast<float>(n - 1);
156 }
157
158 // Root mean square amplitude of the audio signal
159 // Returns: RMS value (computed lazily on first access)

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected