From: Simon Wunderlich <simon.wunderlich@s2003.tu-chemnitz.de>
To: Adrian Chadd <adrian@freebsd.org>
Cc: Felix Fietkau <nbd@openwrt.org>,
Simon Wunderlich <simon.wunderlich@s2003.tu-chemnitz.de>,
linux-wireless@vger.kernel.org, linville@tuxdriver.com,
johannes@sipsolutions.net, ath9k-devel@lists.ath9k.org,
rodrigue@qca.qualcomm.com, zefir.kurtisi@neratec.com,
jonbither@gmail.com, jouni@qca.qualcomm.com,
kgiori@qca.qualcomm.com, mathias.kretschmer@fokus.fraunhofer.de,
Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Subject: Re: [RFCv2] Add spectral scan support for Atheros AR92xx/AR93xx
Date: Mon, 17 Dec 2012 14:22:32 +0100 [thread overview]
Message-ID: <20121217132232.GA447@pandem0nium> (raw)
In-Reply-To: <CAJ-Vmo=qWihSMZ3Jwb9NGU_uXSGYd-Nxya+oT0MQdoT6r0JZFw@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 3294 bytes --]
Hello Adrian,
thank you for posting this and the explanation!
On Sat, Dec 15, 2012 at 08:06:47PM -0800, Adrian Chadd wrote:
> The formats are as follows. Please note that if a pulse terminates
> during an FFT, the final entry may be truncated. So yes, you may not
> always get an integer multiple of the relevant frame length.
OK - my data is mostly in the range of 55-58 bytes (see below), sometimes
I got some longer packets, but I'm currently dropping them.
The variation still puzzles me though.
>
> Note that you shift each of the readings by max_exp to get a total
> reading. max_index and max_magnitude I think are just derived from the
> existing dataset; they're just a shortcut for software so it doesn't
> have to parse the whole frame looking for the peak.
Ah ok, that makes sense. Thanks for the clarification. :)
>
> Static 20 mode:
>
> 0 bin -28 magnitude[7:0] = (|i| + |q|) >> max_exp
> 1 bin -27 magnitude[7:0] = (|i| + |q|) >> max_exp
> 2 - 53 …
> 54 bin 26 magnitude[7:0] = (|i| + |q|) >> max_exp
> 55 bin 27 magnitude[7:0] = (|i| + |q|) >> max_exp
I've checked my data again: On my AR9280 in 2.4GHz, I get 55 or 57 bytes plus
7 "special bytes" (4 bytes meta info plus 3 bytes "radar trailer?"). In 5 GHz
and on my AR9380 in both bands, it is always either 56 or 58 bytes. The number
of bytes comes from rs_datalen from the rx_status struct as found in the patch
sent earlier.
So to summarise, what I currently get:
* 55-58 bytes of "data"
* 4 bytes of meta-information (as you provided)
* 3 bytes of "radar trailer" (bwinfo and such)
The variation in the data puzzles me, I've already checked bit 4 in bwinfo
as Felix suggested. Is there any other "header" to the DFS data? Or should I
just skip the first few bytes and always use the last 55 bytes? At least from the
distribution, all of these numbers look like normal data and not a bitfield.
Ideas welcome. :)
I've also noticed that the middle of the data (like data[28]) is usually higher
than the rest - this might be the carrier, or something alike?
> 56 [7:0]: all bins {max_magnitude[1:0], bitmap_weight[5:0]}
> 57 [7:0]: all bins max_magnitude[9:2]
> 58 [7:0]: all bins {max_index[5:0], max_magnitude[11:10]}
> 59 [3:0]: max_exp (shift amount to size max bin to 8-bit unsigned)
>
> Dynamic 20/40 mode:
>
> 0 bin -64 magnitude[7:0] = (|i| + |q|) >> max_exp or power (in dBm)
> 1 bin -63 magnitude[7:0] = (|i| + |q|) >> max_exp or power (in dBm)
> 2 - 125 …
> 126 bin 62 magnitude[7:0] = (|i| + |q|) >> max_exp or power (in dBm)
> 127 bin 63 magnitude[7:0] = (|i| + |q|) >> max_exp or power (in dBm)
> 128 [7:0]: lower bins {max_magnitude[1:0], bitmap_weight[5:0]}
> Baseband DFS 2 (Radar) Micro-Architecture
> 129 [7:0]: lower bins max_magnitude[9:2]
> 130 [7:0]: lower bins {max_index[5:0], max_magnitude[11:10]}
> 131 [7:0]: upper bins {max_magnitude[1:0], bitmap_weight[5:0]}
> 132 [7:0]: upper bins max_magnitude[9:2]
> 133 [7:0]: upper bins {max_index[5:0], max_magnitude[11:10]}
> 134 [3:0]: max_exp (shift amount to size max bin to 8-bit unsigned)
Thanks again, also for posting the radar packet format! I'll play a little bit more
with spectral for now ...
Cheers,
Simon
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
next prev parent reply other threads:[~2012-12-17 13:22 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-06 16:36 [RFCv2] Add spectral scan support for Atheros AR92xx/AR93xx Simon Wunderlich
2012-12-06 16:36 ` [RFCv2] ath9k: add spectral scan feature Simon Wunderlich
2012-12-13 14:07 ` [RFCv2] Add spectral scan support for Atheros AR92xx/AR93xx Simon Wunderlich
2012-12-13 17:25 ` Felix Fietkau
2012-12-13 22:06 ` Simon Wunderlich
2012-12-13 23:04 ` Felix Fietkau
2012-12-14 0:24 ` Tobias Steinicke
2012-12-14 0:30 ` Adrian Chadd
2012-12-16 3:48 ` Adrian Chadd
2012-12-16 4:06 ` Adrian Chadd
2012-12-17 13:22 ` Simon Wunderlich [this message]
2012-12-17 18:48 ` Adrian Chadd
2012-12-18 11:08 ` Zefir Kurtisi
2012-12-18 13:46 ` Simon Wunderlich
2012-12-18 16:02 ` Zefir Kurtisi
2012-12-28 3:11 ` Adrian Chadd
2012-12-31 5:33 ` Adrian Chadd
2012-12-31 8:46 ` Simon Wunderlich
2012-12-31 14:38 ` Adrian Chadd
2012-12-31 7:48 ` Adrian Chadd
2012-12-31 8:40 ` Simon Wunderlich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20121217132232.GA447@pandem0nium \
--to=simon.wunderlich@s2003.tu-chemnitz.de \
--cc=adrian@freebsd.org \
--cc=ath9k-devel@lists.ath9k.org \
--cc=johannes@sipsolutions.net \
--cc=jonbither@gmail.com \
--cc=jouni@qca.qualcomm.com \
--cc=kgiori@qca.qualcomm.com \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=mathias.kretschmer@fokus.fraunhofer.de \
--cc=nbd@openwrt.org \
--cc=rodrigue@qca.qualcomm.com \
--cc=siwu@hrz.tu-chemnitz.de \
--cc=zefir.kurtisi@neratec.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).