conformance

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2026 License: MIT Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL