Skip to content

Alex-Pennington/PC-ALE

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

16 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

PC-ALE 2.0 - Open Source ALE for Amateur Radio

Build Status Tests C++17 License

Repository: https://github.com/Alex-Pennington/PC-ALE
Author: Alex Pennington, AAM402/KY4OLB
UI Concept: https://alex-pennington.github.io/pcale-ui-concept/
License: MIT

A modern, production-ready C++17 clean-room implementation of MIL-STD-188-141B Automatic Link Establishment (ALE) and FED-STD-1052 ARQ for HF radio systems.


🎯 Project Philosophy

This implementation is built entirely from public MIL-STD specifications, not derived from proprietary source code. Reference implementations are analyzed only for validation and understanding expected behavior, following clean-room engineering principles.

Key Principles:

  • βœ… Specification-first development
  • βœ… Modern C++17 standard library usage
  • βœ… Comprehensive unit testing (100% pass rate)
  • βœ… Zero dependencies on legacy code
  • βœ… Cross-platform (Windows, Linux, macOS, Raspberry Pi)
  • βœ… Production-ready architecture
  • βœ… Community-driven development

πŸš€ Quick Start

Build & Test

git clone https://github.com/Alex-Pennington/PC-ALE.git
cd PC-ALE
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build .
ctest --verbose  # All 91 tests should pass

Run Examples

./example_complete_stack      # Full 2G ALE demonstration
./example_aqc_usage           # AQC-ALE enhanced calling
./example_fs1052_transfer     # Reliable data transfer
./example_ale_decoder         # Basic ALE decoding

πŸ“Š Current Status

Phase Component Tests Status
1 8-FSK Modem Core 5/5 βœ… Complete
2 Word Structure & Protocol 5/5 βœ… Complete
3 Link State Machine 7/7 βœ… Complete
4 AQC-ALE Extensions 18/18 βœ… Complete
5 FS-1052 ARQ Protocol 19/19 βœ… Complete
6 LQA System 37/37 βœ… Complete
Total Complete Protocol Stack 91/91 100%

What's Left to Build

The protocol stack is complete. What remains are integration layers:

Module Purpose Status
Audio I/O Connect modem to soundcard (WASAPI/ALSA/CoreAudio) ❌ Needed
Radio CAT Tune radios during scanning (Icom, Yaesu, Kenwood, Elecraft) ❌ Needed
Qt6 UI Cross-platform user interface ❌ Needed
SDR Integration Direct SDR connection πŸ”„ In Progress

πŸ—οΈ Architecture: Protocol Stack + Platform Layer

PC-ALE 2.0 uses a two-repository architecture:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  PC-ALE (This Repository)                           β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚ Layers 3-7: ALE Protocol Stack                β”‚  β”‚
β”‚  β”‚ β€’ FS-1052 ARQ (Layer 4)                       β”‚  β”‚
β”‚  β”‚ β€’ ALE State Machine (Layer 3)                 β”‚  β”‚
β”‚  β”‚ β€’ 2G/AQC Protocol, LQA (Layer 3)              β”‚  β”‚
β”‚  β”‚ β€’ 8-FSK Modem, Golay FEC (Physical)           β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                   β”‚ Uses interfaces from
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  PC-ALE-PAL (Platform Abstraction Layer)            β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚ Layers 1-2: Hardware Abstraction Interfaces   β”‚  β”‚
β”‚  β”‚ β€’ IAudioDriver - Sound card I/O               β”‚  β”‚
β”‚  β”‚ β€’ IRadio - Frequency, mode, PTT, power        β”‚  β”‚
β”‚  β”‚ β€’ ITimer - Millisecond timing                 β”‚  β”‚
β”‚  β”‚ β€’ ILogger - Diagnostic output                 β”‚  β”‚
β”‚  β”‚ β€’ IEventHandler - Threading/callbacks         β”‚  β”‚
β”‚  β”‚ β€’ ISIS - Serial communication                 β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                   β”‚ Implemented by
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Platform-Specific Repositories (Community)          β”‚
β”‚  β€’ PC-ALE-Linux-DRAWS (ALSA, libgpiod)              β”‚
β”‚  β€’ PC-ALE-Windows (WASAPI, Hamlib)                  β”‚
β”‚  β€’ PC-ALE-RaspberryPi-Bare (Circle framework)       β”‚
β”‚  β€’ PC-ALE-SDR (SoapySDR/UHD implementation)         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Why Separate Repositories?

  • PC-ALE = Pure protocol stack (no OS dependencies)
  • PC-ALE-PAL = Interface contracts (what must be implemented)
  • Platform repos = Concrete implementations (ALSA, WASAPI, etc.)

