void synthesise_one_frame(struct CODEC2 *c2, short speech[], MODEL *model, COMP Aw[]) { int i; PROFILE_VAR(phase_start, pf_start, synth_start); #ifdef DUMP dump_quantised_model(model); #endif PROFILE_SAMPLE(phase_start); phase_synth_zero_order(c2->fft_fwd_cfg, model, &c2->ex_phase, Aw); PROFILE_SAMPLE_AND_LOG(pf_start, phase_start, " phase_synth"); postfilter(model, &c2->bg_est); PROFILE_SAMPLE_AND_LOG(synth_start, pf_start, " postfilter"); synthesise(c2->fft_inv_cfg, c2->Sn_, model, c2->Pn, 1); PROFILE_SAMPLE_AND_LOG2(synth_start, " synth"); ear_protection(c2->Sn_, N); for(i=0; i<N; i++) { if (c2->Sn_[i] > 32767.0) speech[i] = 32767; else if (c2->Sn_[i] < -32767.0) speech[i] = -32767; else speech[i] = c2->Sn_[i]; } }
void synthesise_one_frame(CODEC2 *c2, short speech[], MODEL *model, float ak[]) { int i; phase_synth_zero_order(model, ak, &c2->ex_phase, LPC_ORD); postfilter(model, &c2->bg_est); synthesise(c2->Sn_, model, c2->Pn, 1); for(i=0; i<N; i++) { if (c2->Sn_[i] > 32767.0) speech[i] = 32767; else if (c2->Sn_[i] < -32767.0) speech[i] = -32767; else speech[i] = c2->Sn_[i]; } }
void synth_one_frame(kiss_fft_cfg fft_inv_cfg, short buf[], MODEL *model, float Sn_[], float Pn[], int prede, float *de_mem, float gain) { int i; synthesise(fft_inv_cfg, Sn_, model, Pn, 1); if (prede) de_emp(Sn_, Sn_, de_mem, N); for(i=0; i<N; i++) { Sn_[i] *= gain; if (Sn_[i] > 32767.0) buf[i] = 32767; else if (Sn_[i] < -32767.0) buf[i] = -32767; else buf[i] = Sn_[i]; } }