Browse Source

FT4 demod: added a subtract_edge_symbols parameter to take the ramp up/down symbol (for completeness but no significant improvement)

chirpmodem-v8.0.0
f4exb 9 months ago
parent
commit
e64c407628
  1. 46
      ft8/ft4.cpp
  2. 4
      ft8/ft4.h
  3. 5
      sdrbench/test_ft4.cpp

46
ft8/ft4.cpp

@ -3443,6 +3443,29 @@ void FT4::subtract( @@ -3443,6 +3443,29 @@ void FT4::subtract(
ramp = 1;
}
if (params.subtract_edge_symbols)
{
int sym = bin0 + re103[0];
float phase = phases[0];
float amp = amps[0];
float hz = sym * bin_hz;
float dtheta = 2 * M_PI / (rate_ / hz); // advance per sample
for (int jj = 0; jj < ramp; jj++)
{
int iii = off0 - ramp + jj;
if (iii < 0 || iii >= (int)moved.size()) {
continue;
}
float theta = phase + (jj - ramp) * dtheta;
float x = amp * cos(theta);
x *= jj / (float)ramp;
moved[iii] -= x;
}
}
// initial ramp part of first symbol.
{
int sym = bin0 + re103[0];
@ -3550,6 +3573,29 @@ void FT4::subtract( @@ -3550,6 +3573,29 @@ void FT4::subtract(
}
}
if (params.subtract_edge_symbols)
{
int sym = bin0 + re103[102];
float phase = phases[102];
float amp = amps[102];
float hz = sym * bin_hz;
float dtheta = 2 * M_PI / (rate_ / hz); // advance per sample
for (int jj = 0; jj < ramp; jj++)
{
int iii = off0 + block * 103 + jj;
if (iii < 0 || iii >= (int)moved.size()) {
continue;
}
float theta = phase + (block + jj) * dtheta;
float x = amp * cos(theta);
x *= 1.0 - (jj / (float)ramp);
moved[iii] -= x;
}
}
nsamples_ = fftEngine_->hilbert_shift(moved, -diff0, -diff1, rate_);
}

4
ft8/ft4.h

@ -86,6 +86,7 @@ public: @@ -86,6 +86,7 @@ public:
int second_count;
int soft_phase_win;
float subtract_ramp;
int subtract_edge_symbols; // model one extra tapered symbol at frame start/end during subtraction (does not yield significant improvement)
int soft_ones;
int soft_pairs;
int soft_triples;
@ -155,6 +156,7 @@ public: @@ -155,6 +156,7 @@ public:
second_count = 3;
soft_phase_win = 2;
subtract_ramp = 0.11;
subtract_edge_symbols = 0;
soft_ones = 2;
soft_pairs = 1;
soft_triples = 1;
@ -180,6 +182,7 @@ public: @@ -180,6 +182,7 @@ public:
int use_osd;
int osd_depth;
int osd_ldpc_thresh;
int subtract_edge_symbols;
int max_candidates;
FT4ParamsLight() :
@ -188,6 +191,7 @@ public: @@ -188,6 +191,7 @@ public:
use_osd(1),
osd_depth(0),
osd_ldpc_thresh(70),
subtract_edge_symbols(0),
max_candidates(96)
{}
};

5
sdrbench/test_ft4.cpp

@ -219,8 +219,9 @@ void MainBench::testFT4(const QString& wavFile, const QString& argsStr) @@ -219,8 +219,9 @@ void MainBench::testFT4(const QString& wavFile, const QString& argsStr)
FT8::FT4Decoder decoder;
decoder.getParams().nthreads = nthreads;
decoder.getParams().use_osd = 1;
decoder.getParams().osd_depth = 6;
decoder.getParams().osd_ldpc_thresh = 77; // Require at least 77/83 correct LDPC bits before OSD
decoder.getParams().osd_depth = 3; // OSD candidates must be in top 3 to be considered
decoder.getParams().osd_ldpc_thresh = 75; // Require at least 75/83 correct LDPC bits before OSD
decoder.getParams().subtract_edge_symbols = 0; // Experimental: model pre/post ramp symbols in subtraction
decoder.entry(
samples.data(),

Loading…
Cancel
Save