Phase shifting a measured signal directly in time domain

  • Python
  • Thread starter vco
  • Start date
  • #1
vco
47
14

Main Question or Discussion Point

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:

Answers and Replies

  • #2
anorlunda
Staff Emeritus
Insights Author
8,603
5,495
How can we answer without knowing your algorithm. Is it a bucket brigade?
 
  • Like
Likes pbuk
  • #3
1,459
878
Are you conditioning the signal or messaging the data?
 
  • #4
FactChecker
Science Advisor
Gold Member
5,591
2,073
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.
 
  • #5
vco
47
14
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.

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.

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:
 

Related Threads on Phase shifting a measured signal directly in time domain

  • Last Post
Replies
0
Views
1K
  • Last Post
Replies
2
Views
2K
  • Last Post
Replies
9
Views
4K
  • Last Post
Replies
2
Views
1K
  • Last Post
Replies
3
Views
2K
  • Last Post
Replies
12
Views
2K
  • Last Post
Replies
5
Views
3K
  • Last Post
Replies
1
Views
930
Replies
5
Views
2K
Replies
5
Views
5K
Top