LTE Primopredajnik
Loading...
Searching...
No Matches
tests.test_lte_system_e2e Namespace Reference

Classes

class  DummyRxResult

Functions

Dict[str, Any] run_system (LTESystem system, Sequence[int] mib_bits, **kwargs)
LTESystem make_system (*, float snr_db, float freq_offset_hz, int seed=1, int n_id_2=0, float fs_hz=FS, int ndlrb=NDLRB, int num_subframes=NUM_SUBFRAMES, bool normal_cp=NORMAL_CP)
np.ndarray fixed_mib (int seed=0)
Tuple[float, float] avg_trials_metrics (*, float snr_db, float freq_offset_hz, int n_trials=8, int seed0=10, int n_id_2=0)
 test_to_bits_01_binaryizes_and_checks_length ()
 test_to_bits_01_invalid_length_raises ()
 test_compute_bit_errors_rx_none_count_all_true ()
 test_compute_bit_errors_rx_none_count_all_false ()
 test_compute_bit_errors_identical_bits_zero ()
 test_compute_bit_errors_partial_overlap_uses_min_len ()
 test_rx_unpack_accepts_dataclass_like ()
 test_rx_unpack_accepts_dict ()
 test_run_returns_required_keys ()
 test_waveforms_are_complex_and_1d ()
 test_debug_always_has_fs_and_lengths ()
 test_fs_matches_expected_1p4mhz_mode ()
 test_tau_hat_expected_normal_cp_high_snr ()
 test_detected_nid_matches_tx_at_high_snr (int nid2)
 test_cfo_hat_close_when_cfo_present_high_snr ()
 test_cfo_hat_near_zero_when_no_cfo_high_snr ()
 test_crc_true_at_very_high_snr_zero_cfo ()
 test_crc_often_fails_at_very_low_snr_at_least_once ()
 test_ber_is_in_range_0_1 ()
 test_pss_metric_if_present_is_finite ()
 test_keep_debug_false_drops_rx_debug_fields_like_corr_peak ()
 test_keep_debug_true_includes_some_rx_debug_fields ()
 test_count_all_if_rx_missing_true_sets_ber_1_when_crc_fail ()
 test_count_all_if_rx_missing_false_returns_none_when_crc_fail ()
 test_high_snr_has_lower_avg_ber_than_low_snr_trials ()
 test_high_snr_has_higher_crc_rate_than_low_snr_trials ()
 test_same_seed_same_mib_deterministic_single_run ()
 test_different_seed_changes_rx_waveform ()
 test_large_cfo_system_stability_no_exception ()
 test_very_high_snr_no_noise_like_behavior_crc_true ()
 test_invalid_mib_length_raises_value_error ()
 test_system_run_accepts_list_bits ()
 test_system_run_accepts_numpy_bits_uint8 ()
 test_input_mib_not_modified_in_place ()
 test_tau_hat_stable_even_with_moderate_cfo ()
 test_run_with_keep_debug_true_returns_debug_dict ()
 test_run_with_keep_debug_false_returns_debug_dict_minimal ()
 test_channel_reset_called_when_reset_channel_true (monkeypatch)
 test_channel_reset_not_called_when_reset_channel_false (monkeypatch)
 test_multiple_runs_same_system_produce_different_rx_due_to_rng_progress ()
 test_crc_ok_implies_mib_bits_rx_present_and_len_24 ()
 test_crc_fail_often_implies_mib_bits_rx_none_at_low_snr ()

Variables

 PROJECT_ROOT = Path(__file__).resolve().parents[1]
float FS = 1.92e6
int NDLRB = 6
bool NORMAL_CP = True
int NUM_SUBFRAMES = 4

Detailed Description

tests/test_lte_system_e2e.py
============================

E2E testovi za LTE sistem:
    TX (LTETxChain) -> Channel (LTEChannel) -> RX (LTERxChain)
preko glue klase:
    LTESystem

Cilj:
- sistemska ispravnost (stabilnost, relativno ponašanje SNR-a, sinkronizacija),
- happy/unhappy paths,
- GUI-friendly output struktura.

Function Documentation

◆ avg_trials_metrics()

Tuple[float, float] tests.test_lte_system_e2e.avg_trials_metrics ( * ,
float snr_db,
float freq_offset_hz,
int n_trials = 8,
int seed0 = 10,
int n_id_2 = 0 )
Vrati (avg_BER, CRC_success_rate) preko više trial-ova.
Deterministički: seed se mijenja kroz trial-ove.