This enables:

  • βœ… Same protocol code on Windows, Linux, macOS, bare metal
  • βœ… Multiple platforms can be developed in parallel
  • βœ… Clean separation: protocol maintainers don't need hardware expertise
  • βœ… Community can contribute platform ports without touching core

Get Started:

  1. Clone PC-ALE (protocol stack) - this repository
  2. Clone PC-ALE-PAL (interfaces)
  3. Clone or create a platform implementation (e.g., PC-ALE-Linux-DRAWS)
  4. Build and run!

πŸ“ Layer Details

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    APPLICATION LAYER                         β”‚
β”‚              (User Interface, Message Handling)              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                            β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                  DATA LINK LAYER (Phase 5)                   β”‚
β”‚     FS-1052 ARQ: Reliable transfer, ACK/NAK, Retransmit     β”‚
β”‚         (Control Frames, Data Frames, CRC-32)                β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                            β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   LQA SYSTEM (Phase 6)  β”‚  LINK ESTABLISHMENT (Phase 3)     β”‚
│   Channel quality       │  State Machine: IDLE→SCANNING→    │
│   Sounding analysis     │  CALLING→HANDSHAKE→LINKED         │
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                            β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚          PROTOCOL LAYER (Phases 2 & 4)                       β”‚
β”‚   2G ALE Words: Preamble + 21-bit Payload                   β”‚
β”‚   AQC-ALE Extensions: DE fields, CRC, Slotted Response      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                            β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              PHYSICAL LAYER (Phase 1)                        β”‚
β”‚   8-FSK Modem: 750-1625 Hz, 125 baud, Golay FEC             β”‚
β”‚   FFT Demodulator, Tone Generator, Symbol Decoder           β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

See docs/ARCHITECTURE.md for detailed documentation.


πŸ† Key Features

Phase 1: 8-FSK Modem (Physical Layer)

  • FFT-based demodulator with sliding 64-point FFT
  • 8 tone generator (750-1625 Hz, 125 Hz spacing)
  • Symbol-to-bits decoder with peak detection
  • Majority voting (3x redundancy error correction)
  • Extended Golay (24,12) encoder/decoder - 3-bit error correction

Phase 2: Protocol Layer

  • Word structure parser (preamble + 21-bit payload)
  • Preamble types: DATA, THRU, TO, TWS, FROM, TIS, CMD, REP
  • ASCII-64 character encoding/decoding
  • Address book with wildcard matching
  • Message assembly and call type detection

Phase 3: Link State Machine

  • 6 states: IDLE, SCANNING, CALLING, HANDSHAKE, LINKED, SOUNDING
  • Channel selection, scan list, dwell time management
  • Event-driven architecture with callbacks
  • Timeout handling (call, link, scan)

Phase 4: AQC-ALE Extensions

  • Data Element extraction (DE1-DE9)
  • 16 traffic classes (voice modes, data modes, email)
  • Transaction codes (ACK, NAK, TERMINATE)
  • CRC-8/CRC-16 orderwire protection
  • Slotted response timing (8 slots Γ— 200ms)

