Skip to main content
. 2023 Apr 19;23(8):4111. doi: 10.3390/s23084111
Algorithm 4 Pseudocode for circle fit estimation
  • 1:

    procedure CircleFit(iq, previous_circles)

  •  

     

  • 2:

        nLength(iq)

  • 3:

        centroid_I,centroid_QMean(iq)

  • 4:

        iComplex(iq)centroid_I

  • 5:

        qImag(iq)centroid_Q

  • 6:

        zi2+q2

  •  

     

  • 7:

        MCovariance(i,q,z)/n

  • 8:

        acoefficients_characteristic_polynomial

  •  

     

  • 9:

    loop:

  • 10:

        y_new=a(1)+x_new(a(2)+x_new(a(3)+x_newa(4)))

  • 11:

        x_new=x_oldy_newDy

  • 12:

        if (x_newx_old)/x_new<eps then

  • 13:

            break

  • 14:

        goto loop.

  •  

     

  • 15:

        a,b,restimatedbyusingeigenvectorrelatedtorootx_new

  • 16:

        a,b,r[a+centroid,b+centroid,r]

  • 17:

        previous_circlesrunningbufferoverlast30estimatedcircles

  • 18:

        a,b,rMean(previous_circles)

  •  

     

  • 19:

        returna,b,r