Thursday, August 9, 2018

[Discuss-gnuradio] gr-fec Viterbi example

I am currently investigating LRPT (as used by METEOR-M2) and am
stuck with the Viterbi decoder. While trying to use
https://github.com/gnuradio/gnuradio/blob/master/gr-fec/lib/viterbi/decode.cc
which implements

/* The two generator polynomials for the NASA Standard K=7 code.
* Since these polynomials are known to be optimal for this constraint
* length there is not much point in changing them. But if you do, you
* will have to regenerate the BUTTERFLY macro calls in viterbi()
*/
#define POLYA 0x6d
#define POLYB 0x4f

I am unable to encode the sync word 0x1ACFFC1D to the expected result
0xfc 0xa2 0xb6 0x3d 0xb0 0x0d 0x97 0x94 as explained at
https://www.teske.net.br/lucas/2016/11/goes-satellite-hunt-part-3-frame-decoder/
I know this encoded sync word is correct because cross-correlating the
METEOR stream (after proper constellation rotation) with this word gives
a correlation peak every 16384 samples (=1024 byte sentence * 8 bits/byte * 2
bits/Viterbi encoder).

I am doing (word.bin was generated with Octave's fwrite function)
$ xxd word.bin
00000000: 1acf fc1d 0000 0000 0000 ..........
and then
$ cat word.bin | ./viterbi/encode > t.bin
but
$ xxd t.bin
00000000: 0000 0000 0000 0101 0001 0001 0101 0001 ................
00000010: 0001 0000 0100 0001 0101 0000 0000 0100 ................
00000020: 0001 0000 0101 0101 0101 0101 0000 0100 ................
00000030: 0001 0100 0100 0000 0001 0100 0100 0101 ................
00000040: 0000 0001 0001 0101 0001 0101 0000 0000 ................
does not match the expected bit sequence which should be
word=[1 1 1 1 1 1 0 0 ... % fc
1 0 1 0 0 0 1 0 ... % a2
1 0 1 1 0 1 1 0 ... % b6
0 0 1 1 1 1 0 1 ... % 3d
1 0 1 1 0 0 0 0 ... % b0
0 0 0 0 1 1 0 1 ... % 0d
1 0 0 1 0 1 1 1 ... % 97
1 0 0 1 0 1 0 0 ... % 94
If I encode a random word with the Viterbi encoder and then decode it, the
result is correct, so the implementation of Viterbi seems correct. I was
first thinking the polyomial coefficients might have been swapped but seems
not to be the case. Any idea what might be wrong ?

Thanks, JM

--
JM Friedt, FEMTO-ST Time & Frequency/SENSeOR, 26 rue de l'Epitaphe,
25000 Besancon, France

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.


_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

No comments:

Post a Comment