meinardmueller / libtsm

Other
21 stars 2 forks source link

division by zero #1

Closed yiitozer closed 5 months ago

yiitozer commented 2 years ago

I had a division by zero problem while using the wsola_tsm() function: .../lib/python3.8/site-packages/libtsm/tsm.py:111: RuntimeWarning: invalid value encountered in true_divide ipa_sample = omega + hpi / ana_hop[i] # instantaneous phase advances per sample .../lib/python3.8/site-packages/libtsm/tsm.py:209: RuntimeWarning: divide by zero encountered in true_divide min_fac = np.min(syn_hop / ana_hop[1:]) # the minimal local stretching factor

You could add an exception for the case where an index of the "ana_hop" variable is 0.