Skip to main content

Overview

minimodem uses confidence values to measure signal quality and determine whether a valid FSK frame has been detected. Two key parameters control this behavior:
  • --confidence (-c): Minimum confidence threshold (SNR-like squelch)
  • --limit (-l): Maximum confidence search limit (performance vs. quality trade-off)
Adjusting these values allows you to optimize minimodem for different signal conditions, from clean studio-quality audio to noisy real-world environments.

Confidence Values Explained

The confidence value is an SNR-like (Signal-to-Noise Ratio) measurement that indicates how clearly the FSK signal can be distinguished from noise. Higher values indicate cleaner signals.
  • Typical clean signal: confidence ≥ 3.0
  • Marginal signal: confidence 1.5-3.0
  • Noisy/weak signal: confidence < 1.5
Confidence is not a standardized dB measurement, but rather an internal metric specific to minimodem’s FSK decoder.

Command-Line Options

—confidence (threshold)

Sets the minimum confidence required to accept a frame as valid. Syntax:
minimodem --rx --confidence <value> <baudmode>
Default value: 1.5 From source code (src/minimodem.c line 519):
float fsk_confidence_threshold = 1.5;

Examples

Strict threshold for clean signals:
minimodem --rx --confidence 2.5 1200
Relaxed threshold for noisy signals:
minimodem --rx --confidence 0.8 1200
Very relaxed for extremely weak signals:
minimodem --rx --confidence 0.5 300
Setting confidence too low will cause minimodem to decode noise as data, producing garbage output. Start with the default and adjust downward only if necessary.

—limit (search limit)

Sets the maximum confidence at which to stop searching for a better frame. Syntax:
minimodem --rx --limit <value> <baudmode>
Default value: 2.3 From source code (src/minimodem.c line 528):
float fsk_confidence_search_limit = 2.3f;

How It Works

When decoding each frame, minimodem:
  1. Scans through possible frame positions
  2. Calculates confidence for each position
  3. Stops searching when it finds a frame with confidence > search limit
  4. Uses the best frame found
  • Lower limit: Faster performance, but may miss optimal frame position
  • Higher limit: Better decode quality for difficult signals, slower performance
  • INFINITY: Always finds the absolute best frame (slowest)

Examples

Fast decoding (lower quality):
minimodem --rx --limit 1.8 1200
High quality decoding (slower):
minimodem --rx --limit 5.0 300
Optimal frame search (slowest):
minimodem --rx --limit inf 300
The --limit parameter has dramatic effects on CPU usage. For real-time decoding of noisy signals or slow baud rates (like Bell 103), increase the limit. For clean high-speed signals, keep it low.

Relationship Between Parameters

The confidence threshold and search limit work together:
// From src/minimodem.c line 964
if ( fsk_confidence_search_limit < fsk_confidence_threshold )
    fsk_confidence_search_limit = fsk_confidence_threshold;
The search limit is automatically adjusted to be at least as high as the confidence threshold.

Practical Use Cases

Clean Audio File Decoding

For high-quality recordings with minimal noise:
minimodem --rx -f clean_recording.wav --confidence 2.0 --limit 2.5 1200

Real-Time Radio Reception

For noisy radio signals with fading:
minimodem --rx --confidence 1.0 --limit 3.5 300

Weak Signal DX (Long Distance)

For extremely weak signals at the edge of detectability:
minimodem --rx --confidence 0.7 --limit 5.0 --bandwidth 30 45.45

High-Speed Clean Signals

Optimized for performance with clean high-speed data:
minimodem --rx --confidence 2.5 --limit 2.5 1200

Bell 103 or Skewed Rates

For difficult-to-decode signals requiring careful frame alignment:
minimodem --rx --confidence 1.2 --limit 4.0 300
Bell 103 (300 bps) typically requires higher search limits due to its longer bit periods and lower frequency shift, making frame alignment more critical.

NOCARRIER Report

When a carrier is lost, minimodem prints a summary including average confidence:
### NOCARRIER ndata=42 confidence=2.847 ampl=0.234 bps=1200.00 ###
This shows:
  • ndata: Number of frames decoded
  • confidence: Average confidence across all frames
  • ampl: Average signal amplitude
  • bps: Effective throughput (should match baud rate)
