# Problem using pitch shifting with TD-PSOLA and formant preservation

I tried out this implementation of TD-PSOLA (https://github.com/sannawag/TD-PSOLA) and even though I know how the algorithm works, I can't understand why I get NO audible differences in the output when using f_ratio = 0.5, given that f_ratio = f_new/f_orig.

I've tried printing the length of 'peaks' (that would be the total number of peaks) arrays from both, the original signal and the new signal, by using find_peaks() again after shift_pitch() returns the output. I got these results:

f_ratio                            #orig_peaks                    #new_peaks
1                                    417                            416
0.9                                  417                            389
0.8                                  417                            403
0.7                                  417                            396
0.6                                  417                            324
0.5                                  417                            404


This looks completely nonsense to me.

I've already tried using another windows (numpy's Hamming, Hanning). Of course, it has to have something to do with the overlap-and-add process...right?

Any help would be greatly appreciated.

• The audio that are you using to test are in somewhere ? We can listen ? – ederwander Nov 5 '19 at 11:35
• As I can't upload the files, the easiest thing to do is to run the .py itself I guess :( – Rama Feichu Nov 11 '19 at 23:11
• I have implemented this algorithm in matlab and C, my code works great for monophonics sounds, maybe the Pitch Track from this python code fails(is just one basic autocorrelation code), to this code works nice in a large number of monophonics sound, you need a ultra super power pitch track algorithm, you can see my code working here – ederwander Nov 12 '19 at 10:44