Permalink
Browse files

Add wrapper for calc_loop_gains().

  • Loading branch information...
1 parent 6946007 commit 93b27d9b78772764684b3cc5c319b7d9c77b16db @fnoble fnoble committed Feb 5, 2013
Showing with 28 additions and 0 deletions.
  1. +26 −0 swiftnav/track.pyx
  2. +2 −0 swiftnav/track_c.pxd
View
@@ -82,3 +82,29 @@ def calc_navigation_measurement(double t, chan_meas, es):
return nav_meas
+def calc_loop_gains(double bw, double zeta, double k, double sample_freq):
+ """
+ Wraps function :libswiftnav:`calc_loop_gains`.
+
+ Parameters
+ ----------
+ bw : float
+ The loop noise bandwidth
+ zeta : float
+ The damping ratio
+ k : float
+ The loop gain
+ sample_freq : float
+ The sampling frequency
+
+ Returns
+ -------
+ out : (float, float)
+ The tuple `(pgain, igain)`.
+
+ """
+ cdef double pgain
+ cdef double igain
+ track_c.calc_loop_gains(bw, zeta, k, sample_freq, &pgain, &igain)
+ return (pgain, igain)
+
View
@@ -29,4 +29,6 @@ cdef extern from "libswiftnav/track.h":
double sat_vel[3]
void calc_navigation_measurement_(u8 n_channels, channel_measurement_t* meas[], navigation_measurement_t* nav_meas[], double nav_time, ephemeris_t* ephemerides[])
+ void calc_loop_gains(double bw, double zeta, double k, double sample_freq,
+ double *pgain, double *igain)

0 comments on commit 93b27d9

Please sign in to comment.