From 9022d768021bbe15c7815cc6f8b64218b46f0e10 Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Thu, 15 Oct 2020 16:27:49 +0200 Subject: Bump to upstream version 0.9.2 --- sine.c | 49 ++++++++++++++++++------------------------------- 1 file changed, 18 insertions(+), 31 deletions(-) (limited to 'sine.c') diff --git a/sine.c b/sine.c index 4e31f37..d912cd7 100644 --- a/sine.c +++ b/sine.c @@ -97,11 +97,10 @@ C2CONST c2const_create(int Fs, float framelength_s) { \*---------------------------------------------------------------------------*/ -void make_analysis_window(C2CONST *c2const, codec2_fft_cfg fft_fwd_cfg, float w[], COMP W[]) +void make_analysis_window(C2CONST *c2const, codec2_fft_cfg fft_fwd_cfg, float w[], float W[]) { float m; COMP wshift[FFT_ENC]; - COMP temp; int i,j; int m_pitch = c2const->m_pitch; int nw = c2const->nw; @@ -156,6 +155,8 @@ void make_analysis_window(C2CONST *c2const, codec2_fft_cfg fft_fwd_cfg, float w[ nw/2 nw/2 */ + COMP temp[FFT_ENC]; + for(i=0; iL; m++) { + /* Estimate ampltude of harmonic */ + den = 0.0; am = (int)((m - 0.5)*model->Wo*one_on_r + 0.5); bm = (int)((m + 0.5)*model->Wo*one_on_r + 0.5); - b = (int)(m*model->Wo/r + 0.5); - - /* Estimate ampltude of harmonic */ - den = 0.0; - Am.real = Am.imag = 0.0; - offset = FFT_ENC/2 - (int)(m*model->Wo*one_on_r + 0.5); for(i=am; iA[m] = sqrtf(den); if (est_phase) { + int b = (int)(m*model->Wo/r + 0.5); /* DFT bin of centre of current harmonic */ /* Estimate phase of harmonic, this is expensive in CPU for embedded devicesso we make it an option */ @@ -459,7 +447,7 @@ float est_voicing_mbe( C2CONST *c2const, MODEL *model, COMP Sw[], - COMP W[] + float W[] ) { int l,al,bl,m; /* loop variables */ @@ -497,9 +485,9 @@ float est_voicing_mbe( offset = FFT_ENC/2 - l*Wo*FFT_ENC/TWO_PI + 0.5; for(m=al; m