Signal Processing Stack Exchange is a question and answer site for practitioners of the art and science of signal, image and video processing. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to phase shift an incoming sine wave with varying frequency but I am unsure how to go about doing so in practical terms.

A little more info regarding the requirements: I have an encoder producing a sine/cosine pair with a fixed Peak to Peak but as the speed changes so obviously does the frequency. I want to effectively advance/retard the signal by altering the phase of the incoming signal.

Where I am unsure is how to go about doing this, if I use a look up table (LUT) for fast frequencies this would be ok but at slower frequencies I am going to get a very rough (digitised) signal. I was thinking I could calculate the signal 'on the fly' but again that would require having a LUT ie output = sin (input(amplitude) + offset[amplitude])

I think I maybe going about this the wrong way and there is possibly a simple solution to this?

share|improve this question
So you want to phase shift a sine/cosine pair that has the same frequency? – Jim Clay Feb 25 '13 at 17:18
Yes, the cosine is provided to determine direction so will always be the same frequency. – LogicTom Feb 25 '13 at 17:21
I will also add that I have been looking into both 'standard' microcontrollers as well as DSP based micros - if that alters the implementation options available. – LogicTom Feb 25 '13 at 17:24
You want an NCO. See other questions here and here. – Jason R Feb 25 '13 at 18:07

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.