1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-26 09:48:45 -05:00

DATV demod: compatibility with newer dvbs2.h

This commit is contained in:
f4exb 2020-04-21 02:05:32 +02:00
parent e5144c8bbc
commit 44d8f8022b
2 changed files with 13 additions and 13 deletions

View File

@ -1038,7 +1038,7 @@ void DATVDemodSink::InitDATVS2Framework()
objDemodulatorDVBS2 = (leansdr::s2_frame_receiver<leansdr::f32, leansdr::llr_ss> *) m_objDemodulatorDVBS2; objDemodulatorDVBS2 = (leansdr::s2_frame_receiver<leansdr::f32, leansdr::llr_ss> *) m_objDemodulatorDVBS2;
objDemodulatorDVBS2->omega = m_objCfg.Fs/m_objCfg.Fm; objDemodulatorDVBS2->omega0 = m_objCfg.Fs/m_objCfg.Fm;
//objDemodulatorDVBS2->mu=1; //objDemodulatorDVBS2->mu=1;
@ -1049,7 +1049,7 @@ void DATVDemodSink::InitDATVS2Framework()
demod.strongpls = cfg.strongpls; demod.strongpls = cfg.strongpls;
*/ */
objDemodulatorDVBS2->Fm = m_objCfg.Fm; //objDemodulatorDVBS2->Fm = m_objCfg.Fm; deprecated
objDemodulatorDVBS2->meas_decimation = decimation(m_objCfg.Fs, m_objCfg.Finfo); objDemodulatorDVBS2->meas_decimation = decimation(m_objCfg.Fs, m_objCfg.Finfo);
objDemodulatorDVBS2->strongpls = false; objDemodulatorDVBS2->strongpls = false;

View File

@ -505,7 +505,7 @@ struct s2_frame_receiver : runnable
float phase16; // Estimated phase of carrier at next symbol float phase16; // Estimated phase of carrier at next symbol
float mu; // Time to next symbol, in samples float mu; // Time to next symbol, in samples
float omega; // Samples per symbol float omega0; // Samples per symbol
void run() void run()
{ {
@ -513,7 +513,7 @@ struct s2_frame_receiver : runnable
// TBD margin ? // TBD margin ?
int min_samples = (1 + MAX_SYMBOLS_PER_FRAME + int min_samples = (1 + MAX_SYMBOLS_PER_FRAME +
plslot<SOFTSYMB>::LENGTH) * plslot<SOFTSYMB>::LENGTH) *
omega * 2; omega0 * 2;
while (in.readable() >= min_samples + sampler->readahead() && while (in.readable() >= min_samples + sampler->readahead() &&
out.writable() >= 1 + modcod_info::MAX_SLOTS_PER_FRAME && out.writable() >= 1 + modcod_info::MAX_SLOTS_PER_FRAME &&
opt_writable(freq_out, 1) && opt_writable(freq_out, 1) &&
@ -567,7 +567,7 @@ struct s2_frame_receiver : runnable
complex<T> *pin = in.rd(); complex<T> *pin = in.rd();
complex<T> p = *pin++; complex<T> p = *pin++;
int nsamples = MAX_SYMBOLS_PER_FRAME * omega; int nsamples = MAX_SYMBOLS_PER_FRAME * omega0;
for (int s = nsamples; s--; ++pin) for (int s = nsamples; s--; ++pin)
{ {
complex<T> n = *pin; complex<T> n = *pin;
@ -579,7 +579,7 @@ struct s2_frame_receiver : runnable
++coarse_count; ++coarse_count;
if (coarse_count == 50) if (coarse_count == 50)
{ {
float freqw = atan2f(diffcorr.im, diffcorr.re) * omega; float freqw = atan2f(diffcorr.im, diffcorr.re) * omega0;
fprintf(stderr, "COARSE(%d): %f rad/symb (%.0f Hz at %.0f baud)\n", fprintf(stderr, "COARSE(%d): %f rad/symb (%.0f Hz at %.0f baud)\n",
coarse_count, freqw, freqw * Fm / (2 * M_PI), Fm); coarse_count, freqw, freqw * Fm / (2 * M_PI), Fm);
#if 0 #if 0
@ -616,7 +616,7 @@ struct s2_frame_receiver : runnable
int nsymbols = MAX_SYMBOLS_PER_FRAME; // TBD Adjust after PLS decoding int nsymbols = MAX_SYMBOLS_PER_FRAME; // TBD Adjust after PLS decoding
sampler_state ss = {in.rd(), mu, phase16, freqw16}; sampler_state ss = {in.rd(), mu, phase16, freqw16};
sampler->update_freq(ss.fw16 / omega); sampler->update_freq(ss.fw16 / omega0);
if (!in_power) if (!in_power)
init_agc(ss.p, 64); init_agc(ss.p, 64);
@ -687,9 +687,9 @@ struct s2_frame_receiver : runnable
float ph16; // Carrier phase at next symbol, cycles*65536 float ph16; // Carrier phase at next symbol, cycles*65536
float fw16; // Carrier frequency, cycles per symbol * 65536 float fw16; // Carrier frequency, cycles per symbol * 65536
uint8_t *scr; // Position in scrambling sequeence uint8_t *scr; // Position in scrambling sequeence
void skip_symbols(int ns, float omega) void skip_symbols(int ns, float omega0)
{ {
mu += omega * ns; mu += omega0 * ns;
ph16 += fw16 * ns; ph16 += fw16 * ns;
scr += ns; scr += ns;
} }
@ -726,7 +726,7 @@ struct s2_frame_receiver : runnable
freqw16, freqw16 * Fm / 65536, mu); freqw16, freqw16 * Fm / 65536, mu);
sampler_state ss = {in.rd(), mu, phase16, freqw16, scrambling.Rn}; sampler_state ss = {in.rd(), mu, phase16, freqw16, scrambling.Rn};
sampler->update_freq(ss.fw16 / omega); sampler->update_freq(ss.fw16 / omega0);
update_agc(); update_agc();
@ -959,7 +959,7 @@ struct s2_frame_receiver : runnable
#endif #endif
if (meas_count >= meas_decimation) if (meas_count >= meas_decimation)
{ {
opt_write(freq_out, freqw16 / 65536 / omega); opt_write(freq_out, freqw16 / 65536 / omega0);
opt_write(ss_out, in_power); opt_write(ss_out, in_power);
// TBD Adjust if cfg.strongpls // TBD Adjust if cfg.strongpls
float mer = ev_power ? (float)cstln_amp * cstln_amp / ev_power : 1; float mer = ev_power ? (float)cstln_amp * cstln_amp / ev_power : 1;
@ -1056,7 +1056,7 @@ struct s2_frame_receiver : runnable
float cmu = 1.0f - ss->mu; float cmu = 1.0f - ss->mu;
complex<float> s(ss->p[0].re*cmu + ss->p[1].re*ss->mu, complex<float> s(ss->p[0].re*cmu + ss->p[1].re*ss->mu,
ss->p[0].im*cmu + ss->p[1].im*ss->mu); ss->p[0].im*cmu + ss->p[1].im*ss->mu);
ss->mu += omega; ss->mu += omega0;
// Derotate // Derotate
const complex<float> &rot = trig.expi(-ss->ph16); const complex<float> &rot = trig.expi(-ss->ph16);
ss->ph16 += ss->fw16; ss->ph16 += ss->fw16;
@ -1064,7 +1064,7 @@ struct s2_frame_receiver : runnable
#else #else
// Use generic interpolator // Use generic interpolator
complex<float> s = sampler->interp(ss->p, ss->mu, ss->ph16); complex<float> s = sampler->interp(ss->p, ss->mu, ss->ph16);
ss->mu += omega; ss->mu += omega0;
ss->ph16 += ss->fw16; ss->ph16 += ss->fw16;
return s; return s;
#endif #endif