Skip to content

Add a minimum audio frequency for automatic TX offset selection - #919

Open
patrickrb wants to merge 1 commit into
devfrom
feat/min-auto-tx-audio-freq
Open

patrickrb wants to merge 1 commit into
devfrom
feat/min-auto-tx-audio-freq

Conversation

@patrickrb

Copy link
Copy Markdown
Owner

Why

Tester feedback: on a rig whose TX audio ends up clipped or squared, the transmitted tone carries harmonics. From a low audio offset those harmonics still fall inside the ~3 kHz TX filter (3rd harmonic below 1000 Hz, 2nd below 1500 Hz) and go out on the air. The app's automatic offset selection could put the TX there with no way to stop it.

What

New setting Settings → Transmission → Minimum auto TX audio frequency: Off (default) / 500 / 1000 / 1500 / 2000 Hz. Config key minAutoTxFreq.

With a floor set:

  • Clear-CQ picker (ClearFrequencyFinder) only considers offsets from the floor up, and tie-breaks toward the middle of the remaining range instead of 1500 Hz so it doesn't hug the floor.
  • At CQ start an offset below the floor is moved above it, even when it is clear or nothing has been decoded yet.
  • TX=RX follow does not move onto a station below the floor; we answer split from our own offset.

Deliberately unchanged:

  • Off by default, so behaviour is identical for everyone who doesn't set it.
  • The mid-CQ re-check still fires only on "occupied", so a manual waterfall tap below the floor holds until the next CQ start.
  • Fox/Hound QSYs are protocol-mandated and ignore the floor.
  • Manual offset entry and waterfall taps are not restricted.

Testing

  • ClearFrequencyFinderTest: floor respected, stay-put when nothing above the floor is better, below-floor offset lifted (with and without history), Off == unfloored behaviour, oversized floor capped, stored-value snapping.
  • FT8TransmitSignalTest: TX=RX follow blocked below the floor, existing cases updated for the new signature.
  • Full testDebugUnitTest and assembleDebug pass on Windows.
  • Not verified on a device or on the air — no phone was attached. The settings row and picker have not been looked at on screen.
  • Translations for the two new strings in all 16 locales are machine-written and unreviewed.

🤖 Generated with Claude Code

A rig that clips or squares the TX audio radiates harmonics of the tone,
and from a low offset they still land inside the ~3 kHz TX filter. Add a
"Minimum auto TX audio frequency" setting (Off/500/1000/1500/2000 Hz)
that floors the offsets the app picks on its own: the clear-CQ picker
scans only from the floor up and lifts a below-floor offset at CQ start,
and the TX=RX follow no longer moves onto a station below the floor.
Off by default, so existing behaviour is unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 28 lines in your changes missing coverage. Please review.
✅ Project coverage is 41.48%. Comparing base (0677e40) to head (2da4508).

Files with missing lines Patch % Lines
...o/ks3ckc/ft8af/ui/settings/TransmissionSettings.kt 0.00% 28 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##                dev     #919      +/-   ##
============================================
- Coverage     41.51%   41.48%   -0.04%     
  Complexity      252      252              
============================================
  Files           280      280              
  Lines         33993    34021      +28     
  Branches       4034     4037       +3     
============================================
  Hits          14112    14112              
- Misses        19592    19620      +28     
  Partials        289      289              
Flag Coverage Δ
android 17.61% <0.00%> (-0.03%) ⬇️
native 9.93% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...o/ks3ckc/ft8af/ui/settings/TransmissionSettings.kt 0.77% <0.00%> (-0.05%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

CQ-start floor enforcement remains bypassed when auto-clear is disabled, and configuration restoration needs test coverage.

2 open issues
What changed in this PR

Adds a configurable minimum audio frequency for automatic TX offset selection to help keep harmonics outside the rig’s transmit filter.

Changes:

  • Adds a persisted frequency-floor setting and localized picker.
  • Applies the floor to clear-offset selection and TX=RX following.
  • Adds selection tests and documents intended behavior.
File Description
ft8af/​app/​src/​test/​java/​com/​k1af/​ft8af/​ft8transmit/​FT8TransmitSignalTest.java Tests floor-aware target following.
ft8af/​app/​src/​test/​java/​com/​k1af/​ft8af/​ft8transmit/​ClearFrequencyFinderTest.java Tests floor selection and value snapping.
ft8af/​app/​src/​main/​res/​values/​strings_compose.xml Adds default setting text.
ft8af/​app/​src/​main/​res/​values-zh-rTW/​strings_compose.xml Adds Traditional Chinese text.
ft8af/​app/​src/​main/​res/​values-zh-rCN/​strings_compose.xml Adds Simplified Chinese text.
ft8af/​app/​src/​main/​res/​values-uk/​strings_compose.xml Adds Ukrainian text.
ft8af/​app/​src/​main/​res/​values-tr/​strings_compose.xml Adds Turkish text.
ft8af/​app/​src/​main/​res/​values-ru/​strings_compose.xml Adds Russian text.
ft8af/​app/​src/​main/​res/​values-pt-rBR/​strings_compose.xml Adds Brazilian Portuguese text.
ft8af/​app/​src/​main/​res/​values-pl/​strings_compose.xml Adds Polish text.
ft8af/​app/​src/​main/​res/​values-nl/​strings_compose.xml Adds Dutch text.
ft8af/​app/​src/​main/​res/​values-ko/​strings_compose.xml Adds Korean text.
ft8af/​app/​src/​main/​res/​values-ja/​strings_compose.xml Adds Japanese text.
ft8af/​app/​src/​main/​res/​values-it/​strings_compose.xml Adds Italian text.
ft8af/​app/​src/​main/​res/​values-in/​strings_compose.xml Adds Indonesian text.
ft8af/​app/​src/​main/​res/​values-fr/​strings_compose.xml Adds French text.
ft8af/​app/​src/​main/​res/​values-es/​strings_compose.xml Adds Spanish text.
ft8af/​app/​src/​main/​res/​values-cs/​strings_compose.xml Adds Czech text.
ft8af/​app/​src/​main/​res/​values-ar/​strings_compose.xml Adds Arabic text.
ft8af/​app/​src/​main/​kotlin/​radio/​ks3ckc/​ft8af/​ui/​settings/​TransmissionSettings.kt Adds the frequency-floor picker.
ft8af/​app/​src/​main/​java/​com/​k1af/​ft8af/​GeneralVariables.java Holds the shared floor setting.
ft8af/​app/​src/​main/​java/​com/​k1af/​ft8af/​ft8transmit/​FT8TransmitSignal.java Wires the floor into automatic offsets.
ft8af/​app/​src/​main/​java/​com/​k1af/​ft8af/​ft8transmit/​ClearFrequencyFinder.java Restricts candidates and adjusts tie-breaking.
ft8af/​app/​src/​main/​java/​com/​k1af/​ft8af/​database/​DatabaseOpr.java Restores and clamps persisted values.
docs/​clear-cq-slot-selection.md Documents the floor and exceptions.

Review effort: Balanced

Comment on lines +2989 to +2993
if (result != null) {
try {
GeneralVariables.minAutoTxFreqHz =
com.k1af.ft8af.ft8transmit.ClearFrequencyFinder.clampMinAutoTxHz(
Integer.parseInt(result.trim()));
Comment on lines 2673 to +2675
Float pick = clearFrequencyFinder.selectClearOffset(
GeneralVariables.getBaseFrequency());
GeneralVariables.getBaseFrequency(),
GeneralVariables.minAutoTxFreqHz);
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