noelpedro / WES_Capstone_GNSS_MR

4 stars 5 forks source link

Acquisition peak #4

Open pedromiguelcp opened 1 year ago

pedromiguelcp commented 1 year ago

Hi again @noelpedro

In the last stages of the acquisition, the magnitude of the first and second peaks must be computed, as well as find their doppler & phase indexes.

My question is about how you compute the magnitude. You called magnitude estimation, and the formula you used was: (1) sum_squared=|ifft_output.real| + |ifft_output.imag|;

In the PCPS algorithm, the formula is: | |^2 For a complex number the equation is: (2) = [sqrt( (ifft_output.real)^2 + (ifft_output.imag)^2 )]^2 Simplifying, (3) = (ifft_output.real)^2 + (ifft_output.imag)^2

I don't think using equation (1) produces the same results as (3).

For example, consider the two cases: (A) ifft_output.real = 6 & ifft_output.imag = 6 (B) ifft_output.real = 1 & ifft_output.imag = 9

Using both equations the result is:
  For case A:
    (1) = 12
    (3) = 72
  For case B:
    (1) = 10
    (3) = 82

Following the equation you used (1), the main peak is on case A. Following the other equation (3), the main peak is on case B.

Do you perform additional calculus in SW to avoid multiplications in HW? I think the indexes could be wrong using your implementation.

noelpedro commented 1 year ago

I do a magnitude estimation to avoid the additional multiplication.

So I do abs() instead of abs()^2.

It worked for me to detect correlation peaks in acquisition step. Try it in matlab.

pedromiguelcp commented 1 year ago

I tried it in Matlab. Your implementation only fails when corner cases happen - as the one I explained. Of course, the magnitude of the peaks will always be wrong, but that can be solved by adjusting the acquisition threshold in SW.

noelpedro commented 1 year ago

Yup I used a threshold of 2.