# Digital phase lead in MCU

1. ## Digital phase lead in MCU

Hi

I have two input signals A and B , which are sinusoidal in nature. All that I have to do is to ensure that both signals are exactly in phase. I have observed that A lags B by 1 degree. How do I compensate this in MCU?

•

2. ## Re: Digital phase lead in MCU

Hi,

sinusoidal signals are analog signals, but your MCU is a digital device. Thus I assume there is an ADConverter involved.

--> for a detailed answer you need to provide the information about your complete signal chain.

For now I can give only a general answer: lag signal B by 1 degree.

Klaus

•

3. ## Re: Digital phase lead in MCU

Hi

I use a Simultaneous sample ADC in between the signal and MCU. How do I lag signal B by 1 degree. Any sample c code ?

•

4. ## Re: Digital phase lead in MCU

Hi,

No values, how can you expect a good advice?

--> delay it by a sufficient count of ADC samples.

Honestly. We donīt know nothing. We donīt know whether 1 degree means 1000 samples or 1/1000 of a sample.

Klaus

5. ## Re: Digital phase lead in MCU

Hi
Input signals are 50Hz, sampling frequency is 2500 Hz. How to delay the samples?

•

6. ## Re: Digital phase lead in MCU

Hi,

May I ask why you don't show a little effort of your own to motivate members to spend time for you?

At least two values.
Did you calculate the delay time?
Td = phase_angle / ( frequency Ũ 360°)

Or sampling period time?
Ts = 1 / f_sample

..to get to know whether it is more or less of a sample period

A bit of additional information could help also: why not using an analog filter. What's the application. How did you measure the 1°?...

Klaus

7. ## Re: Digital phase lead in MCU

Hi

I measured 1 degree through the oscilloscope (phase1-phase2). Can we digitally phase shift?

--[[ ]]--