/liblc3-3.5.0-3.4.0/test/ |
D | sns.py | 21 import tables as T, appendix_c as C namespace 518 for i in range(len(C.E_B[dt])): 520 scf = lc3.sns_compute_scale_factors(dt, sr, C.E_B[dt][i], False) 521 ok = ok and np.amax(np.abs(scf - C.SCF[dt][i])) < 1e-4 524 ok = ok and lf == C.IND_LF[dt][i] and hf == C.IND_HF[dt][i] 527 ok = ok and np.any(y[0][:16] - C.SNS_Y0[dt][i] == 0) 528 ok = ok and np.any(y[1][:10] - C.SNS_Y1[dt][i] == 0) 529 ok = ok and np.any(y[2][:16] - C.SNS_Y2[dt][i] == 0) 530 ok = ok and np.any(y[3][:16] - C.SNS_Y3[dt][i] == 0) 531 ok = ok and shape == 2*C.SUBMODE_MSB[dt][i] + C.SUBMODE_LSB[dt][i] [all …]
|
D | spec.py | 20 import tables as T, appendix_c as C namespace 739 for i in range(len(C.X_F[dt])): 741 g_int = lc3.spec_estimate_gain(dt, sr, C.X_F[dt][i], 742 C.NBITS_SPEC[dt][i], C.NBITS_OFFSET[dt][i], -C.GG_OFF[dt][i])[0] 743 ok = ok and g_int == C.GG_IND[dt][i] + C.GG_OFF[dt][i] 746 C.GG_IND[dt][i] + C.GG_OFF[dt][i], C.X_F[dt][i]) 747 ok = ok and np.any((xq - C.X_Q[dt][i]) == 0) 748 ok = ok and nq == C.LASTNZ[dt][i] 751 C.NBYTES[dt], C.X_Q[dt][i], C.LASTNZ[dt][i], 0)[0] 752 ok = ok and nbits == C.NBITS_EST[dt][i] [all …]
|
D | tns.py | 20 import tables as T, appendix_c as C namespace 362 for i in range(len(C.X_S[dt])): 364 (_, a) = lc3.tns_compute_lpc_coeffs(dt, sr, C.X_S[dt][i]) 365 ok = ok and np.amax(np.abs(a[0] - C.TNS_LEV_A[dt][i])) < 1e-5 368 ok = ok and np.amax(np.abs(rc - C.TNS_LEV_RC[dt][i])) < 1e-5 370 (rc_order, rc_i) = lc3.tns_quantize_rc(C.TNS_LEV_RC[dt][i]) 371 ok = ok and rc_order == C.RC_ORDER[dt][i][0] 372 ok = ok and np.any((rc_i + 8) - C.RC_I_1[dt][i] == 0) 375 ok = ok and np.amax(np.abs(rc_q - C.RC_Q_1[dt][i])) < 1e-6 377 (x, side) = lc3.tns_analyze(dt, sr, False, C.NBYTES[dt], C.X_S[dt][i]) [all …]
|
D | ltpf.py | 21 import tables as T, appendix_c as C namespace 478 x = np.append(np.zeros(nt), C.X_PCM[dt][0]) 481 u = y[-k:len(C.X_TILDE_12K8D[dt][0])-k] 483 ok = ok and np.amax(np.abs(u - C.X_TILDE_12K8D[dt][0]/2)) < 2 485 x = np.append(x[-nt:], C.X_PCM[dt][1]) 488 u = y[-k:len(C.X_TILDE_12K8D[dt][1])-k] 490 ok = ok and np.amax(np.abs(u - C.X_TILDE_12K8D[dt][1]/2)) < 2 572 x = np.append(np.zeros(nt), C.X_PCM[dt][0]) 575 ok = ok and C.T_CURR[dt][0] - state['tc'] == 17 576 ok = ok and np.amax(np.abs(state['nc'][0] - C.NC_LTPF[dt][0])) < 1e-5 [all …]
|
D | mdct.py | 21 import tables as T, appendix_c as C namespace 125 (y, d) = lc3.mdct_forward(dt, sr, C.X_PCM[dt][0], np.zeros(nd)) 126 ok = ok and np.amax(np.abs(y - C.X[dt][0])) < 1e-1 128 (y, d) = lc3.mdct_forward(dt, sr, C.X_PCM[dt][1], d) 129 ok = ok and np.amax(np.abs(y - C.X[dt][1])) < 1e-1 165 (y, d0) = lc3.mdct_inverse(dt, sr, C.X_HAT_SNS[dt][0], np.zeros(nd)) 166 yr = C.T_HAT_MDCT[dt][0][ns-nd:2*ns-nd] 167 dr = C.T_HAT_MDCT[dt][0][2*ns-nd:] 172 (y, d1) = lc3.mdct_inverse(dt, sr, C.X_HAT_SNS[dt][1], d0) 173 yr[ :nd] = C.T_HAT_MDCT[dt][1][ns-nd:ns] + d0 [all …]
|
D | energy.py | 20 import tables as T, appendix_c as C namespace 69 e = lc3.energy_compute(dt, sr, C.X[dt][0])[0] 70 ok = ok and np.amax(np.abs(1 - e/C.E_B[dt][0])) < 1e-6 72 e = lc3.energy_compute(dt, sr, C.X[dt][1])[0] 73 ok = ok and np.amax(np.abs(1 - e/C.E_B[dt][1])) < 1e-6
|
D | attdet.py | 20 import tables as T, appendix_c as C namespace 158 x = np.append(np.zeros(6), C.X_PCM_ATT[dt][0]) 159 f_att = lc3.attdet_run(dt, sr, C.NBYTES_ATT[dt], state, x) 160 ok = f_att == C.F_ATT[dt][0] 162 x = np.append(x[-6:], C.X_PCM_ATT[dt][1]) 163 f_att = lc3.attdet_run(dt, sr, C.NBYTES_ATT[dt], state, x) 164 ok = f_att == C.F_ATT[dt][1]
|
D | encoder.py | 25 import tables as T, appendix_c as C namespace 115 for i in range(len(C.X_PCM[dt])): 117 data = lc3.encode(enc_c, C.X_PCM[dt][i], C.NBYTES[dt]) 118 ok = ok and data == C.BYTES_AC[dt][i]
|
D | decoder.py | 25 import tables as T, appendix_c as C namespace 107 for i in range(len(C.BYTES_AC[dt])): 109 pcm = lc3.decode(dec_c, bytes(C.BYTES_AC[dt][i])) 110 ok = ok and np.max(np.abs(pcm - C.X_HAT_CLIP[dt][i])) < 1
|
D | bwdet.py | 20 import tables as T, appendix_c as C namespace 137 E_B = C.E_B[dt] 138 P_BW = C.P_BW[dt]
|
/liblc3-3.5.0-3.4.0/ |
D | README.md | 78 The C implementation is unitary validated against this implementation and 79 intermediate values given in Appendix C of the specification.
|