Simple Gain - Test Implementation¶
Overview¶
A minimal gain processor implementation for testing the AudioLab Reference Implementation Certification Framework.
Features¶
- Linear gain control (0.0 to 10.0)
- Denormal prevention
- Bounds checking
- Sample-by-sample and buffer processing
API¶
Constructor¶
Methods¶
void setGain(float newGain)- Set gain valuefloat getGain() const- Get current gainfloat processSample(float input)- Process single samplevoid processBuffer(const float* input, float* output, int numSamples)- Process buffervoid reset()- Reset state
Usage Example¶
#include "simple_gain.hpp"
using namespace audiolab::test;
// Create processor
SimpleGain gain(0.5f); // 50% gain
// Process samples
float input[512];
float output[512];
// ... fill input ...
gain.processBuffer(input, output, 512);
Certification Target¶
This implementation targets Bronze certification level: - ✅ Compiles with zero warnings - ✅ Basic unit tests - ✅ Documentation - ✅ API completeness
Implementation Notes¶
- Header-only for simplicity
- No external dependencies
- C++17 compliant
- Thread-safe (no shared state)