Phase shifting a signal

Alfredo Carbonari's icon

Hi,
How do i implement phase shift on an audio signal in radians/degrees? I know allpass filters and phaseshift~ can give a phase shift, but how can I implement that using a control in degrees?

Floating Point's icon

as far as I understand this is not possible with allpass design.
think of the phase shift in allpass filters as being an artifact of delaying a signal, that is not really controllable in the way you want.

what I would do is perform an fft of your signal, add a (variable) phase constant to all frequency bins and then convert back to time-domain

Alfredo Carbonari's icon

So the algorithm should be like: fft of input, adding a phase variable to the imaginary part and ifft?

Floating Point's icon

someone with more experience with spectral domain processing may want to expand on this, but here is a simple example. Be warned, this is not a replacement for an allpass filter-- the process is completely different!

here's the main patch:

Max Patch
Copy patch and select New From Clipboard in Max.

and here's the pfft contents (save as "constant-phase-changer"):

Max Patch
Copy patch and select New From Clipboard in Max.

EDIT: compensatory delay should be 4096 samples less the signal vector size. why? don't know

Roman Thilenius's icon


because of pffts weird numbering scheme?