|
|
|
# fit_sequence_v1
|
|
|
|
|
|
|
|
> `fit_sequence_v1`
|
|
|
|
|
|
|
|
Version 1 smart fitter in IIRrational library. Uses SVD method with high order over fitting, then switches to nonlinear fits with heuristics to remove poles and zeros down to a reasonable system order.
|
|
|
|
|
|
|
|
|
|
|
|
## `1` initial
|
|
|
|
|
|
|
|
### `1.1` initial_poles
|
|
|
|
|
|
|
|
> `fit_poles_mod_zeros`
|
|
|
|
|
|
|
|
Performs the SVD for a rough initial guess
|
|
|
|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
### `1.2` initial_zeros
|
|
|
|
|
|
|
|
> `fit_poles_mod_zeros`
|
|
|
|
|
|
|
|
Performs the SVD for a rough initial guess
|
|
|
|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
### `1.3` choose poles
|
|
|
|
|
|
|
|
> `if`
|
|
|
|
|
|
|
|
Chose the Poles SVD fitter as it had the smaller residual of 1.91e+02 vs. 1.93e+04 for the zeros
|
|
|
|
|
|
|
|
|
|
|
|
### `1.4` seq_iter_1
|
|
|
|
|
|
|
|
> `IIRrational.fit_poles, IIRrational.fit_zeros`
|
|
|
|
|
|
|
|
First iterations, enforcing mindelay and stabilized poles residual of 6.33e+03
|
|
|
|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
### `1.5` seq_iter_2
|
|
|
|
|
|
|
|
> `IIRrational.fit_poles, IIRrational.fit_zeros`
|
|
|
|
|
|
|
|
First iterations, enforcing stabilized poles residual of 1.51e+04
|
|
|
|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
### `1.6` seq_iter_3
|
|
|
|
|
|
|
|
> `IIRrational.fit_poles, IIRrational.fit_zeros`
|
|
|
|
|
|
|
|
First iterations, enforcing stabilized poles residual of 1.19e+02
|
|
|
|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
### `1.7` seq_iter_4
|
|
|
|
|
|
|
|
> `IIRrational.fit_poles, IIRrational.fit_zeros`
|
|
|
|
|
|
|
|
First iterations, enforcing stabilized poles residual of 8.89e+01
|
|
|
|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
### `1.8` nyquist_move
|
|
|
|
|
|
|
|
> `IIRrational.nyquist_move`
|
|
|
|
|
|
|
|
Moves to intended nyquist, clipping negative real poles/zeros likely caused by phase defects of low nyquist
|
|
|
|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
### `1.9` Final
|
|
|
|
|
|
|
|
> `SVD_method`
|
|
|
|
|
|
|
|
Uses SVD to create initial guess of fit for data, followed by several iterative fits
|
|
|
|
(see reference ???).
|
|
|
|
* It is a linear method, finding global optimum (nonlocal). This makes it get stuck if systematics are bad. To prevent this,
|
|
|
|
it requires gratuitous overfitting to reliably get good fits.
|
|
|
|
* It requires a nyquist frequency that is very low, near the last data point. This can cause artifacts due to phasing discontinuity near the nyquist.
|
|
|
|
* The provided nyquist frequency is shifted up at the end, removing the real poles/zeros that are typically due to phasing discontinuity
|
|
|
|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
## `2` optimize nonlinear
|
|
|
|
|
|
|
|
> `MultiReprFilter.optimize`
|
|
|
|
|
|
|
|
Optimizes using nonlinear parameterizations,
|
|
|
|
TODO: describe as used
|
|
|
|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
## `3` order_reduce 1
|
|
|
|
|
|
|
|
### `3.1` duals_ID_1
|
|
|
|
|
|
|
|
> `MultiReprFilter.optimize`
|
|
|
|
|
|
|
|
ID Pairs for order reduction
|
|
|
|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
### `3.2` seq_order_reduce_opt_1
|
|
|
|
|
|
|
|
> `MultiReprFilter.optimize`
|
|
|
|
|
|
|
|
Optimize again after order reduction
|
|
|
|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
### `3.3` duals_ID_2
|
|
|
|
|
|
|
|
> `MultiReprFilter.optimize`
|
|
|
|
|
|
|
|
ID Pairs for order reduction
|
|
|
|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
### `3.4` seq_order_reduce_opt_2
|
|
|
|
|
|
|
|
> `MultiReprFilter.optimize`
|
|
|
|
|
|
|
|
Optimize again after order reduction
|
|
|
|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
### `3.5` duals_ID_3
|
|
|
|
|
|
|
|
> `MultiReprFilter.optimize`
|
|
|
|
|
|
|
|
ID Pairs for order reduction
|
|
|
|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
## `4` flip mindelay
|
|
|
|
|
|
|
|
## `5` order_reduce 2
|
|
|
|
|
|
|
|
### `5.1` duals_ID_1
|
|
|
|
|
|
|
|
> `MultiReprFilter.optimize`
|
|
|
|
|
|
|
|
ID Pairs for order reduction
|
|
|
|
|
|
|
|
|
|
|
|

|
|
|
|
|