|
6 | 6 | from os.path import expanduser |
7 | 7 | from datetime import date, datetime |
8 | 8 | import pandas as pd |
| 9 | +from scipy.signal import detrend |
9 | 10 |
|
10 | 11 | file_path = os.path.dirname(os.path.realpath(__file__)) |
11 | 12 | sys.path.append(os.path.normpath(file_path + '/..')) |
@@ -3205,8 +3206,13 @@ def allanVariancePQR(self, did=DID_IMU, fig=None, axs=None): |
3205 | 3206 | if np.all(pqr) != None and n<len(sensors): |
3206 | 3207 | # Averaging window tau values from dt to dt*Nsamples/10 |
3207 | 3208 | t = np.logspace(np.log10(dtMean), np.log10(0.1*np.sum(dt)), 200) |
| 3209 | + |
| 3210 | + # remove linear drift |
| 3211 | + w_detrended = detrend(pqr[:,i], type='linear') |
| 3212 | + |
3208 | 3213 | # Compute the overlapping ADEV |
3209 | | - (t2, ad, ade, adn) = allantools.oadev(pqr[:,i], rate=1/(dtMean/self.d), data_type="freq", taus=t) |
| 3214 | + # (t2, ad, ade, adn) = allantools.oadev(pqr[:,i], rate=1/(dtMean/self.d), data_type="freq", taus=t) |
| 3215 | + (t2, ad, ade, adn) = allantools.oadev(w_detrended, rate=1/(dtMean/self.d), data_type="freq", taus=t) |
3210 | 3216 | # Compute random walk and bias instability |
3211 | 3217 | t_bi_max = 1000 |
3212 | 3218 | idx_max = (np.abs(t2 - t_bi_max)).argmin() |
|
0 commit comments