Skip to content

westphae/selcald

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

selcald

Selcal decoder daemon

A Linux/BSD daemon that monitors an audio stream and looks for selcal (Selective Calling; see https://en.wikipedia.org/wiki/SELCAL) calls and emits a timestamp, followed by the selcal code received. The daemon is intended to be as simple and lightweight as possible, and should rely on existing frameworks such as fftw where possible.

Selective Calling (SELCAL)1

SELCAL is a technique that allows a ground radio operator to alert an aircrew that the operator wishes to communicate with that aircraft.

Because of the background noise level experienced on HF radio frequencies, aircrews usually prefer to turn down the audio level of their HF receiver until alerted via SELCAL of a message specifically intended for their aircraft. When the ground station operator wishes to communicate with an aircraft, he enters into the SELCAL encoder the 4-letter code of that aircraft, which is usually included in its flight plan, and transmits that code over the assigned radio channel. All aircraft monitoring that channel receive the SELCAL broadcast, but only those (preferably only one) that have been programmed with that 4-letter code will respond by sounding a chime or otherwise alerting the crew. The crew will then set their volume control higher to listen to the voice traffic and, using ICAO recommended radio procedures, assure that the message is intended for them.

Selcal Specification[2]

The official specification for the selcal system is found in "ARINC Characteristic 714-6-1990", published on August 15, 1990. The key attributes of selcal codes are as follows:

General

Selective calling is accomplished by the coder of the ground transmitter sending coded tone pulses to the aircraft receiver and decoder. Each transmitted code is made up of two consecutive tone pulses, with each pulse containing two simultaneously-transmitted tones.

Transmitted Code

When the ground operator desires to call a particular aircraft, he depresses the buttons corresponding to the code assigned to that aircraft. The coder then keys the transmitter on the air causing to be transmitted two consecutive tone pulses of 1.0 +/- 0.25 sec. duration, separated by an interval of 0.2 +/- 0.1 sec. which makes up the code. Each tone pulse consists of two simultaneously-transmitted tones. The call should consist of one transmitted code without repetition.

Stability

The frequency of transmitted codes should be held to +/- 0.15% tolerance to insure proper operation of the airborne decoder.

Distortion

Overall audio distortion present on the transmitted RF signal should not exceed 15%.

Percent Modulation

The RF signals transmitted by the ground radio station should contain within 3 dB of equal amounts of the two modulating tones. The combination of tones should result in a modulation envelope having a nominal modulation percentage of 90% and in no case less than 60%.

Transmitted Tones

Tone codes are made up of various combinations of the following tones and are designated by letter as indicated:

Note: The tones are spaced by 10**(0.045)-1 (approximately 10.9%)

DesignationFrequency (Hz)
A312.6
B346.7
C384.6
D426.6
E473.2
F524.8
G582.1
H645.7
J716.1
K794.3
L881.0
M977.2
P1083.9
Q1202.3
R1333.5
S1479.1

Table of Tone Frequencies and Derivation of the Frequencies

fN = 10**((N-1)*0.045+2). For the first tone, N=12, second N=13, etc.

DesignationLogFrequency (Hz)
A2.495312.6
B2.540346.7
C2.585384.6
D2.630426.6
E2.675473.2
F2.720524.8
G2.765582.1
H2.810645.7
J2.855716.1
K2.900794.3
L2.945881.0
M2.990977.2
P3.0351083.9
Q3.0801202.3
R3.1251333.5
S3.1701479.1

Signal Processing

Detection of the selcal tones is quite similar to DTMF tone detection, and this has been well documented. There are several approaches available:

  1. Bandpass filter bank and energy detectors (i.e. analog implementation approach)
  2. Discrete FFT and energy detection in bins containing selcal tones
  3. Goertzl algorithm for fast DFT (see https://en.wikipedia.org/wiki/Goertzel_algorithm)
  4. Chirp-Z transform for DFT (see https://en.wikipedia.org/wiki/Bluestein%27s_FFT_algorithm)
  5. MUSIC algorithm (see https://en.wikipedia.org/wiki/Multiple_signal_classification)
  6. ESPRIT algorithm (see https://en.wikipedia.org/wiki/Estimation_of_signal_parameters_via_rotational_invariance_techniques)
  7. Wavelet transform and convolution (seems highly advanced)

The implementation should take into account characteristics of the HF radio medium:

  • Often poor signal/noise ratio
  • Frequent ionospheric and auroral fading and flutter
  • Slight doppler due to relative ionospheric motion

These imply that unlike DTMF decoder implementations, a series of measurements should be made during the signal and a final decision determined from statistical analysis of the raw measurements.

The normal source of sampled audio is the soundcard interface. After some digging, it seems that PortAudio would be a good choice for an audio interface API, since it provides both a degree of platform independence and isolates the application from the various underlying audio frameworks (i.e. ALSA, Pulseaudio, SndKit, etc.). In general, lower sampling rates are preferred due to the reduced processing load, as are fixed point DSP implementations versus floating point implementations.

Pseudocode

Calculate numnber of samples per interval
While true
  Clear signal table
  set signal table row to 0
  read audio samples for one interval
  perform time to frequency conversion of samples
  add tones detected to signal table
  if two tones detected
    For remaining number of intervals
      increment signal table row
      read audio samples for one interval
      perform time to frequency conversion of samples
      add tones detected to signal table
    Read signal table and determine selcal code

References

[2]: "ARINC Characteristic 714-6-1990, chapter 2; August 15, 1990"

About

Selcal decoder daemon

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published