Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
zrythm::dsp::PeakDsp Class Reference

Performs digital peak processing on an audio signal. More...

#include <src/dsp/peak_dsp.h>

Public Member Functions

void process (float *p, int n)
 Processes audio samples.
float read_f ()
std::pair< float, float > read ()
 Returns RMS and Peak values.
void reset ()
void init (float samplerate)
 Init with the samplerate.

Detailed Description

Performs digital peak processing on an audio signal.

This class provides methods for processing an audio signal to detect the peak and RMS values. It maintains internal state to track the maximum peak and RMS values since the last read.

The process() method should be called for each frame of audio data, and the read() method can be used to retrieve the current peak and RMS values.

The init() method should be called to initialize the class with the sample rate of the audio data.

Definition at line 50 of file peak_dsp.h.

Member Function Documentation

◆ process()

void zrythm::dsp::PeakDsp::process ( float * p,
int n )

Processes audio samples.

Parameters
pArray of samples
nNumber of samples

◆ read()

std::pair< float, float > zrythm::dsp::PeakDsp::read ( )

Returns RMS and Peak values.

Returns
std::pair<float, float>

The documentation for this class was generated from the following file: