﻿# RNNoise floating-point input: PCM amplitude scale is part of the interface

Follow RNNoise reference PCM conversion, frame processing, and raw-file format before connecting normalized floating-point audio from a microphone or another model.

Author: Retrivium editorial team
Updated: 2026-11-04
Canonical URL: https://retrivium.ai/journal/fg2-rnnoise-float-pcm-amplitude-format/
Language: en

## Separate numeric type from signal units

The [RNNoise paper](https://arxiv.org/abs/1709.08243) combines learned gain estimation with signal-processing components for noise suppression. Its C interface uses floating-point sample buffers, but float is a storage type rather than a definition of audio amplitude units. An upstream model or microphone API can use a different convention for the same sound. A wrapper must establish that convention explicitly instead of assuming all floating-point waveform arrays are interchangeable.

## Inspect the reference conversion

The [official demonstration source](https://raw.githubusercontent.com/xiph/rnnoise/main/examples/rnnoise_demo.c) reads signed 16-bit PCM values and copies them into a float frame without first dividing them into a unit-amplitude range. This is direct evidence of the reference amplitude convention. Passing a waveform normalized to a small unit range without the corresponding conversion changes the signal presented to the algorithm, even if the sample count, pointer type, and function call are all accepted correctly.

## Keep the raw format distinct from WAV

The [project instructions](https://github.com/xiph/rnnoise) specify raw mono PCM sampled at 48 kHz for the example command-line tool and explicitly distinguish this from WAV input and output. A WAV header is not a speech frame. Decode the container before processing, perform actual resampling when necessary, and encode a real output container afterward. Changing a filename extension does none of those operations and can produce apparently successful but acoustically meaningless processing.

## Diagnose an unexpectedly weak suppression path

Consider a working reference demo and a new wrapper whose output barely changes. Before retraining the network or increasing compute, compare amplitude range, input rate, channel conversion, and frame assembly with the reference. Also verify the reverse conversion so a valid processed signal is not scaled incorrectly during export. This is a diagnostic procedure, not a guarantee that every noise source should be removed or that larger amplitudes always improve suppression quality.

## Preserve recurrent frame continuity

The demonstration maintains a denoising state across successive frames. Keep that state associated with a continuous channel and reset it deliberately at recording boundaries. Guides to [tensor axes](/journal/tensor-axes-batch-sequence-hidden/) and [inference evaluation](/journal/inference-benchmark-method/) support checks. Record amplitude convention, actual sample rate, frame preparation, state lifecycle, model revision, and file conversion. A valid integration reproduces both numeric units and temporal continuity, rather than merely proving that a noise-reduction function accepted a float pointer.
