Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Relative phase output samples in DSP

Maitry07

Full Member level 2
Full Member level 2
Joined
Jun 29, 2022
Messages
130
Helped
0
Reputation
0
Reaction score
0
Trophy points
16
Activity points
1,165
I am using Zynq ultra scale+ FPGA. In which I am using CORDIC IP cores to utilize the functionality of square root as well as Atan for measurement of amplitude and absolute phase from I and Q data.
From the absolute phase outputs , I am using subtraction to generate relative phase between 2 outputs. On the generated relative phase, I am applying moving average algorithm to increase accuracy in the measured relative phase.

During validation, One thing I observed as below.
When my measured relative phase is 0 deg or 360 deg. at that time , my moving average output is incorrect. after further debugging, I came to know that the measured relative phase output samples has approx. 0.28 to 359.6 deg variation in 1024 samples. due to which moving average output becomes incorrect for 0 deg or 360 deg.
How to mitigate this issue? what would be the suitable method.

because slight variation in the measured relative phase output samples will be there that's why we are using moving average.

Awaited your feedback and guidance.
 
ok, got your point. I will try this. also, I found that addition of moving average adds delay to the due to its processing time. as far as we increase the moving averaging factor, delay increases. so, If my main source of input from external environment is stable and standard such as tektronix function generator. based on which my I and Q are being generated. how much moving average factor need to be considered. need to trade off between delay and moving averaging factor, right?
 
I am trying to picture your setup and aim but none is clear.
you have two input pairs of I/Q from tektronix, let us call them IQ1 and IQ2
You pass each pair through cordic (FPGA) to get amplitude and phase of each pair... yes??
You then subtract the two phases and then average the resulting difference.

for the moment I thought phase is instantaneous yet you are averaging it... I am lost
 
From tektronix my relative phase difference between 2 inputs will be 90 deg at the moment which can be changed based on command. so I need to constantly measure the relative phase between the two inputs.
Now as CORDIC IP core can generate amplitude and absolute phase.
I have taken 2 CORDIC IP cores.
1st CORDIC IP generate amplitude for channel 1 and absolute phase for channel 1 ( from IQ1)
2nd CORDIC IP generate amplitude for channel 2 and absolute phase for channel 2 (from IQ2)

I am subtracting absolute phase 1- absolute phase 2 to generate 1 relative phase. this relative phase I am averaging.
 
so you are averaging the phase error for constant two inputs known difference. What is IQ signal nature? is it cos/sin or random.
if cos/sin, are they both at same frequency?
 
Both my inputs from tektronix are CW tone having the same frequency. the relative phase is 90 deg and amplitude levels are different.
 
ok then your setup sounds sensible.
consider:
- noise (SNR, try nice amplitude)
- check any saturation
- cordic bugs
- capture input/output of cordic and check in matalb/octave, provide copy here
- check your subtractor performance
 
Actually I have tried different range as well. My high speed ADC full scale input power is -2.2 dBm. so when I provide input near to full scale. My relative phase output is accurate. and even after moving averaging , I am getting accurate results even at 0 deg phase difference or 360 deg phase difference. so that was my original question. when my relative phase difference is 0 deg or 360 deg.

so when my amplitude is near full scale from tektronix generator with relative phase difference of 0 deg or 360 deg. my Measurement is accurate after moving average . that means all the generated samples at the output of subtractor are in the range of 0.2+/- 0.05 deg .

but when I go down from the full scale, which is near to -30 dBm with relative phase difference of 0 deg. my accuracy degrades and subtractor output range becomes 359.8 to 0.3 deg. which is when my moving averaging is providing incorrect result.

so, accuracy decrease with the input amplitude. but as my requirement is to measure the relative phase with the range of -40 to full scale. I need to figure out this problem arise at lower amplitude and with 0 deg phase difference.

FYI: My high speed ADC is 16 bit ADC. so the dynamic range is very high and also SNR is proper. how to mitigate this issue.
as moving average also adds delay in the overall measurement. and it provides incorrect result at 0 deg or 360 deg relative phase difference
 
You can spot the issue if you capture input/output.
if you are averaging the difference the delay is irrelevant since it the subtractor that is final module that captures the difference.
 
If phase difference is near zero, you can easily average after translating 0 to 360 degree to +/- 180 degree.
My previous suggestion to average in cartesian coordinates (I/Q) is only necessary if angles have arbitary values over the full range.
 
You can spot the issue if you capture input/output.
if you are averaging the difference the delay is irrelevant since it the subtractor that is final module that captures the difference.
Yes, I have captured input and output. My subtractor output for relative phase is having less accuracy when my both RF inputs amplitude is lower. that means, I and Q values accuracy may be lower for lower amplitude.

For delay, I mean to say, The overall time from RF input to measured relative phase output.
--- Updated ---

If phase difference is near zero, you can easily average after translating 0 to 360 degree to +/- 180 degree.
My previous suggestion to average in cartesian coordinates (I/Q) is only necessary if angles have arbitary values over the full range.
My requirement is to represent the relative phase in 0 to 360 deg only. and My I/Q is from CW tone (RF inputs) there is no kind of modulation and all. so I think angles will not have arbitrary values, right? so how to mitigate this issue
 
yes, Actually I have implemented logic at the subtractor output to convert +/-180 deg to 0 to 360 deg. because the samples at the output of subtractor is the combined samples which generate relative phase output in terms of +/-180 deg based on the quadrant of I and Q . so I have changed that to 0 to 360 deg. because I need this 0 to 360 range only.
 

LaTeX Commands Quick-Menu:

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top