edith_codecs
Clone
https://git.tahinli.com/Tahinli/edith_codecs.git
0 watching0 forksRust370.3 MiB8a5feaaTahinli2 months ago3162 commits
| 1 | #!/usr/bin/env python3 |
| 2 | """Black-box measurement of the reference decoder's SBR noise-floor |
| 3 | dequantization law (round-21 Task 1). |
| 4 | |
| 5 | Method: reuse `sbrchirp.py`'s repaired probe shape (SCE, FIXFIX num_env=2, |
| 6 | amp_res=1, broadband comb core so the HF-signal envelope target is fixed |
| 7 | and non-zero), fix the envelope raw value, and sweep only the noise-floor |
| 8 | raw value `q_q` (`noise0`) across its 5-bit range. Noise is spec-additive |
| 9 | on top of the gain-adjusted HF signal (module doc in sbr_env.rs), so the |
| 10 | total power measured in the target band at each `q_q` is |
| 11 | `signal_energy(fixed) + noise_energy(q_q)`; subtracting the high-`q_q` |
| 12 | (minimal-noise) baseline isolates `noise_energy(q_q)` and its shape can be |
| 13 | fit against `q_q` directly, independent of our own decoder. |
| 14 | """ |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | = |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | = |
| 27 | |
| 28 | |
| 29 | |
| 30 | """Like `sbrchirp.stream()` but `bs_invf_mode` held at NONE (0, so the |
| 31 | injected noise is not reshaped by the inverse filter) and `noise0` |
| 32 | swept to `[q, q]` instead of `bs_invf_mode`; `env` is the fixed |
| 33 | envelope raw value.""" |
| 34 | = |
| 35 | = |
| 36 | |
| 37 | = |
| 38 | |
| 39 | = |
| 40 | |
| 41 | = |
| 42 | |
| 43 | = // 8 |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | = |
| 50 | |
| 51 | |
| 52 | |
| 53 | |
| 54 | |
| 55 | |
| 56 | |
| 57 | return |
| 58 | |
| 59 | |
| 60 | |
| 61 | = * 1024 |
| 62 | = |
| 63 | |
| 64 | = |
| 65 | = ** 2 |
| 66 | = |
| 67 | = & |
| 68 | return |
| 69 | |
| 70 | |
| 71 | |
| 72 | , = |
| 73 | , = 19 * / 128, 23 * / 128 |
| 74 | |
| 75 | |
| 76 | |
| 77 | |
| 78 | = |
| 79 | = |
| 80 | , = |
| 81 | = |
| 82 | |
| 83 | |
| 84 | |
| 85 | = |
| 86 | = |
| 87 | |
| 88 | = |
| 89 | = |
| 90 | , = |
| 91 | = |
| 92 | = |
| 93 | |
| 94 | |
| 95 | = |
| 96 | |
| 97 | |
| 98 | , = , |
| 99 | |
| 100 | = - |
| 101 | |
| 102 | = |
| 103 | |
| 104 | |
| 105 | |
| 106 | |
| 107 | |
| 108 | |
| 109 | , = |
| 110 | |
| 111 |