MCPcopy Create free account
hub / github.com/aethersdr/AetherSDR / analyzeInt16Mono

Function analyzeInt16Mono

src/core/TxMicChannelNormalizer.cpp:121–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

119}
120
121void analyzeInt16Mono(const int16_t* src, int frames, Diagnostics& diag)
122{
123 double sumSq = 0.0;
124 float peak = 0.0f;
125 for (int i = 0; i < frames; ++i) {
126 const float s = absInt16(src[i]);
127 peak = std::max(peak, s);
128 sumSq += static_cast<double>(s) * s;
129 }
130 const float rms = frames > 0 ? static_cast<float>(std::sqrt(sumSq / frames)) : 0.0f;
131 diag.leftPeak = peak;
132 diag.rightPeak = peak;
133 diag.leftRms = rms;
134 diag.rightRms = rms;
135}
136
137void analyzeInt16Stereo(const int16_t* src, int frames, Diagnostics& diag)
138{

Callers 1

Calls 1

absInt16Function · 0.85

Tested by

no test coverage detected