Demodulate LRPT from Satnogs IQ file

I’m (desperately) trying to demodulate and decode Meteor M2 LRPT from Satnogs IQ files but not having much luck.

Supposedly Satnogs produces 16 bit interleaved ints @ 48k

However I’m not having a lot of luck running them through any demodulator or medet_arm for that matter.
I’m trying to use this demodulator: https://github.com/dbdexter-dev/meteor_demod - simply specifying 48000 sample rate.
I also tried converting to 32 bit floats with grc but that didn’t look tastier to the demodulator.

Any hints on how to process the IQ.dat files with that meteor_demod?

Note that LRPT has is modulated at 72ksps, so the standard gr-satnogs flowgraphs that record 48ksps IQ files will not have enough bandwidth to allow demodulation.

Oh!
Doh!

I guess I have to dig deeper or give up.

The IQ recorder in gr-satnogs records IQ at a rate which is 2 x symbol rate so it will be 160 or 144 ksps for METEOR M2, depending on which transmitter is active.

1 Like

I suppose math helps. Thank you!
For https://network.satnogs.org/observations/2191084/ i end up with a 436MB IQ-file.

Supposed to be a 13 minute observation so around 457003008 / 780 = 585901 bytes/s
Which is practically a multiple of 144.

Taken that into consideration meteor_demod seems happier with the files.
Screenshot 2020-05-11 at 22.48.02

But sadly medet does not :confused:


Not a single frame decoded …

Ditto @anders, I was trying to get that to work last week. Not got a lot of time this week as I’m working, but should be able to play later in the week/weekend.

LRPT will use the default flowgraph so your sample rate should be double the symbol rate as already said, although this differs depending on client version and your config. I’ve amended @vk5qi’s lrpt_demod.grc in my satnogs-flowgraphs fork. Looks like meteor_demod is doing a similar job but I’d not come across that. I’m currently taking sample_rate * 2.5 as I didn’t think I was getting enough bandwidth with sample_rate * 2, but that may not be an issue.

I’m similarly struggling to get an image without manual intervention. I’ve had some success by taking an IQ observation from my Pi and running it through the above flowgraph, then through medet on my Ubuntu 19.10 VM. But this isn’t working if I do anything more than the IQ on the Pi. I suspected medet_arm at fault, but taking the symbol file post flowgraph from the Pi then running through medet on the Pi or Ubuntu gives me no output either.

It’s really rather odd that it works fine if I go via an IQ file, but not if I route directly through. I think there’s something up with the flowgraph but I can’t fathom out what. Probably best to view the actual flowgraph on GitLab, but visually:

  • Direct from SDR part:

  • IQ file source part:

  • IQ sink/re-entry into flowgraph:

image

I think I’m doing everything right to recover the same IQ based on How to open satnogs iq.dat files, but I get a substantially different symbol stream out. I could almost understand if it worked direct but not from an IQ file, but it’s the opposite way round!

Output from medet for debugging could be somewhat better (reporting failure to write to the bitmap file for a start), but I get the following:

$ medet symbols_generated_on_vm.s monday1 -cd
Reading symbols_generated_on_vm.s...
pos=133570836 ( 99.99%) ( 5, 8401,49) sig= -103 rs=(-1,-1,-1,-1) D4B2CCCA 
Total:        86.266403
Processing:   5.513997
Correlation:  22.741289
Viterbi:      53.301575
ECC:          4.131852
Remainder:    0.577687
Packets:      4336 / 7006
Elapsed time: 00:08:50.624

The above spits out a .dec and .bmp file.

$ medet symbols_generated_on_pi.s monday2 -cd
Reading symbols_generated_on_pi.s...
 pos=133562368 ( 99.98%) ( 0,    0,64) sig=  100 rs=( 0, 0, 0, 0) FFFFFFFF 
Total:        51.514587
Processing:   0.005908
Correlation:  0.031845
Viterbi:      46.848572
ECC:          3.819544
Remainder:    0.808718
Packets:      8153 / 8153

This spits out a .dec, but no .bmp file.

Observation 2196564 is not the best from an image point of view as it is close to sunset, but is the one I was playing with tonight. Here’s what I got via the IQ file method, just to show you can get it to work:

Sorry no great answers there and probably off at a bit of a tangent, but hopefully some indication that it is possible. Having written the above, my best guess is that some of the parameters into the flowgraph are different to my manual pass through the flowgraph. I’ll have to continue to figure that out another night, as I need to go to bed ad my flowgraph debugging code was missing when tonight’s pass happened.

2 Likes

I’m surprised you’re getting medet to chew on a file that’s only been “complexed and multiplied” - I’m confused by your constant though.
Mine is 1/32767.0 - what’s yours? And what does it actually do?

I will try again again :slight_smile: It’s good to know someone else is trying too :smiley:

I have given a try with a 432 MB IQ file I have collected in the observation 2200060. Following your inputs, I have tried to produce the image or the dump, but no success as well. Links provided to the IQ data in case anyone likes to try as well.

