static void pvq_pyr_project(const Word16 dim_proj, /* end vector dimension+1 */ const Word16 *xabs, /* absolute vector values */ Word32 L_xsum, /* absolute vector sum over dim */ Word16 num, /* target number of pulses */ Word16 * y, /* projected output vector */ Word16 *pulse_tot_ptr, Word32 *L_xy_ptr, /* accumulated correlation Q(in+0+1) = Qin+1 */ Word32 *L_yy_ptr /* accumulated energy Q0 */ ) { // pvq_pyr_project(dim, xabs, L_xsum, pulses_proj[0], y_far, &pulse_tot_far, &L_xy, // &L_yy); /* outlier submode projection */ Dyn_Mem_Deluxe_In( Counter i; Word32 L_tmp, L_num; Word16 den, shift_num, shift_den, shift_delta, proj_fac; ); *pulse_tot_ptr = 0; move16(); *L_xy_ptr = L_deposit_l(0); *L_yy_ptr = L_deposit_l(0); shift_den = norm_l(L_xsum); /* x_sum input Qin */ den = extract_h(L_shl_pos(L_xsum, shift_den)); /* now in Qin+shift_den */ L_num = L_deposit_l(num); shift_num = sub(norm_l(L_num), 1); L_num = L_shl_pos(L_num, shift_num); /* now in Q0 +shift_num -1 */ proj_fac = div_l(L_num, den); /* L_num always has to be less than den<<16 , norm_l-1 makes that happen */ shift_delta = sub(shift_num, shift_den); FOR (i = 0; i < dim_proj; i++) { L_tmp = L_mult(proj_fac, xabs[i]); /* Q shift_delta + PVQ_SEARCH_QIN */ y[i] = extract_h(L_shr(L_tmp, shift_delta)); move16(); /* to Q0 with floor , and potential sturation */ ; *pulse_tot_ptr = add(*pulse_tot_ptr, y[i]); /* Q0 */ *L_yy_ptr = L_mac0(*L_yy_ptr, y[i], y[i]); /* Energy, Q0 */ *L_xy_ptr = L_mac(*L_xy_ptr, xabs[i], y[i]); /* Corr, Q0*Q12 +1 --> Q13 */ } Dyn_Mem_Deluxe_Out(); }
时间: 2024-02-15 18:27:43 浏览: 20
这是一个静态函数,函数名为 `pvq_pyr_project`,接受多个参数:
- `dim_proj`:维度大小。
- `xabs`:绝对向量值。
- `L_xsum`:绝对向量总和。
- `num`:目标脉冲数。
- `y`:投影输出向量。
- `pulse_tot_ptr`:脉冲总数指针。
- `L_xy_ptr`:累积相关性指针。
- `L_yy_ptr`:累积能量指针。
该函数的作用是将输入向量进行投影,得到输出向量。具体实现过程为:
- 对输入向量进行归一化,得到一个分母 `den` 和一个除数 `proj_fac`。
- 对每个向量元素进行投影,得到输出向量 `y`。
- 计算脉冲总数、累积相关性和累积能量,并将其保存在指针中。
该函数的实现与定点数学有关,包含了左移、右移、乘法、除法等操作。
相关问题
(1)(pVq)∧ ¬(p∧q) → ¬( p↔q)(2)q →(p→r) →(pΛq)→r
首先证明(1):
(pVq)∧ ¬(p∧q) → ¬(p↔q)
推导过程如下:
1. 假设 (pVq)∧ ¬(p∧q) 成立
2. 由 ¬(p∧q) 可得 ¬p V ¬q
3. 由 (pVq)∧ ¬(p∧q) 可得 pVq 成立
4. 若 p 成立,则 q 成立
5. 若 q 成立,则 p 成立
6. 综上,得到 p↔q 成立
7. 由 2 和 6 可得 ¬(p↔q) 不成立
8. 由 1 和 7 可得 (pVq)∧ ¬(p∧q) 不成立
因此,(pVq)∧ ¬(p∧q) → ¬(p↔q) 成立。
接下来证明(2):
q →(p→r) →(pΛq)→r
推导过程如下:
1. 假设 q 成立
2. 假设 p→r 成立
3. 假设 pΛq 成立
4. 由 pΛq 可得 p 成立
5. 由 2 和 4 可得 r 成立
6. 由 3 可得 q 成立
7. 综上,得到 (pΛq)→r 成立
8. 由 1 和 7 可得 q →(p→r) →(pΛq)→r 成立
因此,(pVq)∧ ¬(p∧q) → ¬(p↔q) 且 q →(p→r) →(pΛq)→r 成立。
PYRAMID VECTOR QUANTIZER
Pyramid Vector Quantizer (PVQ) 是一种向量量化技术,可以用于信号编码、图像压缩等应用中。PVQ的主要优点是:高压缩比、低码率、低失真。它将向量分解成多个子向量,每个子向量都用一个矢量量化器进行编码,然后将所有子向量编码的结果拼接起来,形成整个向量的编码结果。PVQ的压缩效率和码率比传统的向量量化技术更高,但是计算量也相对较大。