NOTE: this page is for archival only, see the note at the end of the page.

ath9k spectral scan:

Atheros 802.11n chipsets include a built-in spectral analysis feature. AR92xx and AR93xx have the ability to report FFT data from the baseband under software controlled conditions, including:

  • absolute magnitude (|i|+|q|, abs() for I/Q phase of the wireless signal) for each FFT bin (56 for subcarriers in HT20 mode and 128 in HT40 mode)
  • an index indicating the strongest FFT bin
  • the maximum signal magnitude for each sample

These information can be used to create an open source spectrum analyzeror interference classifier

Spectral scan parameters:

  • fft_period: when active and triggered, PHY passes FFT frames to MAC every (fft_period+1)*4uS
  • period: when active, time period between successive spectral scan entry points (period*256*Tclk). Tclk = 44MHz for HT20 operation, 88MHz for HT40 operation
  • count: number of scan results requested. There are special meanings in some chip revisions:
    • AR92xx: highest bit set (>=128) is interpreted as "never disable"

    • AR9300 and newer: 0 is interpreted as "never disable"
  • short_repeat: controls whether the chip is in spectral scan mode for 4 usec (enabled) or 204 usec (disabled)

Frame format:

Riceved power computation:

Assuming the noise floor is equal to -96dbm(*) and the magnitude of each sample in a 20MHz bin equals the RSSI, the received signal strength of each FFT bin on HT20 channel can be computed as follow:

  • RSSI is computed on control chain 0
  • b(i) is the magnitude in each bin, unscaled by max_exp
  • bin_sum = 10*log(sum[i=1..56](b(i)^2)

For 40MHz channel, previous formula should be used for 64 bins of control and extension channels, keeping in mind for HT40+ mode the extension channel is above the primary one (lower=ctl, upper=ext) and for HT40- the extension channel is below the primary one (lower=ext, upper=ctl)(*) nf can differ from -96dbm due to noise and spikes leading to a reduced reported RSSI

Userspace programs:

FFT samples gathered from Atheros NICs could be drawn using userspace programs:

(this page is based on Adrian Chadd's documentation https://wiki.freebsd.org/dev/ath_hal%284%29/SpectralScan)


This is a static dump of the old wiki, taken after locking it in January 2015. The new wiki is at https://wireless.wiki.kernel.org/.
versions of this page: last, v9, v8, v7, v6, v5, v4, v3, v2, v1