# Phase rotation without Fourier Transform

Is there any known math equation or other method to perform phase rotation on signal without decomposing it to frequency domain?

In frequency domain it is obvious. You just need to perform phase shift for each frequency. But decomposing signal from time domain to freq domain, then perform phase shift on each frequency, then again composing it to time domain it is very computationally demanding for frequency-rich signal.

That's why I wonder if I can achieve it without decomposing signal to frequency domain?

To be clear I want to perform on the signal something like that:

But I don't know the frequencies in the signal. I just have time domain signal. Is that possible?

• Can you tell us exactly what you want to shift? Are you aware of linear phase filters? Feb 18 at 11:06
• Hello Marcus, to be clear I edited my post, and I attached gif to present exactly what I mean by shift rotation Feb 18 at 11:28
• This puzzle question and its answers is what you're looking for. You need a Hilbert transformer, which can be implemented in the time domain, e.g., by an FIR filter. Feb 18 at 12:35
• @MattL. Well, its good to know there are answers, already... Feb 18 at 12:42
• it would be a pretty sophisticated time-variant APF. Feb 18 at 19:57

You can use the Hilbert transform, then multiply the real part with the sine of the angle you wish to transform, and the imaginary part wth the cosine. A quick code in Octave:

t=[0:0.01:4];
s=hilbert(1-2*mod(t,1));
a=real(s);
b=imag(s);
phi=[0:0.5:6];
test=a.*sin(phi)+b.*cos(phi);
plot(a+4,"",test');


I know there are Hilbert transforms made with IIRs, but their phase is not exactly linear, so a FIR is a better, but costlier choice. Its order will be a function of the lowest frequency of interest, which will count as the transition width. If your bandwidth is large, the order will be large.

A FIR is a filter, which means it acts in time domain (but, implicitly, the frequency domain will be affected). To give an example, the signal you're showing of 1 Hz, sampled at 32 Hz, filtered with a FIR with a Kaiser window with As=60 and 1 Hz transition width:

The output isn't sampled because I am brute-adding the two inputs, but that's how the result would look like. The green number is the order. It's a symmetrical FIR so you'll need that many delays and half as many multipliers. You could try a polyphase approach and that will reduce the number of delays, but not the multipliers.

• Ok, great thanks but it still looks like I need frequency domain to do that. Need I? Feb 18 at 12:13
• @pajczur A Hilber transformer FIR is a Finite Impulse Response filter. That's in time domain. The phi is a constant with which you multiply the decomposition. Feb 18 at 12:21
• Ok, so great thanks. Could you tell me what is the code you presented and where I can test it? I suppose it’s Matlab, but I don’t have Matlab so that code is not clear for me. Feb 18 at 12:38
• @pajczur I've already said what the code is for. Feb 18 at 12:41
• A C++ Hilbert Transform implementation that you happened to find uses the Fourier Transform. The Hilbert Transform is just a FIR filter, which doesn't need the Fourier Transform to implement. It may be faster to use a FFT, if you happen to choose a long Hilbert Transform, but it isn't necessary. Feb 18 at 18:31