Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

- Community Forums
- :
- Forums
- :
- Hardware Development
- :
- AI Engine, DSP IP and Tools
- :
- add phase shift to signal

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Highlighted
##

just like to know how do I add phase shift to a sin signal? is it just exp(-j 2*pi/4) if I want 90 degree phase shift? also can I use cordic for phase shift?

s002wjhw

Voyager

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

08-16-2017 07:19 AM

4,448 Views

Registered:
06-26-2015

add phase shift to signal

8 Replies

Highlighted
##

hbucher

Scholar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

08-16-2017 07:40 AM - edited 08-16-2017 08:01 AM

4,442 Views

Registered:
03-22-2016

In general

s = A*exp( i*(w*t + P) )

where

A = amplitude

w = 2*PI*f (frequency in radians/sec)

t = time

P = phase

If you want to change the phase, you just add PI/4 to P. However if you do this at once, it will produce a 'click' sound or in radio transmissions, it will spill over the entire spectrum. You got to add phase incrementally over a period of time. The bigger the period, less spillover.

Interestingly enough, this extra phase added over a certain period of time is the exact definition of frequency. So let's say you add an extra phase H over a period of time T such that

phase = H*t/T

Then the formula becomes

s = A*exp( i*(w*t + P) ) = A*exp( i*(w*t + H*t/T) ) = A*exp( (i*(w + H/T)*t) )

in other words, in the transition phase you are increasing the frequency by H/(2*PI*T). This can be seen on a git repo I wrote some time ago. Look at WaveGenerator::recalc()

https://github.com/HFTrader/WavDecoder/blob/master/WaveGenerator.h

vitorian.com --- We do this **for fun**. Always give kudos. Accept as solution if your question was answered.

*I will not answer to personal messages - use the forums instead.*

Highlighted
##

thx,

say if I want produce this phase incrementally so it doesn't has that click you mention.

is its

exp(i*w*n)*exp(i*p) say exp(I*w*n)=x(n) my signal.

then its x(n)*exp(I*p). then all I really need is a constant phase * every sample of x(n).

s002wjhw

Voyager

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

08-16-2017 10:13 AM

4,417 Views

Registered:
06-26-2015

say if I want produce this phase incrementally so it doesn't has that click you mention.

is its

exp(i*w*n)*exp(i*p) say exp(I*w*n)=x(n) my signal.

then its x(n)*exp(I*p). then all I really need is a constant phase * every sample of x(n).

Highlighted
##

vitorian.com --- We do this **for fun**. Always give kudos. Accept as solution if your question was answered.

*I will not answer to personal messages - use the forums instead.*

hbucher

Scholar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

08-16-2017 10:23 AM

4,414 Views

Registered:
03-22-2016

Basically, yes.

However notice that p is increasing, it is not a constant. But you can do something like

c0 = exp(i*P/T) ; // phase incremental per time step ct = 1 // phase added for ( j ... ) { y[j] = x[j] * ct; // add phase to signal ct = ct * c0; // increment phase }

That should work.

Highlighted
##

also, I read somewhere that I can supersampling a signal by adjusting its offset.

so if I have 100mhz, want to produce 200mhz sample. I need combine the 100mhz and 100mhz with phase offset of 2pi/pi. This produce 2 signal in parallel when combine give me 200mhz. anyone has an idea how this work or has article on it? I can't seem to get it working in matlab.

s002wjhw

Voyager

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

08-16-2017 10:41 AM

4,410 Views

Registered:
06-26-2015

so if I have 100mhz, want to produce 200mhz sample. I need combine the 100mhz and 100mhz with phase offset of 2pi/pi. This produce 2 signal in parallel when combine give me 200mhz. anyone has an idea how this work or has article on it? I can't seem to get it working in matlab.

Highlighted
##

vitorian.com --- We do this **for fun**. Always give kudos. Accept as solution if your question was answered.

*I will not answer to personal messages - use the forums instead.*

hbucher

Scholar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

08-16-2017 11:01 AM

4,408 Views

Registered:
03-22-2016

@s002wjhw This is the basic of superheterodyne receivers

https://en.wikipedia.org/wiki/Superheterodyne_receiver

exp( i*(w+W)*t ) = exp( i*w*t + i*W*t ) = exp( i*w*t )*exp(i*W*t)

So basically you set a cordic on frequency W and multiply it by your signal.

The problem with real (non complex) signals is that you create TWO other signals at (w+W) and (w-W) so you have to use a low/band pass filter to eliminate w-W.

sin(w*t)sin(W*t) = 0.5*cos(w*t-W*t) - 0.5*cos(w*t+W*t)

https://en.wikipedia.org/wiki/Heterodyne#Mathematical_principle

Highlighted
##

thx for the info, DSP is not really my specialty.

i was gonna use 8xDDS in parallel to have a supersample of 800mhz(each dds 100mhz with constant offset of 2pi/8) I'm attempt to do the same in matlab 1st, by modify 8*100mhz wave with phase offset, but like you said there is the phase accumlations. Then combine into 800mhz, but my code didn't work, so I'm searching article/example on polyphase dds. couldn't seem find too much info

s002wjhw

Voyager

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

08-16-2017 11:24 AM

4,396 Views

Registered:
06-26-2015

i was gonna use 8xDDS in parallel to have a supersample of 800mhz(each dds 100mhz with constant offset of 2pi/8) I'm attempt to do the same in matlab 1st, by modify 8*100mhz wave with phase offset, but like you said there is the phase accumlations. Then combine into 800mhz, but my code didn't work, so I'm searching article/example on polyphase dds. couldn't seem find too much info

Highlighted
##

if i have

x1 = cos(2*pi*100e6*t);

x2 = cos(2*pi*100e6*t+pi);

how would i combine the two into 200e6 signal for supersampling?

s002wjhw

Voyager

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

08-16-2017 11:39 AM

4,395 Views

Registered:
06-26-2015

x1 = cos(2*pi*100e6*t);

x2 = cos(2*pi*100e6*t+pi);

how would i combine the two into 200e6 signal for supersampling?

Highlighted
##

i thought about the mixer method, but i heard there are other method by using polyphase rather then multiplication of two signal.

s002wjhw

Voyager

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

08-16-2017 11:44 AM

4,394 Views

Registered:
06-26-2015