User Reference:SpectralEstimator: Difference between revisions
| Line 58: | Line 58: | ||
==Examples== | ==Examples== | ||
For a typical EEG application, you might use the following | For a typical EEG application, you might use the following configuration: | ||
ModelOrder= 16 | ModelOrder= 16 | ||
FirstBinCenter= 0Hz | FirstBinCenter= 0Hz | ||
Revision as of 12:54, 31 October 2007
Function
The ARFilter computes an autoregressive model of its input data using the Maximum Entropy Method (Burg algorithm). Spectral estimation is done separately for each of the filter's input channels. Its output may be raw AR coefficients, or an estimated power spectrum collected into bins. Thus, it can be used in place of the FFTFilter.
Obtaining a discrete spectrum from an AR model
AR coefficients are actually the coefficients of an all-pole linear filter that is fitted to reproduce the data's spectrum when applied to white noise.
Thus, the estimated power spectrum directly corresponds to that filter's transfer function. To obtain spectral power for finite-sized frequency bins, that power spectrum needs to be integrated over the frequency ranges corresponding to the individual bins.
This is done by numerical integration, evaluating the spectrum at equally spaced evaluation points, summing, and multiplying by bin width to obtain the power corresponding to a certain bin. For amplitude rather than power spectrum output, bin integrals are replaced with their square roots.
Parameters
For all frequency-valued parameters, raw float values are interpreted in terms of the sampling rate; absolute frequencies may be given when followed with Hz, as in the following examples:
- 0.5 will always refer to the Nyquist frequency (half the sampling rate).
- 10.3Hz specifies a value of 10.3 Hz, regardless of the sampling rate.
- 15/2Hz specifies a value of 7.5 Hz.
- The unit must immediately follow the number.
WindowLength
The length of the input data window over which the model/spectrum is computed, given as a time value in seconds (then immediately followed by the unit), or the number of signal blocks as in the following examples:
1.34s 500ms 5
Detrend
Determines whether data are detrended prior to spectral estimation. Possible values are
- 0: no detrending,
- 1: mean removal,
- 2: linear trend removal.
ModelOrder
The order of the autoregressive model. Roughly, this corresponds to the maximum number of peaks in the resulting spectrum.
OutputType
Possible values are
- 0: spectral amplitude,
- 1: spectral power,
- 2: AR coefficients.
If the output is a spectrum, the output signal's elements correspond to uniformly spaced frequency bins. For raw AR coefficients, the first output signal element contains total signal power, followed by the model's denominator coefficients.
FirstBinCenter
A float value representing the center of the first frequency bin.
LastBinCenter
A float value representing the center of the last frequency bin.
BinWidth
A single nonnegative float value representing the width of a single bin.
EvaluationsPerBin
A single nonnegative integer value representing the number of uniformly spaced evaluation points that enter into a single bin's value.
States
None.
Examples
For a typical EEG application, you might use the following configuration:
ModelOrder= 16 FirstBinCenter= 0Hz LastBinCenter= 30Hz BinWidth= 3Hz EvaluationsPerBin= 15
This will result in 11 bins, with the first bin covering the DC range from -1.5 to 1.5 Hz, which, due to symmetry of the transfer function, is twice the integral from 0 to 1.5 Hz. The last bin will cover the range from 28.5 Hz to 31.5 Hz. Evaluation points will be 0.2 Hz apart.