Skip to content

OboeTester: Add chirp and multi Data Paths tests#2326

Merged
robertwu1 merged 3 commits into
mainfrom
robertwu/addchirpandmultitodatapaths
Dec 30, 2025
Merged

OboeTester: Add chirp and multi Data Paths tests#2326
robertwu1 merged 3 commits into
mainfrom
robertwu/addchirpandmultitodatapaths

Conversation

@robertwu1
Copy link
Copy Markdown
Collaborator

This PR enhances the Data Path test in OboeTester by adding two new analysis signals: a swept-sine (chirp) and a multi-tone signal. This provides a more comprehensive and robust way to test the audio data path, especially for input presets where OEMs might apply audio processing.

Problem

The existing sine wave test is not always sufficient. For some processed input presets (e.g., Camcorder), OEMs can apply effects like noise reduction that might filter out a simple, steady sine wave. This can lead to test failures that don't accurately reflect the device's ability to record real-world audio like music.

Solution

This PR introduces two new test signals that are more representative of complex audio and less likely to be misinterpreted as noise by audio processing algorithms:

  • Swept-sine (Chirp): Tests the device's frequency response over a wide range of frequencies.
  • Multi-tone: Tests for distortion and other non-linear effects by playing multiple frequencies at once.

Key Changes

  • UI: Added a new UI element in the Data Path test to allow selecting the desired test signal (Sine, Chirp, or Multi-tone).
  • Signal Generation: Implemented the generation of the chirp and multi-tone signals in the native code.
  • FFT-based Analysis: Implemented a new analysis path based on FFT to analyze the recorded chirp and multi-tone signals.
    • For multi-tone, the analysis calculates the Signal-to-Noise and Distortion Ratio (SINAD).
    • For chirp, the analysis computes a spectrogram and verifies that the frequency sweep is recorded correctly.
  • Pass/Fail Criteria: Added pass/fail criteria for the new analysis modes to allow for automated testing.
  • Code Quality: Refactored the new code to improve readability, maintainability, and remove magic numbers.

@robertwu1 robertwu1 requested a review from flamme October 31, 2025 02:47
Comment thread apps/OboeTester/app/src/main/cpp/analyzer/BaseSineAnalyzer.h
Comment thread apps/OboeTester/app/src/main/cpp/analyzer/BaseSineAnalyzer.h Outdated
Comment thread apps/OboeTester/app/src/main/cpp/analyzer/BaseSineAnalyzer.h Outdated
Comment thread apps/OboeTester/app/src/main/cpp/analyzer/BaseSineAnalyzer.h Outdated
Comment thread apps/OboeTester/app/src/main/cpp/analyzer/DataPathAnalyzer.cpp Outdated
Comment thread apps/OboeTester/app/src/main/cpp/analyzer/DataPathAnalyzer.cpp Outdated
Comment thread apps/OboeTester/app/src/main/cpp/analyzer/fft.h Outdated
Comment thread apps/OboeTester/app/src/main/cpp/analyzer/fft.h Outdated
Comment thread apps/OboeTester/app/src/main/cpp/analyzer/fft.h Outdated
Comment thread apps/OboeTester/app/src/main/cpp/analyzer/fft.h
Comment thread apps/OboeTester/app/src/main/cpp/analyzer/fft.h Outdated
Comment thread apps/OboeTester/app/src/main/cpp/analyzer/fft.h
Comment thread apps/OboeTester/app/src/main/cpp/analyzer/DataPathAnalyzer.h Outdated
Comment thread apps/OboeTester/app/src/main/cpp/analyzer/LatencyAnalyzer.h
Comment thread apps/OboeTester/app/src/main/cpp/analyzer/BaseSineAnalyzer.h Outdated
if (maxFreq > nyquist) {
maxFreq = nyquist;
}
double freq = kChirpStartFrequency + (maxFreq - kChirpStartFrequency) * mFrameCounter / (getSampleRate() * kChirpDurationSeconds);
Copy link
Copy Markdown
Collaborator

@flamme flamme Nov 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q: This looks like will go out of the range of nyquist freq when framecounter is greater than two times of kChirpDurantionSeconds * sampleRate.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving as is because the increment code should not let this happen as it's caught by the while loop. If this happens, then we have a bug with our test code

Comment thread apps/OboeTester/app/src/main/cpp/analyzer/DataPathAnalyzer.h Outdated
@robertwu1 robertwu1 merged commit 38e8d0c into main Dec 30, 2025
3 checks passed
@robertwu1 robertwu1 deleted the robertwu/addchirpandmultitodatapaths branch December 30, 2025 00:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants