10#ifndef INCLUDED_DVBS2RX_PLSYNC_CC_IMPL_H
11#define INCLUDED_DVBS2RX_PLSYNC_CC_IMPL_H
19#include <volk/volk_alloc.hh>
49 std::map<uint64_t, rot_phase_adj_t>
58 void step(uint16_t plframe_len,
bool has_pilots);
93 std::array<uint8_t, n_plsc_codewords> d_pls_enabled;
94 bool d_plsc_decoder_enabled;
104 gr_complex d_phase_corr;
105 double d_cum_freq_offset;
109 uint64_t d_frame_cnt;
110 uint64_t d_rejected_cnt;
111 uint64_t d_dummy_cnt;
121 const pmt::pmt_t d_port_id = pmt::mp(
"rotator_phase_inc");
141 void handle_tags(
int ninput_items);
202 void control_rotator_freq(uint64_t abs_sof_idx,
203 uint16_t plframe_len,
205 bool ref_is_past_frame);
225 void calibrate_tag_delay(uint64_t abs_sof_idx,
int tolerance = 300);
235 void handle_plheader(uint64_t abs_sof_idx,
236 const gr_complex* p_plheader,
253 int handle_payload(
int noutput_items,
255 const gr_complex* p_payload,
267 uint64_t pls_filter_lo,
268 uint64_t pls_filter_hi);
272 void forecast(
int noutput_items, gr_vector_int& ninput_items_required);
275 gr_vector_int& ninput_items,
276 gr_vector_const_void_star& input_items,
277 gr_vector_void_star& output_items);
Frame Synchronizer.
Definition pl_frame_sync.h:128
std::chrono::system_clock::time_point get_lock_time()
Get the frame lock timestamp.
Definition pl_frame_sync.h:297
Frequency Synchronizer.
Definition pl_freq_sync.h:85
bool is_coarse_corrected()
Check whether the coarse frequency correction has been achieved.
Definition pl_freq_sync.h:334
PL Descrambler.
Definition pl_descrambler.h:32
PLSC Decoder.
Definition pl_signaling.h:89
Definition plsync_cc_impl.h:82
int general_work(int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
float get_freq_offset()
Get the cumulative frequency offset.
Definition plsync_cc_impl.h:290
uint64_t get_frame_count()
Get the current count of processed (accepted) PLFRAMEs.
Definition plsync_cc_impl.h:296
uint64_t get_dummy_count()
Get the current count of received dummy PLFRAMEs.
Definition plsync_cc_impl.h:298
void forecast(int noutput_items, gr_vector_int &ninput_items_required)
uint64_t get_rejected_count()
Get the current count of rejected PLFRAMEs.
Definition plsync_cc_impl.h:297
bool get_coarse_freq_corr_state()
Get the coarse frequency offset correction state.
Definition plsync_cc_impl.h:293
plsync_cc_impl(int gold_code, int freq_est_period, double sps, int debug_level, bool acm_vcm, bool multistream, uint64_t pls_filter_lo, uint64_t pls_filter_hi)
uint64_t get_sof_count()
Get the current count of detected start-of-frame (SOF) instants.
Definition plsync_cc_impl.h:295
bool get_locked()
Get the current lock status.
Definition plsync_cc_impl.h:294
std::chrono::system_clock::time_point get_lock_time()
Get the timestamp of the last frame synchronization lock.
Definition plsync_cc_impl.h:299
DVB-S2 Physical Layer (PL) Synchronizer.
Definition plsync_cc.h:41
payload_state_t
Definition plsync_cc_impl.h:75
Fixed-length double-ended queue with contiguous volk-aligned elements.
Definition gr_bch.h:22
#define PLHEADER_LEN
Definition pl_defs.h:21
Index tracking for various segments of a PLFRAME.
Definition plsync_cc_impl.h:54
uint16_t i_slot
Definition plsync_cc_impl.h:57
uint16_t i_pilot_blk
Definition plsync_cc_impl.h:56
void step(uint16_t plframe_len, bool has_pilots)
uint16_t i_in_payload
Definition plsync_cc_impl.h:55
Definition plsync_cc_impl.h:63
pls_info_t pls
Definition plsync_cc_impl.h:66
float plheader_phase
Definition plsync_cc_impl.h:65
double coarse_foffset
Definition plsync_cc_impl.h:68
plframe_info_t()
Definition plsync_cc_impl.h:71
bool coarse_corrected
Definition plsync_cc_impl.h:67
volk::vector< gr_complex > plheader
Definition plsync_cc_impl.h:64
uint64_t abs_sof_idx
Definition plsync_cc_impl.h:70
double fine_foffset
Definition plsync_cc_impl.h:69
Definition pl_signaling.h:56
Definition plsync_cc_impl.h:40
std::queue< tag_t > tag_queue
Definition plsync_cc_impl.h:48
uint64_t last_tag_search_end
Definition plsync_cc_impl.h:43
rot_state_t past
Definition plsync_cc_impl.h:46
int tag_delay
Definition plsync_cc_impl.h:41
rot_state_t current
Definition plsync_cc_impl.h:47
std::map< uint64_t, rot_phase_adj_t > update_map
Definition plsync_cc_impl.h:50
uint64_t tag_search_start
Definition plsync_cc_impl.h:42
Definition plsync_cc_impl.h:33
uint64_t sof_idx
Definition plsync_cc_impl.h:35
rot_phase_adj_t(double p, uint64_t i)
Definition plsync_cc_impl.h:36
double phase_inc
Definition plsync_cc_impl.h:34
Definition plsync_cc_impl.h:27
uint64_t idx
Definition plsync_cc_impl.h:29
double freq
Definition plsync_cc_impl.h:28