Browse Source

DATV demod: apply commit 3479085369c2466fb2672f8e529e771c8fa22d1c Control refresh of tracking FIR filter.

chirpmodem-v8.0.0
f4exb 7 years ago
parent
commit
85bbcd0c68
  1. 16
      plugins/channelrx/demoddatv/leansdr/sdr.h

16
plugins/channelrx/demoddatv/leansdr/sdr.h

@ -891,10 +891,11 @@ struct sampler_interface @@ -891,10 +891,11 @@ struct sampler_interface
{
}
virtual complex<T> interp(const complex<T> *pin, float mu, float phase) = 0;
virtual void update_freq(float freqw, int period = 1)
virtual void update_freq(float freqw, int weight = 0)
{
(void) freqw;
(void) period;
(void) weight;
} // 65536 = 1 Hz
virtual int readahead() = 0;
};
@ -940,9 +941,9 @@ struct linear_sampler : sampler_interface<T> @@ -940,9 +941,9 @@ struct linear_sampler : sampler_interface<T>
return s0 * (1 - mu) + s1 * mu;
}
void update_freq(float _freqw, int period = 1)
void update_freq(float _freqw, int weight = 0)
{
(void) period;
(void) weight;
freqw = _freqw;
}
@ -998,11 +999,14 @@ struct fir_sampler : sampler_interface<T> @@ -998,11 +999,14 @@ struct fir_sampler : sampler_interface<T>
return trig.expi(-phase) * acc;
}
void update_freq(float freqw, int period)
void update_freq(float freqw, int weight = 0)
{
if (!weight) {
update_freq_phase = 0; // Force refresh.
}
// Throttling: Update one coeff per 16 processed samples,
// to keep the overhead of freq tracking below about 10%.
update_freq_phase -= period;
update_freq_phase -= weight;
if (update_freq_phase <= 0)
{

Loading…
Cancel
Save