Skip to main content

DvbTFrameMod

Struct DvbTFrameMod 

Source
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

Source

pub fn new(params: DvbTFrameParams) -> Self

Builds a modulator for a link with the given transmission parameters.

Source

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.

Source

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.

Source

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.

Source

pub fn params(&self) -> DvbTFrameParams

The transmission parameters this modulator was built with.

Source

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

Source§

fn clone(&self) -> DvbTFrameMod

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DvbTFrameMod

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.