Mercurial > hg > vamp-fanchirp
comparison FChTransformF0gram.cpp @ 18:3835e03650cc spect
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.
author | Chris Cannam |
---|---|
date | Thu, 04 Oct 2018 10:17:32 +0100 |
parents | 436eab0bc1ff |
children | d7fbd446f47f |
comparison
equal
deleted
inserted
replaced
17:436eab0bc1ff | 18:3835e03650cc |
---|---|
613 // Compute int & frac of interpolation positions | 613 // Compute int & frac of interpolation positions |
614 int aux_index = 0; | 614 int aux_index = 0; |
615 double aux_pos; | 615 double aux_pos; |
616 for (int i = 0; i < m_glogs_num_f0s; i++) { | 616 for (int i = 0; i < m_glogs_num_f0s; i++) { |
617 for (int j = 1; j <= m_glogs_n[i]; j++) { | 617 for (int j = 1; j <= m_glogs_n[i]; j++) { |
618 // indice en el vector de largo t_warp/2+1 donde el ultimo valor corresponde a f=m_fmax | 618 aux_pos = ((double)j * m_glogs_f0[i]) * ((double)(m_warp_params.nsamps_twarp))/m_warpings.fs_warp; |
619 aux_pos = ((double)j*m_glogs_f0[i])*((double)(m_warp_params.nsamps_twarp/2+1))/m_fmax; | |
620 //!!! cerr << "aux_pos = " << aux_pos << endl; | |
621 // aux_pos = ((double)j*m_glogs_f0[i])*((double)(m_warp_params.nsamps_twarp/2+1))/m_warpings.fs_warp; | |
622 // cerr << "or " << aux_pos << " (as fs_warp = " << m_warpings.fs_warp << ")" << endl; | |
623 m_glogs_posint[aux_index] = (int)aux_pos; | 619 m_glogs_posint[aux_index] = (int)aux_pos; |
624 m_glogs_posfrac[aux_index] = aux_pos - (double)m_glogs_posint[aux_index]; | 620 m_glogs_posfrac[aux_index] = aux_pos - (double)m_glogs_posint[aux_index]; |
625 aux_index++; | 621 aux_index++; |
626 } | 622 } |
627 } | 623 } |