Skip to content

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

SimpleGain(float initialGain = 1.0f)

Methods

  • void setGain(float newGain) - Set gain value
  • float getGain() const - Get current gain
  • float processSample(float input) - Process single sample
  • void processBuffer(const float* input, float* output, int numSamples) - Process buffer
  • void 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)