Take the 2-minute tour ×
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.

I have one cycle of the following signal stored in a memory:

 x(n)=sin(2 * pi * n/N + theta)

 where  theta= 2*pi*q/N and q, N are integers. 

How do I use these values to obtain sinusoides (samples) with same frequency but different phase?

share|improve this question

1 Answer 1

If the values are stored in a linear array indexed by $n$, read the values out sequentially from a different starting point in the array, that is beginning with a nonzero value of $n$, and have the read out "wrap" around the end of the array, that is, the incrementing of the index is done modulo $N$. This gives sinusoids with possible initial phases $0, 2\pi/N, (2)2\pi/N, (3)2\pi/N, \ldots, (N-1)2\pi/N$ depending on the choice of starting point of the read out. If you want other values for the initial phase, you will need to do some computations, and not just a plain reading out from memory.

share|improve this answer
1  
+1. Just to expound on Dilip's last comment a bit, if you want fine-grained phase values that don't correspond exactly to your table indices (a common occurrence), you have two options: 1. increase your table size (you obviously have to stop somewhere) or 2. interpolate between values. If your table is large enough to begin with, then you should be able to get away with simple linear interpolation between points for most applications. –  Jason R Feb 5 '13 at 13:52

Your Answer

 
discard

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

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