meinardmueller / libtsm

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

division by zero

yiitozer opened this issue · comments

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.