Understanding satnogs-flowgraphs
I'm not entirely sure where to put this, but perhaps someone more experienced can move and link this from a sensible location. This started as a question continuing the How to open satnogs iq.dat files thread but as I worked through after picking things up after initially having a problem I realised everything I'd described now magically worked! Typical. Worth documenting.
Contents
Setting yourself up
See elsewhere, but get GNU Radio up and running and a copy of satnogs-flowgraphs from GitLab.
I'm using a virtual Ubuntu 19.10 machine grabbed from osboxes.org, but you can use whatever you like. I imagine you could even do it on the Raspberry Pi itself. I did end up setting this VM up as a 'development station' but you should only need to install GNU Radio, and any pre-requisites needed by satnogs-flowgraphs - so probably gr-satnogs, I can't quite remember. As you find out please edit this :-)
Storing an IQ recording
There are options in satnogs-setup under Advanced > Radio to store IQ files:
- ENABLE_IQ_DUMP: Enable IQ dump
- IQ_DUMP_FILENAME: Define IQ dump filename [/tmp/.satnogs/iq.raw]
Beware, IQ files are huge (220MB for my APT pass example below). They're stored in /tmp so therefore in RAM and are overwritten with each pass. You can do something clever to upload them elsewhere, but for playing just grab a copy immediately after a pass.
Don't worry about storing much else (which also vanishes quickly). You can easily grab waterfalls and OGG recording from the database via Glouton.
GNU Radio Companion
Here I'm working with Observation #2073316 as an example. I've saved a copy of the IQ recording my station briefly stored at `/tmp/.satnogs/iq.raw`. This is about 220 MB. I even remembered to turn the IQ collection off afterwards or it would be storing stuff on top of each other forever.
So where did the IQ come from?
In my case, I'm playing with an APT pass. It is therefore processed by satnogs-flowgraphs/satellites/noaa_apt_decoder.grc. Other signals use other flowgraphs. The default where nothing else is suitable appears to be satnogs-flowgraphs/generic/fsk.grc.
That is, it's post Doppler correction, which includes an LO offset; and the values are scaled to shorts, although 16768 seems an weird number as I'd have expected a power of two - 16384? I don't imagine it makes a lot of difference as it'll still fit in the short just lose a little bit of dynamic range.
Feeding your IQ in
Loading the flowgraph in requires some GNU Radio modules chaining together. Starting with How to open satnogs iq.dat files you'll end up with something like this:
It took some time for me to work out the appropriate samples rates but I can't remember exactly how now. Scheduling a pass will generate them and then you can work it from there. Maybe I'll come back and update this later.
The rest just reverses throttles the output to real-time, and converts the short values to complex real including the scaling division.
Results
Initially, the waterfall may look a bit busy compared to the one from the observation. There's obviously some gain setting within the waterfall I've not yet mastered, or the Satnogs ones does something slightly cleverer.
However, if you peer closer you can just about make out the feint telltales of an APT signal.
Following the flowgraph through to output shows an identical output to that on the observation. Result!
OGG
For completeness, you can do the same thing using the OGG file as a source. Again, you need to reverse any resampling or other changes that were done before saving to file before feeding back into the flowgraph at an appropriate point. The throttle is optional, and in the screenshot bypassed: