# HG changeset patch # User Chris Cannam # Date 1538644652 -3600 # Node ID 3835e03650cc34fa85dd4e12ee504a1955a98c18 # Parent 436eab0bc1fffafda6fb8ea9d4f45dd84189d4ee Change calculation of frequency index based on the usual FFT bin frequencies. I'm troubled by this change, but it does appear to produce the correct result. diff -r 436eab0bc1ff -r 3835e03650cc FChTransformF0gram.cpp --- a/FChTransformF0gram.cpp Thu Oct 04 09:46:30 2018 +0100 +++ b/FChTransformF0gram.cpp Thu Oct 04 10:17:32 2018 +0100 @@ -615,11 +615,7 @@ double aux_pos; for (int i = 0; i < m_glogs_num_f0s; i++) { for (int j = 1; j <= m_glogs_n[i]; j++) { - // indice en el vector de largo t_warp/2+1 donde el ultimo valor corresponde a f=m_fmax - aux_pos = ((double)j*m_glogs_f0[i])*((double)(m_warp_params.nsamps_twarp/2+1))/m_fmax; -//!!! cerr << "aux_pos = " << aux_pos << endl; -// aux_pos = ((double)j*m_glogs_f0[i])*((double)(m_warp_params.nsamps_twarp/2+1))/m_warpings.fs_warp; -// cerr << "or " << aux_pos << " (as fs_warp = " << m_warpings.fs_warp << ")" << endl; + aux_pos = ((double)j * m_glogs_f0[i]) * ((double)(m_warp_params.nsamps_twarp))/m_warpings.fs_warp; m_glogs_posint[aux_index] = (int)aux_pos; m_glogs_posfrac[aux_index] = aux_pos - (double)m_glogs_posint[aux_index]; aux_index++;