Skip to content

Commit 61ffb3e

Browse files
revert pager decoder to traditional clock recovery
1 parent 9ab3c97 commit 61ffb3e

File tree

3 files changed

+6
-323
lines changed

3 files changed

+6
-323
lines changed

decoder_modules/pager_decoder/src/pocsag/decoder.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
class POCSAGDecoder : public Decoder {
1515
public:
16-
POCSAGDecoder(const std::string& name, VFOManager::VFO* vfo) : diag(0.6, 544) {
16+
POCSAGDecoder(const std::string& name, VFOManager::VFO* vfo) : diag(0.6, BAUDRATE) {
1717
this->name = name;
1818
this->vfo = vfo;
1919

@@ -26,7 +26,7 @@ class POCSAGDecoder : public Decoder {
2626
vfo->setBandwidthLimits(12500, 12500, true);
2727
vfo->setSampleRate(SAMPLERATE, 12500);
2828
dsp.init(vfo->output, SAMPLERATE, BAUDRATE);
29-
reshape.init(&dsp.soft, 544, 0);
29+
reshape.init(&dsp.soft, BAUDRATE, (BAUDRATE / 30.0) - BAUDRATE);
3030
dataHandler.init(&dsp.out, _dataHandler, this);
3131
diagHandler.init(&reshape.out, _diagHandler, this);
3232

decoder_modules/pager_decoder/src/pocsag/dsp.h

Lines changed: 4 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -11,89 +11,6 @@
1111
#include <dsp/digital/binary_slicer.h>
1212
#include <dsp/routing/doubler.h>
1313

14-
#include "packet_clock_sync.h"
15-
16-
inline float PATTERN_DSDSDZED[] = {
17-
-1.00000000e+00, -8.00000000e-01, -6.00000000e-01, -4.00000000e-01,
18-
-2.00000000e-01, -2.77555756e-17, 2.00000000e-01, 4.00000000e-01,
19-
6.00000000e-01, 8.00000000e-01, 1.00000000e+00, 1.00000000e+00,
20-
1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 1.00000000e+00,
21-
1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 1.00000000e+00,
22-
1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 1.00000000e+00,
23-
1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 1.00000000e+00,
24-
1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 1.00000000e+00,
25-
1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 1.00000000e+00,
26-
1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 1.00000000e+00,
27-
1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 1.00000000e+00,
28-
1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 1.00000000e+00,
29-
1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 8.00000000e-01,
30-
6.00000000e-01, 4.00000000e-01, 2.00000000e-01, 2.77555756e-17,
31-
-2.00000000e-01, -4.00000000e-01, -6.00000000e-01, -8.00000000e-01,
32-
-1.00000000e+00, -1.00000000e+00, -1.00000000e+00, -1.00000000e+00,
33-
-1.00000000e+00, -1.00000000e+00, -1.00000000e+00, -1.00000000e+00,
34-
-1.00000000e+00, -1.00000000e+00, -1.00000000e+00, -8.00000000e-01,
35-
-6.00000000e-01, -4.00000000e-01, -2.00000000e-01, -2.77555756e-17,
36-
2.00000000e-01, 4.00000000e-01, 6.00000000e-01, 8.00000000e-01,
37-
1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 1.00000000e+00,
38-
1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 1.00000000e+00,
39-
1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 8.00000000e-01,
40-
6.00000000e-01, 4.00000000e-01, 2.00000000e-01, 2.77555756e-17,
41-
-2.00000000e-01, -4.00000000e-01, -6.00000000e-01, -8.00000000e-01,
42-
-1.00000000e+00, -8.00000000e-01, -6.00000000e-01, -4.00000000e-01,
43-
-2.00000000e-01, -2.77555756e-17, 2.00000000e-01, 4.00000000e-01,
44-
6.00000000e-01, 8.00000000e-01, 1.00000000e+00, 8.00000000e-01,
45-
6.00000000e-01, 4.00000000e-01, 2.00000000e-01, 2.77555756e-17,
46-
-2.00000000e-01, -4.00000000e-01, -6.00000000e-01, -8.00000000e-01,
47-
-1.00000000e+00, -1.00000000e+00, -1.00000000e+00, -1.00000000e+00,
48-
-1.00000000e+00, -1.00000000e+00, -1.00000000e+00, -1.00000000e+00,
49-
-1.00000000e+00, -1.00000000e+00, -1.00000000e+00, -8.00000000e-01,
50-
-6.00000000e-01, -4.00000000e-01, -2.00000000e-01, -2.77555756e-17,
51-
2.00000000e-01, 4.00000000e-01, 6.00000000e-01, 8.00000000e-01,
52-
1.00000000e+00, 8.00000000e-01, 6.00000000e-01, 4.00000000e-01,
53-
2.00000000e-01, 2.77555756e-17, -2.00000000e-01, -4.00000000e-01,
54-
-6.00000000e-01, -8.00000000e-01, -1.00000000e+00, -1.00000000e+00,
55-
-1.00000000e+00, -1.00000000e+00, -1.00000000e+00, -1.00000000e+00,
56-
-1.00000000e+00, -1.00000000e+00, -1.00000000e+00, -1.00000000e+00,
57-
-1.00000000e+00, -1.00000000e+00, -1.00000000e+00, -1.00000000e+00,
58-
-1.00000000e+00, -1.00000000e+00, -1.00000000e+00, -1.00000000e+00,
59-
-1.00000000e+00, -1.00000000e+00, -1.00000000e+00, -1.00000000e+00,
60-
-1.00000000e+00, -1.00000000e+00, -1.00000000e+00, -1.00000000e+00,
61-
-1.00000000e+00, -1.00000000e+00, -1.00000000e+00, -1.00000000e+00,
62-
-1.00000000e+00, -8.00000000e-01, -6.00000000e-01, -4.00000000e-01,
63-
-2.00000000e-01, -2.77555756e-17, 2.00000000e-01, 4.00000000e-01,
64-
6.00000000e-01, 8.00000000e-01, 1.00000000e+00, 8.00000000e-01,
65-
6.00000000e-01, 4.00000000e-01, 2.00000000e-01, 2.77555756e-17,
66-
-2.00000000e-01, -4.00000000e-01, -6.00000000e-01, -8.00000000e-01,
67-
-1.00000000e+00, -8.00000000e-01, -6.00000000e-01, -4.00000000e-01,
68-
-2.00000000e-01, -2.77555756e-17, 2.00000000e-01, 4.00000000e-01,
69-
6.00000000e-01, 8.00000000e-01, 1.00000000e+00, 8.00000000e-01,
70-
6.00000000e-01, 4.00000000e-01, 2.00000000e-01, 2.77555756e-17,
71-
-2.00000000e-01, -4.00000000e-01, -6.00000000e-01, -8.00000000e-01,
72-
-1.00000000e+00, -8.00000000e-01, -6.00000000e-01, -4.00000000e-01,
73-
-2.00000000e-01, -2.77555756e-17, 2.00000000e-01, 4.00000000e-01,
74-
6.00000000e-01, 8.00000000e-01, 1.00000000e+00, 1.00000000e+00,
75-
1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 1.00000000e+00,
76-
1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 1.00000000e+00,
77-
1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 1.00000000e+00,
78-
1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 1.00000000e+00,
79-
1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 8.00000000e-01,
80-
6.00000000e-01, 4.00000000e-01, 2.00000000e-01, 2.77555756e-17,
81-
-2.00000000e-01, -4.00000000e-01, -6.00000000e-01, -8.00000000e-01,
82-
-1.00000000e+00, -8.00000000e-01, -6.00000000e-01, -4.00000000e-01,
83-
-2.00000000e-01, -2.77555756e-17, 2.00000000e-01, 4.00000000e-01,
84-
6.00000000e-01, 8.00000000e-01, 1.00000000e+00, 1.00000000e+00,
85-
1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 1.00000000e+00,
86-
1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 1.00000000e+00,
87-
1.00000000e+00, 8.00000000e-01, 6.00000000e-01, 4.00000000e-01,
88-
2.00000000e-01, 2.77555756e-17, -2.00000000e-01, -4.00000000e-01,
89-
-6.00000000e-01, -8.00000000e-01, -1.00000000e+00, -1.00000000e+00,
90-
-1.00000000e+00, -1.00000000e+00, -1.00000000e+00, -1.00000000e+00,
91-
-1.00000000e+00, -1.00000000e+00, -1.00000000e+00, -1.00000000e+00,
92-
-1.00000000e+00, -1.00000000e+00, -1.00000000e+00, -1.00000000e+00,
93-
-1.00000000e+00, -1.00000000e+00, -1.00000000e+00, -1.00000000e+00,
94-
-1.00000000e+00, -1.00000000e+00, -1.00000000e+00
95-
};
96-
9714
class POCSAGDSP : public dsp::Processor<dsp::complex_t, uint8_t> {
9815
using base_type = dsp::Processor<dsp::complex_t, uint8_t>;
9916
public:
@@ -106,16 +23,12 @@ class POCSAGDSP : public dsp::Processor<dsp::complex_t, uint8_t> {
10623

10724
// Configure blocks
10825
demod.init(NULL, -4500.0, samplerate);
109-
//dcBlock.init(NULL, 0.001); // NOTE: DC blocking causes issues because no scrambling, think more about it
11026
float taps[] = { 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f };
11127
shape = dsp::taps::fromArray<float>(10, taps);
11228
fir.init(NULL, shape);
113-
//recov.init(NULL, samplerate/baudrate, 1e-4, 1.0, 0.05);
114-
115-
cs.init(NULL, PATTERN_DSDSDZED, sizeof(PATTERN_DSDSDZED)/sizeof(float), 544, 10);
29+
recov.init(NULL, samplerate/baudrate, 1e-4, 1.0, 0.05);
11630

11731
// Free useless buffers
118-
// dcBlock.out.free();
11932
fir.out.free();
12033
recov.out.free();
12134

@@ -125,13 +38,9 @@ class POCSAGDSP : public dsp::Processor<dsp::complex_t, uint8_t> {
12538

12639
int process(int count, dsp::complex_t* in, float* softOut, uint8_t* out) {
12740
count = demod.process(count, in, demod.out.readBuf);
128-
//count = dcBlock.process(count, demod.out.readBuf, demod.out.readBuf);
12941
count = fir.process(count, demod.out.readBuf, demod.out.readBuf);
130-
//count = recov.process(count, demod.out.readBuf, softOut);
131-
132-
count = cs.process(count, demod.out.readBuf, softOut);
133-
134-
//dsp::digital::BinarySlicer::process(count, softOut, out);
42+
count = recov.process(count, demod.out.readBuf, softOut);
43+
dsp::digital::BinarySlicer::process(count, softOut, out);
13544
return count;
13645
}
13746

@@ -146,22 +55,17 @@ class POCSAGDSP : public dsp::Processor<dsp::complex_t, uint8_t> {
14655
count = process(count, base_type::_in->readBuf, soft.writeBuf, base_type::out.writeBuf);
14756

14857
base_type::_in->flush();
149-
//if (!base_type::out.swap(count)) { return -1; }
150-
58+
if (!base_type::out.swap(count)) { return -1; }
15159
if (count) { if (!soft.swap(count)) { return -1; } }
152-
15360
return count;
15461
}
15562

15663
dsp::stream<float> soft;
15764

15865
private:
15966
dsp::demod::Quadrature demod;
160-
//dsp::correction::DCBlocker<float> dcBlock;
16167
dsp::tap<float> shape;
16268
dsp::filter::FIR<float, float> fir;
16369
dsp::clock_recovery::MM<float> recov;
16470

165-
dsp::PacketClockSync cs;
166-
16771
};

decoder_modules/pager_decoder/src/pocsag/packet_clock_sync.h

Lines changed: 0 additions & 221 deletions
This file was deleted.

0 commit comments

Comments
 (0)