class HermeticFidelityTest
Defined at line 22 of file ../../src/media/audio/audio_core/testing/integration/hermetic_fidelity_test.h
These tests feed a series of individual sinusoidal signals (across the
frequency spectrum) into the pipeline, validating that the output level is
(1) high at the expected frequency, and (2) low at all other frequencies
(respectively, frequency response and signal-to-noise-and-distortion).
Public Members
static const int64_t kNumReferenceFreqs
static const std::array<int32_t, kNumReferenceFreqs> kReferenceFrequencies
Public Methods
std::array<double, HermeticFidelityTest::kNumReferenceFreqs> FillArray (double val)
static
Defined at line 129 of file ../../src/media/audio/audio_core/testing/integration/hermetic_fidelity_test.cc
void SetUp ()
Defined at line 177 of file ../../src/media/audio/audio_core/testing/integration/hermetic_fidelity_test.cc
template <fuchsia::media::AudioSampleFormat InputFormat, fuchsia::media::AudioSampleFormat OutputFormat>
void Run (const TestCase<InputFormat, OutputFormat> & tc)
Additional fidelity assessments, potentially added in the future:
(1) Dynamic range (1kHz input at -30/60/90 db: measure level, SiNAD. Overall gain sensitivity)
This should clearly show the impact of dynamic compression in the effects chain.
(2) Assess the e2e input data path (from device to capturer)
Included for completeness: we apply no capture effects; should equal audio_fidelity_tests.
Defined at line 520 of file ../../src/media/audio/audio_core/testing/integration/hermetic_fidelity_test.cc
Protected Methods
double DoubleToDb (double val)
Defined at line 104 of file ../../src/media/audio/audio_core/testing/integration/hermetic_fidelity_test.h
void TearDown ()
Defined at line 124 of file ../../src/media/audio/audio_core/testing/integration/hermetic_fidelity_test.h
std::array<double, HermeticFidelityTest::kNumReferenceFreqs> & level_results (std::string test_name, int32_t channel)
static
Retrieve (initially allocating, if necessary) the array of level results for this path|channel.
Defined at line 138 of file ../../src/media/audio/audio_core/testing/integration/hermetic_fidelity_test.cc
std::array<double, HermeticFidelityTest::kNumReferenceFreqs> & sinad_results (std::string test_name, int32_t channel)
static
Retrieve (initially allocating, if necessary) the array of SiNAD results for this path|channel.
A map of these array results is saved as a function-local static variable.
Defined at line 159 of file ../../src/media/audio/audio_core/testing/integration/hermetic_fidelity_test.cc
int32_t FrequencyToPeriods (int32_t device_frame_rate, int32_t frequency)
Translate real-world frequencies into 'internal_periods', the number of complete wavelengths that
fit perfectly into our signal buffer. If this is an integer, we won't need to Window the output
before frequency analysis. Example: when measuring real-world frequency 2000 Hz at frame rate 96
kHz, for buffer size 65536 this translates into 1365.333... periods, but we use the integer 1365.
This translates back to a real-world frequency of 1999.5 Hz, which is not a problem.
We also want internal_periods to have fewer common factors with our buffer size and frame rates,
as this can mask problems where previous buffer sections are erroneously repeated. So if it is
not integral, we return the odd neighbor rather than round.
Defined at line 208 of file ../../src/media/audio/audio_core/testing/integration/hermetic_fidelity_test.cc
template <fuchsia::media::AudioSampleFormat InputFormat, fuchsia::media::AudioSampleFormat OutputFormat>
std::vector<Frequency> GetTestFrequencies (const HermeticFidelityTest::TestCase<InputFormat, OutputFormat> & tc)
Defined at line 217 of file ../../src/media/audio/audio_core/testing/integration/hermetic_fidelity_test.cc
template <fuchsia::media::AudioSampleFormat InputFormat, fuchsia::media::AudioSampleFormat OutputFormat>
AudioBuffer<OutputFormat> GetRendererOutput (TypedFormat<InputFormat> input_format, int64_t input_buffer_frames, RenderPath path, AudioBuffer<InputFormat> input, VirtualOutput<OutputFormat> * device, ClockMode clock_mode, std::optional<float> gain_db)
Create a renderer for this path, submit and play the input buffer, retrieve the ring buffer.
Defined at line 258 of file ../../src/media/audio/audio_core/testing/integration/hermetic_fidelity_test.cc
template <fuchsia::media::AudioSampleFormat InputFormat>
void DisplayInputBufferSections (const AudioBuffer<InputFormat> & buffer, const std::string & initial_tag, const SignalSectionIndices & input_indices)
Display specific locations of interest in the generated input signal, for debugging.
Defined at line 370 of file ../../src/media/audio/audio_core/testing/integration/hermetic_fidelity_test.cc
template <fuchsia::media::AudioSampleFormat OutputFormat>
void DisplayOutputBufferSections (const AudioBuffer<OutputFormat> & buffer, const std::string & initial_tag, const SignalSectionIndices & output_indices)
Display specific locations of interest in the received output signal, for debugging.
Defined at line 408 of file ../../src/media/audio/audio_core/testing/integration/hermetic_fidelity_test.cc
template <fuchsia::media::AudioSampleFormat InputFormat, fuchsia::media::AudioSampleFormat OutputFormat>
void DisplaySummaryResults (const TestCase<InputFormat, OutputFormat> & test_case, const std::vector<HermeticFidelityTest::Frequency> & frequencies_to_display)
Display results for this path, in tabular form for each compare/copy to existing limits.
Defined at line 450 of file ../../src/media/audio/audio_core/testing/integration/hermetic_fidelity_test.cc
template <fuchsia::media::AudioSampleFormat InputFormat, fuchsia::media::AudioSampleFormat OutputFormat>
void VerifyResults (const TestCase<InputFormat, OutputFormat> & test_case, const std::vector<HermeticFidelityTest::Frequency> & frequencies_to_verify)
Validate results for the given channel set, against channel-mapped results arrays.
Defined at line 489 of file ../../src/media/audio/audio_core/testing/integration/hermetic_fidelity_test.cc
Enumerations
enum ClockMode
| Name | Value |
|---|---|
| Default | 0 |
| Flexible | 1 |
| Monotonic | 2 |
| Offset | 3 |
| RateAdjusted | 4 |
Test renderers that use various reference clocks. These options include:
Defined at line 31 of file ../../src/media/audio/audio_core/testing/integration/hermetic_fidelity_test.h