10#ifndef INCLUDED_DVBS2RX_PL_FRAME_SYNC_H
11#define INCLUDED_DVBS2RX_PL_FRAME_SYNC_H
18#include <gnuradio/gr_complex.h>
23#define SOF_CORR_LEN (SOF_LEN - 1)
24#define PLSC_CORR_LEN (PLSC_LEN / 2)
131 uint8_t d_unlock_thresh;
135 gr_complex d_last_in;
136 float d_timing_metric;
137 uint32_t d_sof_interval;
139 uint32_t d_frame_len;
140 uint8_t d_unlock_cnt;
141 std::chrono::system_clock::time_point d_lock_time;
148 volk::vector<gr_complex> d_payload_buf;
149 volk::vector<gr_complex> d_sof_taps;
150 volk::vector<gr_complex> d_plsc_taps;
160 const float threshold_u = 30;
162 const float threshold_l = 25;
174 volk::vector<gr_complex>& taps,
210 bool step(
const gr_complex& in);
227 bool is_locked()
const {
return d_state == frame_sync_state_t::locked; }
267 const gr_complex*
get_payload()
const {
return d_payload_buf.data(); }
297 std::chrono::system_clock::time_point
get_lock_time() {
return d_lock_time; }
const T & back() const
Access the element at the back of the queue.
Definition cdeque.h:165
Fixed-size delay-line with contiguous storage of volk-aligned elements.
Definition delay_line.h:34
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
float get_timing_metric() const
Get the last evaluated timing metric.
Definition pl_frame_sync.h:289
const gr_complex * get_payload() const
Get the PLFRAME payload (data + pilots) buffered internally.
Definition pl_frame_sync.h:267
const gr_complex * get_sof_corr_taps() const
Get the SOF correlator taps.
Definition pl_frame_sync.h:273
const gr_complex * get_plheader() const
Get the PLHEADER buffered internally.
Definition pl_frame_sync.h:255
uint32_t get_sof_interval() const
Get the interval between the last two detected SOFs.
Definition pl_frame_sync.h:249
void set_frame_len(uint32_t len)
Set the current PLFRAME length.
const gr_complex * get_plsc_corr_taps() const
Get the PLSC correlator taps.
Definition pl_frame_sync.h:279
bool is_locked_or_almost() const
Check whether frame lock has been achieved or a SOF has been found.
Definition pl_frame_sync.h:233
bool step(const gr_complex &in)
Process the next input symbol.
frame_sync(int debug_level, uint8_t unlock_thresh=3)
Construct a new frame sync object.
bool is_locked() const
Check whether frame lock has been achieved.
Definition pl_frame_sync.h:227
uint32_t get_sym_count() const
Get the symbol count on the internal payload buffer.
Definition pl_frame_sync.h:240
Definition pl_submodule.h:25
#define DVBS2RX_API
Definition include/gnuradio/dvbs2rx/api.h:19
frame_sync_state_t
Definition pl_frame_sync.h:30
Fixed-length double-ended queue with contiguous volk-aligned elements.
Definition gr_bch.h:22
#define MAX_PLFRAME_PAYLOAD
Definition pl_defs.h:29