visual3d:documentation:pipeline:signal_commands:gcvspl
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
visual3d:documentation:pipeline:signal_commands:gcvspl [2024/07/16 17:00] – removed sgranger | visual3d:documentation:pipeline:signal_commands:gcvspl [2024/10/24 15:15] (current) – wikisysop | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== GCVSPL ====== | ||
+ | |||
+ | GCVSPL was implemented based on the following article: | ||
+ | |||
+ | **H.J. Woltring** (1986), A FORTRAN package for generalized, | ||
+ | |||
+ | The command is used like all other filter commands in Visual3D. | ||
+ | |||
+ | For example, to filter all TARGET signals in the ACTIVE FILES. | ||
+ | |||
+ | < | ||
+ | GCVSPL | ||
+ | / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! /MAX_GAP=0 | ||
+ | ! / | ||
+ | ; | ||
+ | </ | ||
+ | |||
+ | {{: | ||
+ | |||
+ | ==== Num_Spline_Order ==== | ||
+ | < | ||
+ | 1 = linear | ||
+ | 2 = cubic | ||
+ | 3 = quintic | ||
+ | 4 = heptic splines. | ||
+ | </ | ||
+ | ==== Error_Variance ==== | ||
+ | < | ||
+ | 0 = an interpolating spline is calculated. | ||
+ | <0 & Optimization Mode= 2 the smoothing parameter is determined by minimizing the Generalized Cross-Validation function | ||
+ | >0 & Optimization Mode= 1 the smoothing parameter is specified by the variance | ||
+ | >0 & Optimization Mode= 3 the smoothing parameter is determined so as to minimize an estimate of the true mean squared error, | ||
+ | which depends on the variance. | ||
+ | Woltring' | ||
+ | </ | ||
+ | |||
+ | The default value of the error variance is 0.01 | ||
+ | |||
+ | This default value was set many years ago and in retrospect was not the ideal choice. In order to maintain backwards compatibility, | ||
+ | The recommended value of the error variance is 0.0001 m^2 | ||
+ | |||
+ | ==== Cutoff Frequency ==== | ||
+ | |||
+ | The relationship between the variance and the cutoff frequency was declared here: | ||
+ | |||
+ | [[http:// | ||
+ | [[http:// | ||
+ | |||
+ | < | ||
+ | First account for a pass butterworth filter (e.g. a fourth order butterworth filter) | ||
+ | Modified_cut_off_freq= cut_off_freq / 0.802 | ||
+ | Variance = sampling_freq/ | ||
+ | </ | ||
+ | === Cutoff Frequency Test === | ||
+ | |||
+ | Create a SIN wave\\ | ||
+ | Filter the SIN wave with a cutoff frequency equal to the SIN wave frequency\\ | ||
+ | The resulting signal should have a magnitude (1/sqrt(2)) times the original magnitude.\\ | ||
+ | And should yield the same result as a LOWPASS filter with a 12 Hz cutoff | ||
+ | |||
+ | An example test script in Visual3D | ||
+ | < | ||
+ | ! create a 12 Hz SIN wave at the ANALOG frequency of the file opened in the Visual3D workspace. | ||
+ | Set_Pipeline_Parameter_From_Expression | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | ; | ||
+ | |||
+ | Set_Pipeline_Parameter_From_Expression | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | ; | ||
+ | |||
+ | Evaluate_Expression | ||
+ | / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | ! / | ||
+ | ; | ||
+ | |||
+ | GCVSPL | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | ! / | ||
+ | / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! /MAX_GAP=0 | ||
+ | ! / | ||
+ | ; | ||
+ | |||
+ | Lowpass_Filter | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | ! / | ||
+ | ! / | ||
+ | / | ||
+ | / | ||
+ | ! / | ||
+ | / | ||
+ | ! / | ||
+ | ; | ||
+ | </ | ||
+ | ==== ISB Information ==== | ||
+ | |||
+ | The ISB website contains the following information on the algorithm | ||
+ | |||
+ | For large datasets (N >> 0) and negligible boundary artefacts, the behaviour of a natural spline approximates that of a periodic spline. For the latter case, the frequency characteristic in the equidistantly sampled, uniformly weighted case is that of a double, phase-symmetric Butterworth filter, with transfer function H(w) = [1 + (w/ | ||
+ | |||
+ | It has been found empirically, | ||
+ | |||
+ | ==== Remarks from the original Woltring code ==== | ||
+ | |||
+ | - GVCSPL calculates a natural spline of order 2*M (degree 2*M-1) which smooths or interpolates a given set of data points, using statistical considerations to determine the amount of smoothing required (Craven & Wahba, 1979). If the error variance is a priori known, it should be supplied to the routine in VAR , for |MD|=3. The degree of smoothing is then determined to minimize an unbiased estimate of the true mean squared error. On the other hand, if the error variance is not known, , one may select |MD|=2, and VAR should be set to a negative number. The routine then determines the degree of smoothing to minimize the generalized cross validation function. This is asymptotically the same as minimizing the true mean squared error (Craven & Wahba, 1979). If the estimates from |MD|=2 or 3 do not appear suitable to the user (as apparent from the smoothness of the M-th derivative or from the effective number of degrees of freedom returned in WK(3) ), the user may select an other value for the noise variance if |MD|=3, or a reasonably large number of degrees of freedom if |MD|=4. If |MD|=1, the procedure is non-iterative, | ||
+ | - The number of arithmetic operations and the amount of storage required are both proportional to n, so very large datasets may be accomodated. The data points do not have to be equidistant in the independant variable X or uniformly weighted in the dependant variable Y. | ||
+ | - If |MD|=3 (a priori known noise variance), any value of N.ge.2*M is acceptable. However, it is advisable for N-2*M be rather large (at least 20) if |MD|=2 (GCV). | ||
+ | - For |MD| > 1, GCVSPL tries to iteratively minimize the selected criterion function. This minimum is unique for |MD| = 4, but not necessarily for |MD| = 2 or 3. Consequently, | ||
+ | - When VAR is a priori known, any value of N.ge.2*M is acceptable. It is advisable, however, for N to be rather large (if M.eq.2, about 20) when VAR is unknown. If the degree of smoothing done by GCVSPL when VAR is unknown is not satisfactory, | ||
+ | - GCVSPL calculates the spline coefficient array C(N); this array can be used to calculate the spline function value and any of its derivatives up to the degree 2*M-1 at any argument T within the knot range, using subroutines SPLDER and SEARCH, and the knot array X(N). Since the spline is constrained at its Mth derivative, only the lower spline derivatives will tend to be reliable estimates of the underlying signal' | ||
+ | - GCVSPL combines elements of subroutine CRVO5 by Utreras (1980), subroutine SMOOTH by Lyche et al. (1983), and subroutine CUBGCV by Hutchinson (1985). The trace of the influence matrix is assessed in a similar way as described by Hutchinson & de Hoog (1985). The major difference is that the present approach utilizes non-symmetrical B-spline design matrices as described by Lyche et al. (1983); therefore, the original algorithm by Erisman & Tinney (1975) has been used, rather than the symmetrical version adopted by Hutchinson & de Hoog. | ||
+ | |||
+ | |||
visual3d/documentation/pipeline/signal_commands/gcvspl.1721149222.txt.gz · Last modified: 2024/07/16 17:00 by sgranger