HART  0.2.0
High level Audio Regression and Testing
Loading...
Searching...
No Matches
ExperimentSetup Struct Reference

A tuned setup for optimal THD measurement. More...

#include <hart_thd.hpp>

Public Member Functions

 ExperimentSetup (const ExperimentSetup &)=default
 
 ExperimentSetup (ExperimentSetup &&)=default
 
ExperimentSetupoperator= (const ExperimentSetup &)=delete
 
ExperimentSetupoperator= (ExperimentSetup &&)=delete
 
 ~ExperimentSetup ()=default
 

Public Attributes

const double frequencyHz
 Optimized frequency of the input sine wave.
 
const double durationSeconds
 Optimized duration of audio for FFT with no padding.
 
const size_t durationFrames
 Optimized duration of audio for FFT with no padding.
 
const int maxHarmonic
 Optimized highest harmonic for THD calculation.
 

Friends

class ExperimentSetupTuner
 The builder class used for instantiating this structure.
 

Detailed Description

A tuned setup for optimal THD measurement.

Intended to be used for hart::thd() metric.

Contains the tuned experiment parameters produced by ExperimentSetupTuner. The frequency and duration are selected so that the rendered signal contains a power-of-two number of frames and the fundamental frequency falls exactly in the centre of FFT bin, avoiding FFT spectral leakage.

Use hart::THD::ExperimentSetupTuner::tune() to instantiate it.

Use frequencyHz and durationSeconds to configure the input signal and render duration, then pass the same ExperimentSetup instance to hart::thd().

Definition at line 29 of file hart_thd.hpp.

Constructor & Destructor Documentation

◆ ExperimentSetup() [1/2]

ExperimentSetup ( const ExperimentSetup )
default

◆ ExperimentSetup() [2/2]

ExperimentSetup ( ExperimentSetup &&  )
default

◆ ~ExperimentSetup()

~ExperimentSetup ( )
default

Member Function Documentation

◆ operator=() [1/2]

ExperimentSetup & operator= ( const ExperimentSetup )
delete

◆ operator=() [2/2]

ExperimentSetup & operator= ( ExperimentSetup &&  )
delete

Friends And Related Symbol Documentation

◆ ExperimentSetupTuner

friend class ExperimentSetupTuner
friend

The builder class used for instantiating this structure.

Definition at line 63 of file hart_thd.hpp.

Member Data Documentation

◆ frequencyHz

const double frequencyHz

Optimized frequency of the input sine wave.

Should be close to desired fundamental, snapped to the centre of FFT bin.

Definition at line 34 of file hart_thd.hpp.

◆ durationSeconds

const double durationSeconds

Optimized duration of audio for FFT with no padding.

Tuned in a way that signal will have a number of frames equal to power of 2. Guaranteed to be no more that desired duration, specified in the ExperimentSetupTuner.

Same as durationFrames, but in seconds.

Definition at line 42 of file hart_thd.hpp.

◆ durationFrames

const size_t durationFrames

Optimized duration of audio for FFT with no padding.

Guaranteed to be power of two.

Same as durationSeconds, but in frames.

Definition at line 48 of file hart_thd.hpp.

◆ maxHarmonic

const int maxHarmonic

Optimized highest harmonic for THD calculation.

Based on desired max harmonic specified in the ExperimentSetupTuner, limited to the maximum possible amount, with FFT size in mind.

Definition at line 53 of file hart_thd.hpp.


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