pub struct DvbTFrameMod { /* private fields */ }Expand description
A conformant, preamble-less DVB-T frame modulator. Constructed with the link’s
transmission parameters (DvbTFrameParams — guard interval, constellation,
code rate, TPS-signalled frame number and cell id); modulate
produces one frame per call.
Implementations§
Source§impl DvbTFrameMod
impl DvbTFrameMod
Sourcepub fn new(params: DvbTFrameParams) -> Self
pub fn new(params: DvbTFrameParams) -> Self
Builds a modulator for a link with the given transmission parameters.
Sourcepub fn with_symbol_window(self, roll_off: usize) -> Self
pub fn with_symbol_window(self, roll_off: usize) -> Self
Enables TX symbol windowing with a roll_off-sample raised-cosine taper
at each symbol edge, reducing out-of-band emission. 0 (the default)
disables it. DVB-T frames are preamble-less — every symbol is CP-bearing —
so every symbol is windowed. The taper is only RX-transparent when the
receiver’s window back-off is paired to it (roll_off ≤ cp_len/2 with
back-off cp_len/2); see
DvbTFrameDemod::with_rx_window_backoff.
The continual/scattered/TPS pilots are unaffected — windowing touches only
the time-domain guard samples, not the subcarrier allocation.
Sourcepub fn with_tx_lowpass(self, lowpass: TxLowpass) -> Self
pub fn with_tx_lowpass(self, lowpass: TxLowpass) -> Self
Enables a TX baseband low-pass (spectral mask) across the assembled
frame, applied after any symbol taper. None/absent (the default) leaves
the frame byte-identical.
This is the DVB-T lever that exceeds the symbol-windowing ceiling: it
attenuates out-of-band energy directly in the frequency domain, and DVB-T
comes with room to do it in — 1705 of 2048 bins are active, so there is a
real null band for the transition. It changes nothing about how a
receiver decodes (the scattered-pilot equalizer absorbs the filter like
any other channel), but its group delay must land in guard the receiver
discards: pair it with
DvbTFrameDemod::with_rx_window_backoff
and keep roll_off + group_delay ≤ min(cp_len − b, b)
(TxLowpass::fits_guard). A long guard buys a sharper mask: G1/4
(cp_len = 512) affords eight times the filter length of G1/32.
TxLowpass::for_null_band placed against DVB-T’s own band edge is
for_dvb_t_2k.
Sourcepub fn tx_lowpass_for_2k(num_taps: usize, stopband_db: f32) -> TxLowpass
pub fn tx_lowpass_for_2k(num_taps: usize, stopband_db: f32) -> TxLowpass
A spectral mask sized for the fixed DVB-T 2K band edge (active carriers
±852 of 2048), leaving num_taps and stopband_db to the caller —
num_taps is what the guard budget constrains.
TxLowpass::taps_for_null_band with the same arguments suggests a
length.
Sourcepub fn params(&self) -> DvbTFrameParams
pub fn params(&self) -> DvbTFrameParams
The transmission parameters this modulator was built with.
Sourcepub fn modulate(&self, payload: &[u8]) -> DvbTFrame
pub fn modulate(&self, payload: &[u8]) -> DvbTFrame
Modulates payload (the MPEG-TS payload bytes) into one conformant,
preamble-less DVB-T frame: TS packetization + energy dispersal, the DVB-T
payload FEC, Figure-9a mapping through the four-phase scattered-pilot grid,
and the TPS word DBPSK-woven onto the 17 TPS carriers across the symbols.
The frame spans max(payload symbols, 68) OFDM symbols so a full TPS block
is present.
A short payload that does not fill the frame is stuffed with MPEG-2 null
packets (PID 0x1FFF) — §4.4 (“all symbols contain data”) and §4.3.1
(randomization stays active with no program input): a compliant DVB-T
signal never leaves data carriers zeroed. The RX trims the recovered
payload back to payload_len, so the stuffing is transparent.
Stuffing stops at the largest packet count whose coded stream still
fits (dvb_t_frame_fill),
and the carriers past it repeat the coded stream’s head. Nothing is
truncated, so a receiver reconstructing what was sent — the gate behind
DvbTFrameDemod::with_error_rates
— never asks its decoder for bits that never went on air. (Exact-fit with
no stuffing at all is a super-frame property — §4.7, Table 16 — handled by
the super-frame path, not here.)
Trait Implementations§
Source§impl Clone for DvbTFrameMod
impl Clone for DvbTFrameMod
Source§fn clone(&self) -> DvbTFrameMod
fn clone(&self) -> DvbTFrameMod
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more