keunwoochoi / torchaudio-contrib

A test bed for updates and new features | pytorch/audio
169 stars 22 forks source link

magphase #8

Closed faroit closed 5 years ago

faroit commented 5 years ago

@ksanjeevan you were using

torch.atan2(spec_0[..., 1], spec_0[..., 0])

in the phase vocoder. That reminds that we could add a function to get the magnitude and phase of the STFT output. Or in short: lets copy librosas magphase

ksanjeevan commented 5 years ago

Yeah that would be way cleaner/useful. Also breaking it down since torch doesn't have torch.angle like numpy does, something like:

def angle(tensor):
    return torch.atan2(tensor[...,1], tensor[...,0])