azonenberg changed the topic of #scopehal to: libscopehal, libscopeprotocols, and glscopeclient development and testing |,, | Logs:
Degi has quit [Ping timeout: 256 seconds]
Degi has joined #scopehal
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]
<_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
bvernoux has joined #scopehal
<azonenberg> Mixing the ~2.437 GHz RF with a 2.3 GHz LO, we get our IF centered at 137 MHz, plus an image at 4.73 GHz that has to get filtered off
<Degi> Hm yes
<Degi> When the input is HPF to be completely above the LO, then the output signal should just be a downshifted spectrum...
<Degi> Its only a problem when the LO is inside of the input signal spectrum...
<azonenberg> Anyway, I need to decimate anyway for efficiency reasons
<azonenberg> so a filter before that isn't a huge deal
<Degi> Is the IF in 20 GS/s too
<azonenberg> The IF is implicit right now, i literally multiply each sample by sin(lo_rad_per_sample*timestamp + lo_phase_rad
<azonenberg> so it never actually exists as a signal
<Degi> Hehe, what if you keep bandwidth-limited signals in the frequency domain and for decimation just take the frequency range of concern xD
<azonenberg> i'm basically DDSing as i go
<azonenberg> I actually thought about a FFT based downconversion lol
<azonenberg> no idea how well it would work and for now i'm doing a more conventional strategy
<Degi> Hm not very efficient haha
<azonenberg> Well... it would also let you pull out all of the OFDM subcarriers
<azonenberg> So it might actually work well for that. But i'd rather be FFTing the IF rather than 20 Gsps data
<Degi> You'd need 'bandwidth * samples' of complexity, while this one only has 'samples' of complexity
<azonenberg> anyway I have a sinc interpolation filter for upsampling already so it's about time i had a downsampling filter too
<Degi> Oh nice, sinc
<bvernoux> very strange the Arduino license
<bvernoux> they say it is CC BY SA
<bvernoux> but they only provide schematic in PDF
<bvernoux> They shall provide original files IIRC for CC BY SA
<bvernoux> and not just a PDF ...
<azonenberg> The license doesn't obligate them to provide source
<bvernoux> ha really ?
<azonenberg> it's totally possible to release something as GPL where the "something" is decompiled assembly
<bvernoux> it is not open hardware in that case ;)
<azonenberg> now, if that assembly is based on source code that was also GPL'd you're not compliant
<bvernoux> the aim of CC BY SA is to reuse/modify the design ;)
<azonenberg> Yeah
<bvernoux> so a PDF does not allow that ;)
<azonenberg> What i mean is, you can release anything you own the copyright to under any license you want
<azonenberg> and this doesn't force you to release a more editable version
<bvernoux> so Arduino stuff are just bullshit open hardware license ;)
<Degi> yes
<azonenberg> i can release code in the public domain but put it inside a locked safe and not tell anyone the combo
<bvernoux> haha
<azonenberg> and it's still technically public domain if you can get to it :p
<bvernoux> even my license CC BY NC is better in that case
<bvernoux> as I provide original files on Eagle (for old stuff) and KiCad with BOM and everything to build it
<bvernoux> even if NC forbid to sell the hardware for commercial use ...
<bvernoux> it is just to protect a bit my production which is very costly ...
<bvernoux> it is just intended to "lock" cloner which do nothing on the project except they produce and sell the HW at ultra low cost ...
<bvernoux> A bit what happen on NanoVNA 2
<bvernoux> but they have used an open license which allow anyone to build and sell NanoVNA 2
<bvernoux> which impact their R&D now as some company sell NanoVNA 2 at much lower price (not fair) than the original ...
<bvernoux> It is why Open Source Hardware sometime can kill your own buisness ...
<bvernoux> Except on complex products like HackRF where it is impossible to produce them as lot of chipset are impossible to buy in low quantity ..
_whitelogger has joined #scopehal
<_whitenotifier-3> [scopehal] azonenberg pushed 2 commits to master [+4/-0/±6]
<_whitenotifier-3> [scopehal] azonenberg f00c7ec - Initial implementation of "LO Mix" filter
<_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 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> this is after mixing the channel 6 signal with 2.437 GHz in two phases and decimating by 10x
<tnt> Looks like the bursts have a 12 symbol long preamble.
<tnt> (for sync)
<Degi> Ooooh nice
<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]
<_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]
Bird|otherbox has joined #scopehal
<apo> Degi: gqrx works well for me
<apo> Degi: well, gqrx + :p
<Degi> Hm yes I've installed it...
Famine- has quit [Ping timeout: 240 seconds]
Famine has joined #scopehal
Famine- has joined #scopehal
Famine has quit [Ping timeout: 240 seconds]
elms has quit [Ping timeout: 260 seconds]
elms has joined #scopehal