I managed to get your lrpt fork up and running(-very-ish) on Ubuntu 20.04 with some modifications.

https://network.satnogs.org/observations/2191092/
Gave me this:

With this flow:

Medet output:

I was hoping for waaaay better than that. Maybe it’s the 144Ksps and maybe it’s something else.

I’ve been playing around with the “Multiply const” block a bit.

Setting it to multiply by 1/384 instead of 1/16767 gave me:

instead of this:

Neither are great but I would call it an improvement. Medet also recognises more packets.
These are the results from slowly turning that knob:

I’m surprised you’re getting medet to chew on a file that’s only been “complexed and multiplied”

I probably should have shared a single screenshot rather than the bits I did. Looks like you’ve progressed further now but to be clear after complex and multiplying it ends up running back through the main flow via the doppler_corrected virtual stream. One or the other needs to be enabled.

I should also point out that I’d accidentally left the rational resampler in from when I was working with different sample rates. It was marked as bypassed but I’m not sure that sticks through a disable/enable cycle. Best removed unless you’re also adjusting sample rates.

I’ve found the throttle (also bypassed) doesn’t appear to be needed unless you want to follow the GUI in real time.

I’m confused by your constant though. Mine is 1/32767.0 - what’s yours? And what does it actually do?

Me too. This is trying to replicate what’s suggested in How to open satnogs iq.dat files but taking account of the scaling factor in the default flowgraph IQ Sink blocks. These seem to use a divisor of 16768 for some reason, so I use 1/16768 = 59.6374u. It’s rather odd in two ways:

  1. I’d expect this to be 2^14 = 16384 but I don’t think it makes a lot of difference. There’s a little more headroom and slightly reduced dynamic range as a result.

  2. You should be able to use 2^15 within a (signed) short. Not sure why the default flowgraph throws a extra bit away.

image

1 Like

Yeah. The scaling factor is weird but I guess it just has to be the same in both ends.

But - something is off with my sample rate. I assumed it was 144k (because 72k x 2) but that doesn’t seem to be the case because when I remove the rational resampler I can no longer decode anything at all.

How do I check what my actual “out_samp_rate” from the iq sink is? (I went digging in satnogs_iq_receiver but didn’t find what I was looking for - still trying to wrap my head around the code base)

Just had a pretty good pass but I have a feeling my sample rate is still completely wrong considering I need the resampling and scaling factor is waaaay off. (Scaling by 1/512 works waaaay better than 1/16767)

Hmm. So.

It turns out my sample rate must be 288ksps. With that set, I can skip the resampler.
I have no idea where that comes from. Maybe baud rate x 4 but I still can’t figure out where that is set on my Pi.

This works OK for me but I still have a lot of missing data for a pretty good pass:

https://network.satnogs.org/observations/2197445/

1 Like

Oh, I have a feeling there’s a decimation involved somewhere that will be giving you sample_rate * 4.

Yeah, see my clumsy write up from when I was having trouble with APT reception - Understanding ‘satnogs-flowgraphs’. I wrote that while trying to solve an issue by describing the problem as a thread here, but realised what was up in the process. Thought I might as well document it for my own benefit on the wiki but don’t think I’ve linked it from anywhere. Jump to the Sample rate section which I added when fiddling with LRPT to get to the meat of the problem if you don’t want to read the rest.

In summary: the default flowgraph Doppler Compensation uses a sample rate of baudrate * decimation. The latter is max(4,satnogs.find_decimation(baudrate, 2, audio_samp_rate)) and comes out as 4 for this wide baudrate and bandwidth.

2 Likes

Just curious. That shows a .wav file as your source. Is it really a .wav, or is it actually an IQ file that happens to have a .wav suffix?

It would be interesting to see what the constellation plot looks like vs the image you’re getting - is it scaled sensibly, is it rotating, etc. Although that’s getting close to the limit of my knowledge.

It’s an IQ with a wav suffix :slight_smile:

I don’t know the theory well enough to make sense of the plot - but maybe you can tell me?

It doesn’t seem scaled right to me - I would’ve expected it to be straight on the ±0.5 lines. But I have no idea?
The jerks might be doppler correction?

Setting the RRC filter gain to 1.5 made put the dots where I expected them. Not sure that makes a big difference though.

Decided to fix the AGC reference point instead of the rrc filter gain - not much changed either way.

I’m starting to think my horizontal lines are simply a consequence of local interference or something :confused: I guess I should try out someone else’s IQ files next.

My experiment from today was with this scheduled observation 2212185.
It is marked as failed because the raspberry pi run out of memory. But an 812 MB IQ file was produced.
Using these commands in my Ubuntu 18.04 with a sampling rate of 288000:

iq=2212185_2020-05-14T08-02-43.wav
meteor_demod $iq --sample-rate 288000
# generates LRPT_2020_05_14-15_08.s 
meteor_decoder/medet LRPT_2020_05_14-15_08.s LRPT_2020_05_14-15_08 -S

The resulted image:

The iq file should be accessible, but as my small home server is using dynamic DNS, it might not work always.

1 Like