LTPDA Toolbox™ | contents | ![]() ![]() |
zDomainFit performs a fitting loop to identify model order and parameters. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DESCRIPTION: zDomainFit fit a partial fraction model to frequency response data using the function utils.math.vdfit. The function performs a fitting loop to automatically identify model order and parameters in z-domain. Output is a z-domain model expanded in partial fractions: z*r1 z*rN f(s) = ------- + ... + ------- z - p1 z - pN The identification loop stop when the stop condition is reached. Output poles and residues are those with minimum Mean Square Error. The stop criterion is based on three different approaches, that can be chosen by setting the value of the CONDTYPE parameter: 1) Mean Squared Error and variation (CONDTYPE = 'MSE') Check if the normalized mean squared error is lower than the value specified in the parameter FITTOL and if the relative variation of the mean squared error is lower than the value specified in the parameter MSEVARTOL. E.g. FITTOL = 1e-3, MSEVARTOL = 1e-2 will search for a fit with normalized magnitude error lower than 1e-3 and MSE relative variation lower than 1e-2. 2) Residuals Log difference and mean squared error variation (CONDTYPE = 'RLD') Log Residuals difference Check if the minimum of the logarithmic difference between data and residuals is larger than a specified value. E.g. if the tolerance value is set to 2 (FITTOL = 2), the function ensures that the difference between data and residuals is at lest 2 orders of magnitude lower than data itselves. Mean Squared Error Variation Check if the relative variation of the mean squared error is lower than MSEVARTOL. 3) Residuals spectral flatness and mean squared error variation (CONDTYPE = 'RSF') Residuals Spectral Flatness In case of a fit on noisy data, the residuals from a good fit are expected to be as much as possible similar to a white noise. This property can be used to test the accuracy of a fit procedure. In particular it can be tested that the spectral flatness coefficient of the residuals is larger than a certain quantity sf such that 0<sf<1. E.g. if the tolerance value is set to 0.2 (FITTOL = 0.2), the function ensures that the spectral flatness coefficient of the residuals is larger than 0.2. Root Mean Squared Error Check if the relative variation of the mean squared error is lower than MSEVARTOL. Both in the first, second and third approaches the fitting loop ends when the two stopping conditions are satisfied. The function can also perform a single loop without taking care of the stop conditions. This happens when the 'AUTOSEARCH' parameter is set to 'off'. If you provide more than one AO as input, they will be fitted together with a common set of poles. CALL: mod = zDomainFit(a, pl) INPUTS: a - input AOs to fit to. If you provide more than one AO as input, they will be fitted together with a common set of poles. Only frequency domain (fsdata) data can be fitted. Each non-fsdata object will be ignored. Input objects must have the same number of elements. pl - parameter list (see below) OUTPUTS: mod - matrix object containing filterbanks of parallel miir filters for each input AO. Useful fit information are stored in the objects procinfo: FIT_RESP - model frequency response. FIT_RESIDUALS - analysis object containing the fit residuals. FIT_MSE - analysis object containing the mean squared error progression during the fitting loop. Parameters Description Note: all the input objects are assumed to caontain the same X (frequencies) values EXAMPLES: 1) Fit to a frequency-series using the 'MSE' conditioning criterion for fit accuracy % Create a frequency-series AO pl_data = plist('fsfcn', '0.01./(0.0001+f)', 'f1', 1e-5, 'f2', 5, 'nf', 1000); a = ao(pl_data); % Fitting parameter list pl_fit = plist('FS',[],... 'AutoSearch','on',... 'StartPoles',[],... 'StartPolesOpt','clog',... 'maxiter',5,... 'minorder',2,... 'maxorder',20,... 'weights',[],... 'weightparam','abs',... 'CONDTYPE','MSE',... 'FITTOL',1e-3,... % check if MSE is lower than 1e-3 'MSEVARTOL',1e-2,... 'Plot','off',... 'ForceStability','off',... 'CheckProgress','off'); % Do fit b = zDomainFit(a, pl_fit); 2) Fit to a frequency-series using the 'RLD' conditioning criterion for fit accuracy % Create a frequency-series AO pl_data = plist('fsfcn', '0.01./(0.0001+f)', 'f1', 1e-5, 'f2', 5, 'nf', 1000); a = ao(pl_data); % Fitting parameter list pl_fit = plist('FS',[],... 'AutoSearch','on',... 'StartPoles',[],... 'StartPolesOpt','clog',... 'maxiter',5,... 'minorder',2,... 'maxorder',20,... 'weights',[],... 'weightparam','abs',... 'CONDTYPE','RLD',... 'FITTOL',2,... % check if log10(abs(data))-log10(abs(fit_residuals)) > 2 'MSEVARTOL',1e-2,... 'Plot','off',... 'ForceStability','off',... 'CheckProgress','off'); % Do fit b = zDomainFit(a, pl_fit); 3) Fit to a frequency-series using the 'RSF' conditioning criterion for fit accuracy % Create a frequency-series AO pl_data = plist('fsfcn', '0.01./(0.0001+f)', 'f1', 1e-5, 'f2', 5, 'nf', 1000); a = ao(pl_data); % Fitting parameter list pl_fit = plist('FS',[],... 'AutoSearch','on',... 'StartPoles',[],... 'StartPolesOpt','clog',... 'maxiter',5,... 'minorder',2,... 'maxorder',20,... 'weights',[],... 'weightparam','abs',... 'CONDTYPE','RSF',... 'FITTOL',0.7,... % check if residuals spectral flatness is larger than 0.7 'MSEVARTOL',1e-2,... 'Plot','off',... 'ForceStability','off',... 'CheckProgress','off'); % Do fit b = zDomainFit(a, pl_fit); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Method Details | |
---|---|
Access | public |
Defining Class | ao |
Sealed | 0 |
Static | 0 |
Sets for this method … |
---|
Default |
Default |
|||
---|---|---|---|
no description | |||
Key | Default Value | Options | Description |
AUTOSEARCH | 'on' |
|
'on': Parform a full automatic search for the transfer function order. The fitting procedure will stop when stop conditions defined are satisfied. 'off': Perform a fitting loop as long as the number of iteration reach 'maxiter'. The order of the fitting function will be that specified in 'MINORDER'. |
STARTPOLES | [] | none | A vector of starting poles. Providing a fixed set of starting poles fixes the function order. If it is left empty starting poles are internally assigned. |
STARTPOLESOPT | 'clog' |
|
Define the characteristics of internally assigned starting poles. Admitted values are:
|
MAXITER | 50 | none | Maximum number of iterations in fit routine. |
MINORDER | 2 | none | Minimum order to fit with. |
MAXORDER | 20 | none | Maximum order to fit with. |
WEIGHTS | [] | none | A vector with the desired weights. If a single Ao is input weights must be a Nx1 vector where N is the number of elements in the input Ao. If M Aos are passed as input, then weights must be a NxM matrix. If it is leaved empty weights are internally assigned basing on the input parameters |
WEIGHTPARAM | 'abs' |
|
Specify the characteristics of the internally assigned weights. Admitted values are:
|
CONDTYPE | 'MSE' |
|
Fit conditioning type. Admitted values are:
|
FITTOL | 0.001 | none | Fit tolerance. |
MSEVARTOL | 0.01 | none | Mean Squared Error Variation - Check if the relative variation of the mean squared error is smaller than the value specified. This option is useful for finding the minimum of the Chi-squared. |
PLOT | 'off' |
|
Plot results of each fitting step. |
FORCESTABILITY | 'off' |
|
Force poles to be stable |
CHECKPROGRESS | 'off' |
|
Display the status of the fit iteration. |
Some information of the method ao/zDomainFit are listed below: | |
---|---|
Class name | ao |
Method name | zDomainFit |
Category | Signal Processing |
Package name | ltpda |
VCS Version | 8ab8cbbc4bccf7543491a24448f4aae0b1be1c43 |
Min input args | 1 |
Max input args | -1 |
Min output args | 1 |
Max output args | -1 |
![]() |
Method: ao/xfit | Method: ao/zeropad | ![]() |
©LTP Team