electronic_eel has quit [Ping timeout: 256 seconds]
electronic_eel has joined #scopehal
Famine- has joined #scopehal
Famine has quit [Ping timeout: 260 seconds]
Nero_ has joined #scopehal
Nero_ is now known as NeroTHz
<_whitenotifier-3>
[scopehal-apps] azonenberg pushed 2 commits to master [+0/-0/±6] https://git.io/JJxvE
<_whitenotifier-3>
[scopehal-apps] azonenberg 4d68932 - Bugfixes to PickStepSize()
<_whitenotifier-3>
[scopehal-apps] azonenberg e83413e - Finally implemented proper "zoom to mouse" handling in WaveformArea
<azonenberg>
Hmmm. What should I call a filter in scopehal that generates a LO tone at a specified frequency and starting phase, then mixes it with a signal?
<azonenberg>
no decimation or filtering
<azonenberg>
"LO Mix"?
<Degi>
L0?
<Degi>
Ah, local oscillator?
<Degi>
Just call it "frequency generator"?
<Degi>
Hm maybe make one which has I/Q too
<Degi>
Or call it "converter"
<Degi>
Since it can be used to upconvert / downconvert a signal
<Degi>
Well, "frequency converter"
<azonenberg>
So I'm trying to generate and mix in one operation to be more efficient
<azonenberg>
But to do a full frequency conversion you will need to LPF and decimate
<azonenberg>
Which will be a separate filter
<azonenberg>
At least for now
<azonenberg>
I'm not going to put any time into optimizing it yet as i might be splitting/merging some of these filters
<Degi>
Whyd you need a LPF
<Degi>
Wouldnt an ideal IQ mixer be sufficient
<azonenberg>
Say I'm looking at a 2.4 GHz wifi signal and i mix it with a 2.2 GHz LO to downconvert
<azonenberg>
now i have my signal centered at 2.2 GHz, but there's still gonna be all kinds of other out of band garbage too
<azonenberg>
And for complex demodulation filters i probably don't want to be running at 10+ Gsps
<azonenberg>
So i need to decimate and doing that properly without aliasing means filtering
<azonenberg>
now i have my signal centered at 200 MHz*
<Degi>
Hm...
<Degi>
A tone at 2.41 GHz, would that turn to 210 and 190 MHz?
<Degi>
With an IQ mixer you could select only 210 or 190 MHz...
<azonenberg>
So my plan to do IQ is to just run two instances of the LO Mix filter
<Degi>
Hmh
<azonenberg>
one at phase 0 and one at 90
<NeroTHz>
if you work in the complex domain directly, you can achieve it with one, but that depends on how easy it is to program
<azonenberg>
NeroTHz: yeah right now scopehal doesnt have good handling of complex valued signals
<azonenberg>
i mean it fits in the architecture but i have no way to display it
<azonenberg>
So i'm planning to have two separate scalar valued streams for now
<Degi>
You could display it as 2 traces in one plot window with different colors
<azonenberg>
Yeah lots of possibilities. Right now i want to just get the basic math tested and working
<azonenberg>
We can worry about UI tweaks and efficiency later
<Degi>
Hm so the calculations are done on the GPU?
<azonenberg>
Right now all signal processing is CPU and rendering is GPU
<azonenberg>
that will change over time
<azonenberg>
as i push more and more signal processing to shaders
<Degi>
Yes, shaders would be good since you could use 2-vectors to represent complex values
<azonenberg>
well actually i think i would probably prefer two separate scalar values
<azonenberg>
at least for interfacing with CPU SIMD code
<Degi>
hmh
<azonenberg>
interleaved real+imaginary is a huge pain to deal with in SSE/AVX
<azonenberg>
since often you do separate things to each component or do things between components
<azonenberg>
e.g. sin and cos
<azonenberg>
having one vector of all real and one of all imaginary is much easier to work with
<azonenberg>
i actually have to shuffle FFT output from r-i-r-i to rrrr/iiii in two separate vectors before my avx code can process it
<_whitenotifier-3>
[scopehal] azonenberg 5640b19 - Initial implementation of DownsampleDecoder
<azonenberg>
monochroma: Oook so now i have the wifi signal downconverted to a 137 MHz center frequency https://www.antikernel.net/temp/wifi-if.png and decimated to 2 Gsps (could probably go further but i'm keeping this for now)
<azonenberg>
(Ignore the RBW on the waterfall, that's a bug i have to track down)
<monochroma>
nice!
<azonenberg>
So now i have to figure out how to extract individual OFDM channels from a single IF I/Q stream
<azonenberg>
((For now i'm only interested in pulling out a single channel, not everything)
<tnt>
down convert to 0 Hz IQ, find the symbol alignement, remove cyclic prefix, FFT there you go, you have the raw symbols. Find the closest reference one, and from their values vs the received one, equalize the symbols you want.
<azonenberg>
So downconvert all the way to 0 Hz on the leftmost subcarrier?
<azonenberg>
How do i find the symbol alignment before i fft?
<azonenberg>
I thought the idea was to FFT and get a stream of raw analog values, then find symbol boundaries on that by using a PLL or something
<azonenberg>
i.e. run the fft faster than the symbol rate
<tnt>
0 Hz to the center frequency (i.e. middle bin).
<azonenberg>
0 Hz to the *center* frequency?
<azonenberg>
So i have negative frequencies for half the bins?
<tnt>
yes
<tnt>
For alignement, good question. I know how it's done with LTE. Not sure sure what wifi OFDM uses for coarse alignement.
<azonenberg>
ok so i tweaked some display settings. I think i can see the preamble at the start? Symbol time is 3.6 us including guard interval so that would be 43.2 us for the entire preamble
<monochroma>
oooo that's looking better
<azonenberg>
monochroma: This is still the whole 20 MHz wide OFDM waveform though
<azonenberg>
i need to channelize it
<monochroma>
yeah but seeing the preamble is nice :P
<tnt>
So what you can do, is that the expected sync pattern, modulate it (to get time domain signal), then correlate and find the peak, that'll get you an initial alignement estimate and frequency error estimate.
<azonenberg>
So i have to know the preamble?
<tnt>
Yeah, it's fixed, in the spec most likely.
<azonenberg>
What i mean is, it's protocol dependent at this point?
<azonenberg>
i can't even get a constellation without knowing the preamble?
<tnt>
Yeah.
<azonenberg>
interesting
<tnt>
Ah ... huh.
<tnt>
So you can do so called "Non-Data-Aided" sync.
<azonenberg>
Because i'm trying to develop general RF analysis tools at this point
<azonenberg>
i dont want to be decoding the 802.11 link layer
<tnt>
(usually when you have known data, you use that, it's easier :p)
<azonenberg>
Yeah i specifically want to avoid that at the moment if possible
<tnt>
You can exploit the cyclic prefix to find how symbols are aligned.
<azonenberg>
so just autocorrelation, or what?
<tnt>
Yup basically.
<tnt>
you do need to know the FFT size and expected CP len though.
<azonenberg>
Yeah but that's easy to parameterize
<azonenberg>
why do i need to know the fft size to just find the symbol alignment? or is that only once i start channelizing?
<azonenberg>
it seems like all i should need to know for autocorrelation based sync is the prefix length and symbol rate
<tnt>
Well, not fft len per se. More like length in time of the symbol
<tnt>
(it's just usually you do OFDM with sample rate specifically chosen so "all works out neatly")
<azonenberg>
Makes sense
<azonenberg>
In the case of the wifi signal i'm looking at in particular, the symbol duration is 3.6 us including 400ns guard interval, so 3.2us for actual symbol content
<azonenberg>
FFT 64, 52 data subcarriers, 4 pilot tones
<azonenberg>
and i guess the other 8 are unused?
<tnt>
Yeah usually the center one is not used (DC offset) and then there are some on the edge not used either.
<monochroma>
guard bands?
<Degi>
Debugging a SERDES with a 70 MHz scope is weird
<miek>
don't you have a 350MHz scope? :p
<Degi>
Wellll that requires me to upgrade it which I've not done yet lol
<Degi>
I find it relatively impressive that I can see 625 MHz on it
<Degi>
1696 MHz is below noise floor
<Degi>
937 MHz is barely visible
juli965 has joined #scopehal
<Degi>
What do I wanna use for SDR on linux
<miek>
what do you want to do?
<Degi>
Look at a spectrum to see frequenyc
<Degi>
Nvm I figured out how to use the builtin sdr of this thing
<Degi>
Geez, SERDES sure is noisy
bvernoux has quit [Read error: Connection reset by peer]
_whitelogger has joined #scopehal
<Degi>
*FPGA PLL
NeroTHz has quit [Quit: Leaving]
<_whitenotifier-3>
[scopehal] azonenberg pushed 2 commits to master [+4/-0/±6] https://git.io/JJhdh
<_whitenotifier-3>
[scopehal] azonenberg 0b872e1 - Initial implementation of MagnitudeDecoder
<_whitenotifier-3>
[scopehal] azonenberg 7475de6 - Initial version of AutocorrelationDecoder
Bird|otherbox has quit [Remote host closed the connection]