|
HART
0.2.0
High level Audio Regression and Testing
|
A tuned setup for optimal THD measurement. More...
#include <hart_thd.hpp>
Public Member Functions | |
| ExperimentSetup (const ExperimentSetup &)=default | |
| ExperimentSetup (ExperimentSetup &&)=default | |
| ExperimentSetup & | operator= (const ExperimentSetup &)=delete |
| ExperimentSetup & | operator= (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. | |
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.
|
default |
|
default |
|
default |
|
delete |
|
delete |
|
friend |
The builder class used for instantiating this structure.
Definition at line 63 of file hart_thd.hpp.
| 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.
| 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.
| 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.
| 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.