ekf2ndOrder¶
- ekf2ndOrder(y, t, is_artifact, m, verbose, ss_estim, t_start, f_trunc, f_modified)¶
ekf2ndOrder estimates a multi-peak, state-space model for a spectrogram using a 2nd-order extended Kalman filter, augmented to estimate the discrete transition of the On/Off-peak combination. Two optional forms are available—the modified truncated 2nd-order filter and the modified 2nd-order Gaussian filter—based on Appendix 9B from Jazwinski.
The non-modified forms were not completed due to the tediousness of the computation of the D array. They can be completed by including the computation of D below.
The modified Gaussian filter appears quite stable and performs generally well. But we have found the modified truncated filter to be fairly unstable, resulting in eventual crashes.
- NOTE: This function explicitly overwrites the state transition by
incorporating the 0.9 factor into Phi and using this Phi for both the state and state-error covariance updates.
- INPUTS:
y – observed spectrogram (dim_y x T) t – time points of spectrogram (1 x T) is_artifact – indicator vector of time points of artifacts (1 x T) m – StateSpaceMultiPeak object containing the model verbose – flag indicating level of verbosity. Default 2.
0 - no display of progress. 1 - text display of progress 2 - graphical display of fits as it progresses.
ss_estim – state estimate structure from prior estimate t_start – positive integer time step at which to start filter.
Default is 1.
- [ss_estim and t_start are legacy inputs from attempts to
debug the truncated filter.]
- f_trunc – flag indicating type of filter to use. Default is 0.
0 - truncated. 1 - Gaussian.
- f_modified – flag indicating form of filter used. Default is 1.
0 - non-modified form (NOT fully implemented) 1 - modified form.
- OUTPUTS:
- ss_etim – estimate structure for StateSpaceMultiPeak.
- Contains:
xf_hat - filter state estimates (dim_x x T+1) Pf - filter state error covariances (dim_x x dim_x x T+1) yf_hat - filter observation estimates (dim_y x T+1) comps_hat_f - filter component peak estimates (dim_y x T+1) alpha - filter estimate of On/Off-peak combination (num_combos x T+1) xp_hat - prediction state estimates (dim_x x T+1) Pp - prediction state error covariances (dim_x x dim_x x T+1) yp_hat - prediction observation estimates (dim_y x T+1) comps_hat_p - prediction component peak estimates (dim_y x T+1)
Created by Patrick Stokes and Michael Prerau Created on 2017-04-20 Modified on 2017-04-24