Gin
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | List of all members
TruePeakMeter Class Reference

True peak meter per ITU-R BS.1770 Annex 2: the signal is oversampled (4x below 96 kHz, 2x below 192 kHz) so peaks that fall between samples are measured. More...

#include <gin_truepeakmeter.h>

Public Member Functions

 TruePeakMeter ()=default
 
void prepare (double sampleRate, int numChannels, int maxBlockSize)
 Not realtime safe.
 
void reset ()
 Clears the held peaks.
 
void process (const juce::AudioBuffer< float > &buffer)
 
float getTruePeak (int channel) const
 Peak of the last processed block, dBTP.
 
float getMaxTruePeak (int channel) const
 Highest peak since reset, dBTP.
 
float getMaxTruePeak () const
 Highest peak since reset across all channels, dBTP.
 
int getNumChannels () const
 
int getOversamplingFactor () const
 

Static Public Attributes

static constexpr float silence = -100.0f
 

Detailed Description

True peak meter per ITU-R BS.1770 Annex 2: the signal is oversampled (4x below 96 kHz, 2x below 192 kHz) so peaks that fall between samples are measured.

Reports the peak of the most recent block and the highest peak held since reset, per channel, in dBTP.

Call process() from the audio thread; the getters are safe from any thread.

Constructor & Destructor Documentation

◆ TruePeakMeter()

TruePeakMeter::TruePeakMeter ( )
default

Member Function Documentation

◆ prepare()

void TruePeakMeter::prepare ( double  sampleRate,
int  numChannels,
int  maxBlockSize 
)

Not realtime safe.

◆ reset()

void TruePeakMeter::reset ( )

Clears the held peaks.

Safe from any thread.

◆ process()

void TruePeakMeter::process ( const juce::AudioBuffer< float > &  buffer)

◆ getTruePeak()

float TruePeakMeter::getTruePeak ( int  channel) const

Peak of the last processed block, dBTP.

◆ getMaxTruePeak() [1/2]

float TruePeakMeter::getMaxTruePeak ( int  channel) const

Highest peak since reset, dBTP.

◆ getMaxTruePeak() [2/2]

float TruePeakMeter::getMaxTruePeak ( ) const

Highest peak since reset across all channels, dBTP.

◆ getNumChannels()

int TruePeakMeter::getNumChannels ( ) const

◆ getOversamplingFactor()

int TruePeakMeter::getOversamplingFactor ( ) const

Member Data Documentation

◆ silence

constexpr float TruePeakMeter::silence = -100.0f
staticconstexpr

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