Phase 5: FS-1052 ARQ Protocol

  • Selective repeat ARQ with 256-bit ACK bitmap
  • CRC-32 frame protection
  • Automatic retransmission on timeout/NAK
  • Data rates: 75, 150, 300, 600, 1200, 2400, 4800 bps
  • Configurable window size and retry limits

Phase 6: LQA System

  • Persistent quality tracking (binary + CSV formats)
  • Time-weighted averaging, composite scoring (0-31)
  • SNR/BER/SINAD/multipath/noise floor metrics
  • Channel ranking and best channel selection
  • Sounding analysis and scheduling

πŸ“‹ Standards Compliance

Parameter Value Standard
ALE Standard MIL-STD-188-141B Appendix A 2G ALE
ARQ Standard FED-STD-1052 Data Link Protocol
Modulation 8-FSK (8 tones) 750-1625 Hz
Symbol Rate 125 baud 125 symbols/sec
Tone Spacing 125 Hz Narrowband HF
FEC Golay (24,12) 3-bit correction
Sample Rate 8000 Hz Audio sampling

πŸ› οΈ Libraries

The build produces these static libraries:

Library Purpose
libale_fsk_core.a 8-FSK modulation/demodulation
libale_fec.a Golay (24,12) error correction
libale_protocol.a Word parsing, messages, addressing
libale_link.a ALE state machine
libale_aqc.a AQC-ALE protocol extensions
libale_fs1052.a FS-1052 ARQ reliable data link
libale_lqa.a Link Quality Analysis system

πŸ§ͺ Testing

cd build
ctest --verbose

# Or run individual test suites:
./test_fsk_core          # Phase 1: FSK modem
./test_protocol          # Phase 2: Protocol parser
./test_state_machine     # Phase 3: State machine
./test_aqc_parser        # Phase 4: AQC-ALE
./test_aqc_crc           # Phase 4: CRC validation
./test_fs1052_frames     # Phase 5: Frame formatting
./test_fs1052_arq        # Phase 5: ARQ state machine
./test_lqa_database      # Phase 6: LQA database
./test_lqa_metrics       # Phase 6: Metrics collection
./test_lqa_analyzer      # Phase 6: Channel analysis

πŸ“š Documentation

Phase Documentation


🀝 Community-Driven Development

This project exists because:

  • ION2G has problems and limited development
  • PC-ALE 1.x is abandonware
  • MARS has excellent tools locked behind membership requirements
  • The ham community deserves modern, open, cross-platform ALE software

Ways to Contribute

Contribution Type What It Looks Like
Direct Funding Sponsor AI development costs via GitHub Sponsors
AI-Assisted Dev Use your own API access to implement features, submit PRs
Testing Beta test releases, report bugs, validate on your hardware
Documentation Write tutorials, improve guides
Hardware Loans Loan radios or SDRs for compatibility testing
OTA Testing Participate in on-air interop tests
Code Review Review pull requests, audit code quality

Funding

AI-assisted development has real compute costs. If you want to support continued development:

Method Link
GitHub Sponsors github.com/sponsors/Alex-Pennington
PayPal paypal.me/prior2fork

πŸ”§ Requirements

  • C++ Compiler: C++17 or later (GCC 7+, Clang 5+, MSVC 2017+)
  • CMake: 3.15 or later
  • Platform: Windows, Linux, macOS, Raspberry Pi

No external dependencies required for core functionality.


πŸ“„ License

MIT License - See LICENSE file for details.


πŸ™ Acknowledgments

This clean-room implementation references:

  • MIL-STD-188-141B - Official U.S. Department of Defense specification
  • FED-STD-1052 - HF Radio Data Link Protocol specification
  • LinuxALE (GPL) - Analyzed for validation purposes only
  • MARS-ALE - Design patterns studied, no code reused

PC-ALE 2.0 - Professional-grade HF radio ALE implementation
Built from specifications, designed for reliability, open to all


Alex Pennington, AAM402/KY4OLB
Contact: [email protected]
GitHub: github.com/Alex-Pennington

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published