Im trying to use GNUradio 3.8 with an sdr to pick up some wifi packets 2.4 and 5 GHz but im seeing a ton of dropped samples from my sdr. Im wondering if my dropped samples have to do with the sample rate. Ive seen online sdrs have a mixer that downconvert the frequency band to baseband and then its sampled. But i believe one cannot configure arbitrary sample rates, as the receiver expects a given number of samples per symbol. Is this correct. If im trying to sample 2.4Ghz and 5Ghz a/b/g/n how do i figure out my sample rate/dropped samples issue. Thanks
At the very least, you'll need a sampling rate that's high enough to capture the full bandwidth of your Wifi transmission. In a typical WiFi receiver, that puts the sample rate at exactly the OFDM width: 5, 10, 20 or 40 MHz, depending on your Wifi.
Your dropped samples simply happen because your computer isn't fast enough to keep up with that many samples per second. There's only two solutions to that:
- Get a faster computer
- Make your computer do less per sample.
Also note that the sustained write rates of permanent storage devices can be lower than your sample data rate, so even just writing to disk can be a fatal bottleneck.
Sadly, we don't know the processing you're currently doing, but maybe have a look at gr-ieee802-11, which is optimal enough that a modern midrange laptop can receive 20 MHz wide Wifi with it, continuously.
Ive seen online sdrs have a mixer that downconvert the frequency band to baseband and then its sampled
I think your question can be answered by clearing up the misunderstanding that made you write this part of your question.
All data captured by an SDR is translated down from its original frequency down to being centred around a frequency of 0 Hertz (sometimes called DC).
If you tune to 100MHz, and sample at 2Msps, then you get the chunk of spectrum between 99 and 101MHz, and it gets delivered to you as -1MHz to +1MHz. That is, centered around zero.
"Negative frequency" is a mathematical artefact, and you'll get used to it. Obviously there's no physical pendulum, or clock, that ticks with a negative frequency.
Wifi is between 20 and 160MHz wide, depending on channel width. If you have fewer than 20Msps then you cannot decode a 20MHz channel. The information just isn't there. Just like how you can't hear an FM radio signal if you put a very narrow 100Hz filter in your receiver. You can still decode morse code, but not a broadcast FM signal. (of course analog signals don't just disappear, but degrade, as you see less and less of the spectrum)
So no, if you don't process at least 20Msps, then you cannot decode a 20MHz signal.
This is getting less true with Wifi 6, which uses OFDM. OFDM is lots of separate signals, all much smaller than 20MHz, each carrying data that you can decode. Because the signals then are each smaller than 20MHz. But if you don't capture the whole 20MHz spectrum, then you can't decode all of them.
But yeah, sounds like you need more CPU power. Make sure you're not using a rate higher than you need, and reduce the rate earlier in the flowgraph, where possible.