-
Notifications
You must be signed in to change notification settings - Fork 80
Description
Hi,
I'd like to suggest a small change in the calc_adev_phase function:
The line
s = np.sum(v_arr * v_arr)
should be replaced by
s = np.sum(abs(v_arr)**2)
This will make the adev and oadev functions work with complex data, without breaking anything for real data. Currently, adev and oadev do not work correctly with complex data.
This is probably a rare use case, but the definition of the allan deviation can be extended straightforwardly to complex data.
(The allan deviation with data_type="freq" at a certain tau value gives you the expected difference between the average of subsequent batches of data (up to a factor of sqrt(2)). Of course, such a thing also works for complex data - the only difference is that you then need an absolute value for calculating this difference.)
I guess that calc_hdev_phase, calc_gradev_phase, and calc_mtotdev_phase can probably be generalized in a similar manner, but I would not dare to suggest anything there because I don't understand what they are doing.