@@ -25,6 +25,7 @@ from libc.stdlib cimport malloc, free
2525from libc.string cimport memset, memcpy
2626from signal cimport GNSSSignal
2727from signal import GNSSSignal
28+ from numpy import real, imag
2829
2930# Discriminators
3031
@@ -236,19 +237,18 @@ cdef class AidedTrackingLoop:
236237 """
237238
238239 def __cinit__ (self , **kwargs ):
239- self ._thisptr = kwargs
240240 aided_tl_init(& self ._thisptr,
241- self ._thisptr. loop_freq,
242- self ._thisptr. code_freq,
243- self ._thisptr. code_bw,
244- self ._thisptr. code_zeta,
245- self ._thisptr. code_k,
246- self ._thisptr. carr_to_code,
247- self ._thisptr. carr_freq,
248- self ._thisptr. carr_bw,
249- self ._thisptr. carr_zeta,
250- self ._thisptr. carr_k,
251- self ._thisptr. carr_freq_b1)
241+ kwargs[ ' loop_freq' ] ,
242+ kwargs[ ' code_freq' ] ,
243+ kwargs[ ' code_bw' ] ,
244+ kwargs[ ' code_zeta' ] ,
245+ kwargs[ ' code_k' ] ,
246+ kwargs[ ' carr_to_code' ] ,
247+ kwargs[ ' carr_freq' ] ,
248+ kwargs[ ' carr_bw' ] ,
249+ kwargs[ ' carr_zeta' ] ,
250+ kwargs[ ' carr_k' ] ,
251+ kwargs[ ' carr_freq_b1' ] )
252252
253253
254254 def retune (self , code_params , carr_params , loop_freq , carr_freq_igain , carr_to_code ):
@@ -277,16 +277,18 @@ cdef class AidedTrackingLoop:
277277 self .carr_bw, self .carr_zeta, self .carr_k,
278278 self .carr_freq_igain)
279279
280- def update (self , cs ):
280+ def update (self , E , P , L ):
281281 """
282282 Wraps the function :libswiftnav:`aided_tl_update`.
283283
284284 Parameters
285285 ----------
286- cs : [complex], :math:`I_E + Q_E j`
287- The early correlation. The real component contains the in-phase
288- correlation and the imaginary component contains the quadrature
289- correlation. The prompt correlation. The late correlation.
286+ E : [complex], :math:`I_E + Q_E j`
287+ Complex Early Correlation
288+ P : [complex], :math:`I_P + Q_P j`
289+ Complex Prompt Correlation
290+ L : [complex], :math:`I_L + Q_L j`
291+ Complex Late Correlation
290292
291293 Returns
292294 -------
@@ -295,11 +297,17 @@ cdef class AidedTrackingLoop:
295297
296298 """
297299 cdef correlation_t cs_[3 ]
298- cs_[0 ] = cs[0 ]._thisptr
299- cs_[1 ] = cs[1 ]._thisptr
300- cs_[2 ] = cs[2 ]._thisptr
300+ cs_[0 ].I = real(E)
301+ cs_[0 ].Q = imag(E)
302+ cs_[1 ].I = real(P)
303+ cs_[1 ].Q = imag(P)
304+ cs_[2 ].I = real(L)
305+ cs_[2 ].Q = imag(L)
301306 aided_tl_update(& self ._thisptr, cs_)
302- return (self .code_freq, self .carr_freq)
307+ return (self ._thisptr.code_freq, self ._thisptr.carr_freq)
308+
309+ def to_dict (self ):
310+ return self ._thisptr
303311
304312cdef class CompTrackingLoop:
305313 """
@@ -396,10 +404,10 @@ cdef class CN0Estimator:
396404
397405 def __cinit__ (self , **kwargs ):
398406 cn0_est_init(& self ._thisptr,
399- self ._thisptr.bw ,
400- self ._thisptr. cn0_0,
401- self ._thisptr. cutoff_freq,
402- self ._thisptr. loop_freq)
407+ kwargs[ ' bw ' ] ,
408+ kwargs[ ' cn0_0' ] ,
409+ kwargs[ ' cutoff_freq' ] ,
410+ kwargs[ ' loop_freq' ] )
403411
404412 def update (self , I , Q ):
405413 """
0 commit comments