Skip to content

Update Tap-to-Tone with filter and tone generator options#2368

Merged
hasinur010 merged 5 commits intogoogle:mainfrom
hasinur010:tap2tone
Apr 10, 2026
Merged

Update Tap-to-Tone with filter and tone generator options#2368
hasinur010 merged 5 commits intogoogle:mainfrom
hasinur010:tap2tone

Conversation

@hasinur010
Copy link
Copy Markdown
Collaborator

Update Tap-to-Tone with filter and tone generator options

  • Replace "Use Noise Pulse" checkbox with a "Tone type" spinner supporting Blip, Saw, and NoisePulse generators.
  • Added BlipGenerator native class for sine wave pulses.
  • Add a "Filter" spinner to TapToToneActivity and ExternalTapToToneActivity to allow selecting between AUTO, HIGHPASS, and AVERAGE analysis filters.
  • Update TapLatencyAnalyser to support multiple filter types and improve detection by optionally falling back to an average filter in AUTO mode.
  • Update the UI to display how often the average filter is used during measurements in AUTO filter mode.
  • Increment CMakeLists.txt sync version for new native files.

… filters

- Replace "Use Noise Pulse" checkbox with a "Tone type" spinner supporting Blip, Saw, and NoisePulse generators.
- Added `BlipGenerator` native class for sine wave pulses.
- Add a "Filter" spinner to `TapToToneActivity` and `ExternalTapToToneActivity` to allow selecting between AUTO, HIGHPASS, and AVERAGE analysis filters.
- Update `TapLatencyAnalyser` to support multiple filter types and improve detection by optionally falling back to an average filter in AUTO mode.
- Update the UI to display how often the average filter is used during measurements.
- Increment `CMakeLists.txt` sync version for new native files.
… filters

- Replace "Use Noise Pulse" checkbox with a "Tone type" spinner supporting Blip, Saw, and NoisePulse generators.
- Added `BlipGenerator` native class for sine wave pulses.
- Add a "Filter" spinner to `TapToToneActivity` and `ExternalTapToToneActivity` to allow selecting between AUTO, HIGHPASS, and AVERAGE analysis filters.
- Update `TapLatencyAnalyser` to support multiple filter types and improve detection by optionally falling back to an average filter in AUTO mode.
- Update the UI to display how often the average filter is used during measurements.
- Increment `CMakeLists.txt` sync version for new native files.
@hasinur010 hasinur010 requested a review from robertwu1 April 10, 2026 19:47
} else {
if (mUseToneGeneratorType == "Blip"){
mExactBlipGenerator.output.connect(&(monoToMulti->input));
}else if(mUseToneGeneratorType == "Saw"){
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

fix spaces for else if

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

elsewhere in the file too

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.

Thanks, updated.

<item>AVERAGE</item>
</string-array>

<string name="tone_type_prompt">Choose a Filter</string>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

tone

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.

Thanks, updated.

}

return numFrames;
} No newline at end of file
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

newlines at the end of files

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.

Thanks, updated. Both BlipGenerator.h and BlipGenerator.cpp.

mAverageFilterUsedInAuto = false;
float[] highPassBuffer = new float[numSamples];
highPassFilter(buffer, offset, numSamples, highPassBuffer);
TapLatencyEvent[] events_from_highpass = applyEnvelopeFollowerAndScanForEdges(highPassBuffer, numSamples);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

follow camelCase

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.

Thanks, updated.

mFilteredBuffer = avgFilteredBuffer;
return events_from_avg;
}else{
if (events_from_highpass.length == 2) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Are we planning to add this logic to CTS Verifier with highpass first and average filter if there's not 2 events otherwise?

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.

Yes! We have implemented this in CTS Verifier as part of our risk mitigation strategy.

bool mUseNoisePulse;
std::string mUseToneGeneratorType;
SawPingGenerator mSawPingGenerator;
BlipGenerator mExactBlipGenerator;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

spacing

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.

Thanks, updated.

… filters

- Replace "Use Noise Pulse" checkbox with a "Tone type" spinner supporting Blip, Saw, and NoisePulse generators.
- Added `BlipGenerator` native class for sine wave pulses.
- Add a "Filter" spinner to `TapToToneActivity` and `ExternalTapToToneActivity` to allow selecting between AUTO, HIGHPASS, and AVERAGE analysis filters.
- Update `TapLatencyAnalyser` to support multiple filter types and improve detection by optionally falling back to an average filter in AUTO mode.
- Update the UI to display how often the average filter is used during measurements.
- Increment `CMakeLists.txt` sync version for new native files.
@hasinur010 hasinur010 merged commit d56d05c into google:main Apr 10, 2026
2 checks passed
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