2
$\begingroup$

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:

enter image description here

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

$\endgroup$
5
  • 1
    $\begingroup$ Can you tell us exactly what you want to shift? Are you aware of linear phase filters? $\endgroup$ Feb 18, 2021 at 11:06
  • $\begingroup$ Hello Marcus, to be clear I edited my post, and I attached gif to present exactly what I mean by shift rotation $\endgroup$
    – pajczur
    Feb 18, 2021 at 11:28
  • 1
    $\begingroup$ 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. $\endgroup$
    – Matt L.
    Feb 18, 2021 at 12:35
  • $\begingroup$ @MattL. Well, its good to know there are answers, already... $\endgroup$ Feb 18, 2021 at 12:42
  • $\begingroup$ it would be a pretty sophisticated time-variant APF. $\endgroup$ Feb 18, 2021 at 19:57

1 Answer 1

5
$\begingroup$

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');

result

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:

FIR

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.

$\endgroup$
10
  • $\begingroup$ Ok, great thanks but it still looks like I need frequency domain to do that. Need I? $\endgroup$
    – pajczur
    Feb 18, 2021 at 12:13
  • $\begingroup$ @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. $\endgroup$ Feb 18, 2021 at 12:21
  • $\begingroup$ 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. $\endgroup$
    – pajczur
    Feb 18, 2021 at 12:38
  • $\begingroup$ @pajczur I've already said what the code is for. $\endgroup$ Feb 18, 2021 at 12:41
  • 1
    $\begingroup$ 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. $\endgroup$
    – TimWescott
    Feb 18, 2021 at 18:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.