Overview
Minimodem uses Frequency Shift Keying (FSK) modulation to encode digital data as audio tones. FSK is a form of frequency modulation where binary data is represented by shifting between two distinct frequencies.How FSK Works
In FSK modulation, digital bits are represented by two different frequencies:- Mark frequency (f_mark): Represents binary
1 - Space frequency (f_space): Represents binary
0
The terms “mark” and “space” originate from telegraphy, where “mark” meant current flowing (line closed) and “space” meant no current (line open).
Signal Representation
Frequency Detection
Minimodem uses FFT (Fast Fourier Transform) analysis to detect FSK signals. The process involves:- Sampling: Audio input is sampled at a configurable rate (default 48000 Hz)
- FFT Analysis: Samples are transformed into frequency bands
- Band Detection: The magnitude of mark and space frequency bands are compared
- Bit Determination: The frequency with higher magnitude determines the bit value
The FSK implementation is in
src/fsk.c:fsk_bit_analyze() which uses FFTW3 library for FFT computation.FSK Plan Structure
The FSK decoder maintains a “plan” structure containing:| Parameter | Description |
|---|---|
sample_rate | Audio sample rate (e.g., 48000 Hz) |
f_mark | Mark frequency in Hz |
f_space | Space frequency in Hz |
band_width | Filter bandwidth for frequency detection |
b_mark | Mark frequency band index in FFT |
b_space | Space frequency band index in FFT |
Confidence Calculation
Minimodem calculates a confidence value for each decoded frame based on:- Signal-to-Noise Ratio (SNR): Ratio of signal magnitude to noise magnitude
- Bit Consistency: How consistently bits match expected signal characteristics
- Amplitude Stability: Variations in signal strength across the frame
divergence measures how much individual bits deviate from average signal characteristics.
Confidence Thresholds
Confidence Thresholds
- Default minimum confidence: 1.5 (configurable with
-coption) - Confidence search limit: 2.3 (configurable with
-loption) - Values range from 0.0 (no confidence) to INFINITY (perfect signal)
Frequency Shift Examples
Different protocols use different frequency shifts:Bell 103 (300 bps)
- Mark: 1270 Hz
- Space: 1070 Hz
- Shift: 200 Hz
Bell 202 (1200 bps)
- Mark: 1200 Hz
- Space: 2200 Hz
- Shift: -1000 Hz
RTTY (45.45 bps)
- Mark: 1585 Hz (default)
- Space: 1415 Hz
- Shift: -170 Hz
TDD/TTY (45.45 bps)
- Mark: 1400 Hz
- Space: 1800 Hz
- Shift: 400 Hz
Inverted Frequencies
Some applications require inverted FSK, where mark and space frequencies are swapped:Custom Frequencies
You can specify custom mark and space frequencies:Technical Details
FFT Configuration
The FFT size and number of bands are calculated as:Magnitude Calculation
The magnitude of each frequency band is computed using:re and im are the real and imaginary FFT components, and scalar normalizes based on sample count.
See Also
- Baud Rates - Understanding data transmission rates
- Protocols - Supported FSK protocols