0

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?

LogicTom
  • 3
  • 2

1 Answers1

0

Indeed, as Jason R sais, that's how all sine oscillators are designed for synthesizers, they must change frequency without changing phase, so you have to control them only using a counter, and you vary the counter increment speed to change the sine/cosine frequency, in that way the sine is always one count onwards from it's previous value regardles of speed changes.

bandybabboon
  • 459
  • 2
  • 11