Monitor the confidence values in NOCARRIER reports to tune your threshold settings. If average confidence is much higher than your threshold, you can increase the threshold to reject more noise.

No-Confidence Handling

From src/minimodem.c line 1290:
#define FSK_MAX_NOCONFIDENCE_BITS 20
If confidence remains below threshold for more than 20 consecutive frames, minimodem:
  1. Drops the carrier
  2. Prints the NOCARRIER report
  3. Returns to carrier search mode

Performance Implications

CPU Usage vs. Search Limit

Search LimitCPU UsageQuality
1.5LowBasic
2.3 (default)MediumGood
5.0HighBetter
infVery HighBest

Confidence Threshold Impact

  • Higher threshold: Fewer false positives, may miss weak signals
  • Lower threshold: More tolerance for noise, more false positives

Advanced Tuning

Finding Optimal Values

  1. Start with defaults: Test with --confidence 1.5 --limit 2.3
  2. Monitor NOCARRIER: Check average confidence values
  3. Adjust threshold: Set slightly below average confidence
  4. Tune limit: Increase if frames are misaligned or output is garbled

Signal Analysis

Use quiet mode to see only confidence reports:
minimodem --rx -q --print-eot 1200 2>&1 | grep -E "CARRIER|NOCARRIER"
Output:
### CARRIER 1200 @ 1200.0 Hz ###
### NOCARRIER ndata=156 confidence=3.124 ampl=0.456 bps=1200.12 ###

Amplitude Considerations

Low amplitude can cause low confidence. Increase volume:
minimodem --rx --volume 2.0 --confidence 1.2 1200
The --volume option only affects transmission. For receive, adjust your audio input levels using system controls or mixer settings.

Implementation Details

Frame Search Algorithm

From src/minimodem.c line 1265:
confidence = fsk_find_frame(fskp, samplebuf, expect_nsamples,
        try_first_sample,
        try_max_nsamples,
        try_step_nsamples,
        try_confidence_search_limit,
        carrier ? expect_data_string : expect_sync_string,
        &bits,
        &amplitude,
        &frame_start_sample
        );
The decoder:
  1. Searches multiple frame positions (default: 3 steps)
  2. Evaluates confidence at each position
  3. Stops early if confidence exceeds search limit
  4. Returns the best frame found

Fine Frame Refinement

When carrier is acquired or confidence drops, minimodem performs a fine search with 8 steps instead of 3:
// From src/minimodem.c line 1365
#define FSK_ANALYZE_NSTEPS_FINE 8
This ensures optimal frame alignment at critical moments.

Troubleshooting

No Output Despite Visible Signal

Problem: minimodem detects carrier but produces no output Solutions:
  1. Lower confidence threshold: --confidence 1.0
  2. Increase search limit: --limit 4.0
  3. Check frequency settings: Verify --mark and --space
  4. Adjust bandwidth: Try --bandwidth to widen or narrow filter

Excessive Garbage Output

Problem: minimodem outputs random characters when no signal is present Solutions:
  1. Raise confidence threshold: --confidence 2.0
  2. Use auto-carrier: Add --auto-carrier to suppress noise
  3. Check input level: Reduce input gain to avoid clipping

Intermittent Decoding

Problem: Some frames decode correctly, others are lost Solutions:
  1. Increase search limit: --limit 3.0
  2. Lower threshold slightly: --confidence 1.2
  3. Monitor confidence: Check NOCARRIER reports for patterns
  4. Check for interference: Verify clean audio path

Slow Performance

Problem: minimodem uses excessive CPU Solutions:
  1. Decrease search limit: --limit 2.0
  2. Use faster baud rate if possible
  3. Reduce sample rate: --samplerate 24000 (for high-speed modes)

Best Practices

  • Start conservative: Begin with default values
  • Measure first: Use NOCARRIER reports to understand your signal
  • Adjust incrementally: Change one parameter at a time
  • Document settings: Keep notes on what works for specific use cases
  • Test both ends: Verify TX and RX configurations match

See Also

Build docs developers (and LLMs) love