Lines Matching refs:gain
205 spx_word16_t *gain_floor; /**< Minimum gain allowed */
210 spx_word16_t *gain; /**< Ephraim Malah gain */
234 float agc_gain; /**< Current AGC gain */
235 float max_gain; /**< Maximum gain allowed */
236 float max_increase_step; /**< Maximum increase in gain from one frame to another */
237 float max_decrease_step; /**< Maximum decrease in gain from one frame to another */
239 float init_max; /**< Current gain limit during initialisation */
286 /* This function approximates the gain function
288 which multiplied by xi/(1+xi) is the optimal gain
316 /* Compute the gain floor based on different floors for the background noise and residual echo */
346 /* This function approximates the gain function
348 which multiplied by xi/(1+xi) is the optimal gain
385 /* Compute the gain floor based on different floors for the background noise and residual echo */
456 st->gain = (spx_word16_t*)speex_alloc((N+M)*sizeof(spx_word16_t));
486 st->gain[i]=Q15_ONE;
540 speex_free(st->gain);
827 /* Compute Ephraim & Malah gain speech probability of presence for each critical band (Bark scale)
836 /* Weiner filter gain */
851 st->gain[i] = EXTRACT16(MIN32(Q15_ONE, MULT16_32_Q15(prior_ratio, MM)));
853 st->old_ps[i] = MULT16_32_P15(QCONST16(.2f,15),st->old_ps[i]) + MULT16_32_P15(MULT16_16_P15(QCONST16(.8f,15),SQR16_Q15(st->gain[i])),ps[i]);
869 filterbank_compute_psd16(st->bank,st->gain+N, st->gain);
871 /* Use 1 for linear gain resolution (best) or 0 for Bark gain resolution (faster) */
876 /* Compute gain according to the Ephraim-Malah algorithm -- linear frequency */
886 /* Wiener filter gain */
892 /* EM gain with bound */
897 /* Constrain the gain to be close to the Bark scale gain */
898 if (MULT16_16_Q15(QCONST16(.333f,15),g) > st->gain[i])
899 g = MULT16_16(3,st->gain[i]);
900 st->gain[i] = g;
903 st->old_ps[i] = MULT16_32_P15(QCONST16(.2f,15),st->old_ps[i]) + MULT16_32_P15(MULT16_16_P15(QCONST16(.8f,15),SQR16_Q15(st->gain[i])),ps[i]);
905 /* Apply gain floor */
906 if (st->gain[i] < st->gain_floor[i])
907 st->gain[i] = st->gain_floor[i];
910 /*st->reverb_estimate[i] = st->reverb_decay*st->reverb_estimate[i] + st->reverb_decay*st->reverb_level*st->gain[i]*st->gain[i]*st->ps[i];*/
913 /* gain2 = [p*sqrt(gain)+(1-p)*sqrt(gain _floor) ]^2 */
914 tmp = MULT16_16_P15(p,spx_sqrt(SHL32(EXTEND32(st->gain[i]),15))) + MULT16_16_P15(SUB16(Q15_ONE,p),spx_sqrt(SHL32(EXTEND32(st->gain_floor[i]),15)));
918 /*st->gain2[i] = pow(st->gain[i], p) * pow(st->gain_floor[i],1.f-p);*/
925 st->gain[i] = MAX16(st->gain[i], st->gain_floor[i]);
926 tmp = MULT16_16_P15(p,spx_sqrt(SHL32(EXTEND32(st->gain[i]),15))) + MULT16_16_P15(SUB16(Q15_ONE,p),spx_sqrt(SHL32(EXTEND32(st->gain_floor[i]),15)));
932 /* If noise suppression is off, don't apply the gain (but then why call this in the first place!) */
939 /* Apply computed gain */