Documentation
¶
Overview ¶
Package conformance checks tukey's public API against the reference vectors in testdata/<source>.
Each Suite pairs one function with one source's vectors and a measured tolerance. A function checked against SciPy and MATLAB has a suite for each, sharing the code that runs it. The package's tests assert on every suite, and cmd/tolerances reports the error each one actually achieves.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Suites = slices.Concat( []Suite{ butterSciPySuite, butterSOSSciPySuite, filterSciPySuite, filterLowCutoffSciPySuite, filterStateSciPySuite, filterStateLowCutoffSciPySuite, filterZiSciPySuite, filtfiltSciPySuite, filtfiltLowCutoffSciPySuite, freqzSciPySuite, freqzLowCutoffSciPySuite, sosFilterSciPySuite, sosFilterZiSciPySuite, sosFiltFiltSciPySuite, sosFiltFiltBySectionSciPySuite, filtfiltMATLABPadLenSciPySuite, sosFreqzSciPySuite, zpk2sosSciPySuite, forwardSciPySuite, inverseSciPySuite, forwardRealSciPySuite, inverseRealSciPySuite, fftOptionsSciPySuite, fftFreqSciPySuite, fftShiftSciPySuite, detrendSciPySuite, interp1SciPySuite, fillMissingSciPySuite, rmsSciPySuite, findPeaksSciPySuite, peakProminencesSciPySuite, peakWidthsSciPySuite, hilbertSciPySuite, envelopeSciPySuite, findSignalDirectSciPySuite, findSignalFastSciPySuite, findSignalHybridSciPySuite, stftSciPySuite, stftFrequenciesSciPySuite, spectrogramSciPySuite, welchSciPySuite, periodogramSciPySuite, sumSciPySuite, meanSciPySuite, diffSciPySuite, gradSciPySuite, cumSumSciPySuite, trapzSciPySuite, cumTrapzSciPySuite, percentileSciPySuite, convolveDirectSciPySuite, convolveFFTSciPySuite, correlateDirectSciPySuite, correlateFFTSciPySuite, cheby1SciPySuite, cheby1SOSSciPySuite, cheby2SciPySuite, cheby2SOSSciPySuite, ellipSciPySuite, ellipSOSSciPySuite, besselSciPySuite, besselSOSSciPySuite, iirNotchSciPySuite, iirPeakSciPySuite, firWinSciPySuite, groupDelaySciPySuite, sosGroupDelaySciPySuite, butterOrdSciPySuite, cheby1OrdSciPySuite, cheby2OrdSciPySuite, ellipOrdSciPySuite, medFiltSciPySuite, savGolSciPySuite, chirpSciPySuite, sweepPolySciPySuite, squareSciPySuite, sawtoothSciPySuite, gaussPulseSciPySuite, gaussPulseCutoffSciPySuite, toneSciPySuite, sincSciPySuite, diricSciPySuite, unitImpulseSciPySuite, rectPulsSciPySuite, triPulsSciPySuite, gMonoPulsSciPySuite, }, windowSuites(reference.SourceSciPy), []Suite{ butterMATLABSuite, filterMATLABSuite, filterLowCutoffMATLABSuite, filterStateMATLABSuite, filterStateLowCutoffMATLABSuite, filtfiltMATLABSuite, filtfiltLowCutoffMATLABSuite, filtfiltMATLABPadLenMATLABSuite, freqzMATLABSuite, freqzLowCutoffMATLABSuite, sosFilterMATLABSuite, sosFiltFiltBySectionMATLABSuite, sosFreqzMATLABSuite, forwardMATLABSuite, inverseMATLABSuite, forwardRealMATLABSuite, inverseRealMATLABSuite, fftOptionsMATLABSuite, fftShiftMATLABSuite, detrendMATLABSuite, interp1MATLABSuite, fillMissingMATLABSuite, rmsMATLABSuite, findPeaksMATLABSuite, peakProminencesMATLABSuite, peakWidthsMATLABSuite, hilbertMATLABSuite, envelopeMATLABSuite, findSignalDirectMATLABSuite, findSignalFastMATLABSuite, findSignalHybridMATLABSuite, stftMATLABSuite, stftFrequenciesMATLABSuite, spectrogramMATLABSuite, welchMATLABSuite, periodogramMATLABSuite, sumMATLABSuite, meanMATLABSuite, diffMATLABSuite, gradMATLABSuite, cumSumMATLABSuite, trapzMATLABSuite, cumTrapzMATLABSuite, percentileMATLABSuite, convolveDirectMATLABSuite, convolveFFTMATLABSuite, correlateDirectMATLABSuite, correlateFFTMATLABSuite, cheby1MATLABSuite, cheby2MATLABSuite, ellipMATLABSuite, besselMATLABSuite, firWinMATLABSuite, iirNotchMATLABSuite, iirPeakMATLABSuite, groupDelayMATLABSuite, groupDelayIllConditionedMATLABSuite, sosGroupDelayMATLABSuite, butterOrdMATLABSuite, butterOrdBandstopMATLABSuite, cheby1OrdMATLABSuite, cheby2OrdMATLABSuite, ellipOrdMATLABSuite, medFiltMATLABSuite, savGolMATLABSuite, savGolLongMATLABSuite, chirpMATLABSuite, chirpLongMATLABSuite, squareMATLABSuite, sawtoothMATLABSuite, gaussPulseMATLABSuite, gaussPulseCutoffMATLABSuite, sincMATLABSuite, diricMATLABSuite, diricRoundedMATLABSuite, rectPulsMATLABSuite, triPulsMATLABSuite, gMonoPulsMATLABSuite, }, windowSuites(reference.SourceMATLAB), )
Suites is every conformance suite, run by this package's tests and by cmd/tolerances, SciPy's first, then MATLAB's. The window suites come from windowChecks.
Functions ¶
This section is empty.
Types ¶
type FileResult ¶
type FileResult struct {
File string
Err error // the dsp function failed on this vector, or an output's length was wrong
Outputs []OutputResult
}
FileResult is how one reference vector file compared.
func (FileResult) Passed ¶
func (r FileResult) Passed() (passed bool)
Passed reports whether the vector ran and every output was within tolerance.
type Output ¶
type Output struct {
Name string // e.g. "b"
Got, Want []float64
// Scale, if set, is the smallest magnitude errors are measured against.
// Filters set it to their input's, which their rounding error scales with,
// even when the output itself cancels to about 0.
Scale float64
// GotComplex and WantComplex hold a complex-valued output, in place of Got and Want.
GotComplex, WantComplex []complex128
}
Output pairs one output of a tukey function with the reference's, for the same input.
type OutputResult ¶
type OutputResult struct {
Output
reference.Comparison
}
OutputResult is one output's comparison against the reference.
func (OutputResult) Failures ¶
func (o OutputResult) Failures() (messages []string)
Failures describes each element outside tolerance, e.g. "b[2]: got 0.1, want 0.2 (diff 1.000e-01, allowed 2.000e-14)".
type Suite ¶
type Suite struct {
Name string // the function under test, e.g. "Butter"
Source reference.Source // the tool the vectors came from
Category string // the vectors' directory, testdata/<Source>/<Category>
Tolerance reference.Tolerance // measured, as each suite's definition records
// contains filtered or unexported fields
}
Suite checks one function against one source's category of reference vectors.
func (Suite) Run ¶
func (s Suite) Run() (results []FileResult, err error)
Run checks the suite's dsp function against every one of its reference vectors. err reports vectors that couldn't be loaded, and per-vector failures are in results.
Source Files
¶
- bessel.go
- butter.go
- bysection.go
- cheby.go
- conditioning.go
- conformance.go
- convolution.go
- ellip.go
- envelope.go
- fft.go
- fftoptions.go
- filter.go
- filterstate.go
- filtfilt.go
- findsignal.go
- fir.go
- freqz.go
- groupdelay.go
- hilbert.go
- lowcutoff.go
- notch.go
- order.go
- peaks.go
- reductions.go
- smoothing.go
- sos.go
- sosfilter.go
- spectral.go
- suites.go
- waveform.go
- window.go