|
DP3
|
Classes | |
| struct | FitSample |
| struct | SlopeFitRange |
Functions | |
| double | FitSlope (const std::vector< FitSample > &data) |
| double | FitSlope (const std::vector< FitSample > &data, const SlopeFitRange &range) |
| SlopeFitRange | GetRange (const std::vector< FitSample > &data, aocommon::OptionalNumber< int > wrap_count_limit={}) |
| double | SlopeModelCost (const std::vector< FitSample > &data, double slope) |
| double | UnwrapAndFit (const std::vector< FitSample > &data, double unwrapping_slope) |
|
inline |
Fits phase data to a line, accounting for phase wraps. It optimizes slope s to approximately minimize the least squares value between the data and the model function: y = ( s x ) modulo 2pi by minimizing the cost function: w_i (y_i - s * x_i)^2 This function requires the data to be sorted by x-value. The data should have finite values (even for zero-weighted data).
While searching for the right unwrapping, the function minimizes the sum of absolute values instead of least squares. This is slightly more stable. It does a brute force search of all possible wraps. Once the right unwrapping is found, the values are unwrapped and a least-squares fit of a line to the data is performed.
Because the grid of x-value does not need to be regular, this function is suitable for finding:
|
inline |
Same as the other FitSlope() overload, but with a parameter to provide the range. If performing the same fit multiple times, the range can be calculated once for all fits.
|
inline |
Computes the range of slopes that needs to be searched through. This only uses the x values of the data parameter, and the result can thus be reused for multiple fits if the x values stay the same. This function requires the data to be sorted by x-value.
| wrap_count_limit | if set, limits the number of wraps that are searched through. The number of wraps is counted from the origin up to the largest x value. If unset, the number of wraps to be searched through is calculated from the data, such that any wrapping that can be resolved, is resolved. This number can be very high for dense x-values far from zero (e.g. when fitting a slope between 150-151 MHz with 1 kHz resolution), hence for these cases it might be useful to limit the number of wraps searched through. |
|
inline |
|
inline |