Phase shifting a measured signal directly in time domain

Join the discussion
Registration is free. Start your own thread to ask a follow-up.
4 replies · 2K views
vco
Messages
48
Reaction score
15
I need to perform a phase shift for a measured time domain signal. The signal consists of around 1000 points. I wrote an algorithm for this in Python a while ago and it seems to work as intended, but now I noticed that the algorithm is actually unexpectedly slow.

Is it so that phase shifting is usually performed by first transforming the signal into frequency domain and then back to time domain once the shifting has been done? My algorithm does the phase shifting directly in time domain; is this the probable reason for the poor performance?

Edit: In other words (and maybe more specifically) I mean time-delaying a periodic signal. My data consists of a single period of the signal.
 
Last edited:
Physics news on Phys.org
Are you conditioning the signal or messaging the data?
 
vco said:
Edit: In other words (and maybe more specifically) I mean time-delaying a periodic signal. My data consists of a single period of the signal.
This is still not very specific. Are you just shifting the data a fixed number of time steps in the array? If so, it should be very fast. Are you interpolating in some way to time-shift a non-integer amount of time steps? In that case, it might take a long execution time, depending on your interpolation method.
 
anorlunda said:
How can we answer without knowing your algorithm.
Quite right. :smile: I was just wondering whether the "direct" approach was known to be significantly worse in terms of performance compared to the apparently more common FFT approach.

hutchphd said:
Are you conditioning the signal or messaging the data?
The original signal will be used as input/reference for certain engineering calculations where the signal is time-delayed by various amounts according to other inputs.

FactChecker said:
This is still not very specific. Are you just shifting the data a fixed number of time steps in the array? If so, it should be very fast. Are you interpolating in some way to time-shift a non-integer amount of time steps? In that case, it might take a long execution time, depending on your interpolation method.
Non-integer amount of time steps.

Anyway, there was a silly mistake in my algorithm which increased the required number of operations by a factor of order n, where n is the number of points in the signal. All is good now. :smile: