bristlemouth / bm_protocol

Primary Bristlemouth firmware repository
https://www.bristlemouth.org/
Apache License 2.0
12 stars 8 forks source link

circ mean + std #12

Closed russelldeguzman closed 1 year ago

russelldeguzman commented 1 year ago

Adding circular mean and std.

Testing: Unit test - circ mean verified against https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.circmean.html circ std verified against custom python impl:

The wave std (in radians) is:
np.sqrt(2 - 2 * np.sqrt(a1 ** 2 + b1 ** 2)
where a1 is the mean of the cosine of the angles, and b1 is the mean of the sine of the angles.