@@ -101,7 +101,6 @@ TempoTrackV2::filter_df(d_vec_t &df)
101101void
102102TempoTrackV2::calculateBeatPeriod (const vector<double > &df,
103103 vector<double > &beat_period,
104- vector<double > &tempi,
105104 double inputtempo, bool constraintempo)
106105{
107106 // to follow matlab.. split into 512 sample frames with a 128 hop size
@@ -168,7 +167,7 @@ TempoTrackV2::calculateBeatPeriod(const vector<double> &df,
168167 }
169168
170169 // now call viterbi decoding function
171- viterbi_decode (rcfmat,wv,beat_period,tempi );
170+ viterbi_decode (rcfmat,wv,beat_period);
172171}
173172
174173
@@ -228,7 +227,7 @@ TempoTrackV2::get_rcf(const d_vec_t &dfframe_in, const d_vec_t &wv, d_vec_t &rcf
228227}
229228
230229void
231- TempoTrackV2::viterbi_decode (const d_mat_t &rcfmat, const d_vec_t &wv, d_vec_t &beat_period, d_vec_t &tempi )
230+ TempoTrackV2::viterbi_decode (const d_mat_t &rcfmat, const d_vec_t &wv, d_vec_t &beat_period)
232231{
233232 // following Kevin Murphy's Viterbi decoding to get best path of
234233 // beat periods through rfcmat
@@ -316,13 +315,8 @@ TempoTrackV2::viterbi_decode(const d_mat_t &rcfmat, const d_vec_t &wv, d_vec_t &
316315 }
317316
318317 i_vec_t bestpath (T);
319- d_vec_t tmp_vec (Q);
320- for (int i = 0 ; i < Q; i++) {
321- tmp_vec[i] = delta[T-1 ][i];
322- }
323-
324318 // find starting point - best beat period for "last" frame
325- bestpath[T-1 ] = get_max_ind (tmp_vec );
319+ bestpath[T-1 ] = get_max_ind (delta[T- 1 ] );
326320
327321 // backtrace through index of maximum values in psi
328322 for (int t=T-2 ; t>0 ;t--) {
@@ -346,10 +340,6 @@ TempoTrackV2::viterbi_decode(const d_mat_t &rcfmat, const d_vec_t &wv, d_vec_t &
346340 for (int i = lastind; i < int (beat_period.size ()); i++) {
347341 beat_period[i] = beat_period[lastind];
348342 }
349-
350- for (int i = 0 ; i < int (beat_period.size ()); i++) {
351- tempi.push_back ((60 . * m_rate / m_increment)/beat_period[i]);
352- }
353343}
354344
355345double
0 commit comments