Documentation
¶
Overview ¶
Package data contains structs and methods common for listening test datasets.
Index ¶
- type CorrelationRow
- type CorrelationScore
- type CorrelationTable
- type Distortion
- type JNDAccuracyScore
- type JNDAccuracyScores
- type MSEScore
- type MSEScores
- type Measurement
- type Reference
- type ReferenceBundle
- func (r *ReferenceBundle) Add(ref *Reference)
- func (r *ReferenceBundle) Calculate(measurements map[ScoreType]Measurement, pool *worker.Pool[any], force bool) error
- func (r *ReferenceBundle) Correlate() (CorrelationTable, error)
- func (r *ReferenceBundle) Correlation(typeA, typeB ScoreType) (float64, error)
- func (r *ReferenceBundle) IsJND() bool
- func (r *ReferenceBundle) JNDAccuracy() (JNDAccuracyScores, error)
- func (r *ReferenceBundle) JNDAccuracyAndThreshold(scoreType ScoreType) (float64, float64, error)
- func (r *ReferenceBundle) SortedTypes() ScoreTypes
- type ReferenceBundles
- type Row
- type ScoreType
- type ScoreTypes
- type Studies
- type Study
- type Table
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CorrelationRow ¶ added in v0.2.0
type CorrelationRow []CorrelationScore
CorrelationRow is correlations between a single score type and all score types.
func (CorrelationRow) Len ¶ added in v0.2.0
func (c CorrelationRow) Len() int
func (CorrelationRow) Less ¶ added in v0.2.0
func (c CorrelationRow) Less(i, j int) bool
func (CorrelationRow) Swap ¶ added in v0.2.0
func (c CorrelationRow) Swap(i, j int)
type CorrelationScore ¶
CorrelationScore contains the scorrelation score between two score types.
type CorrelationTable ¶
type CorrelationTable []CorrelationRow
CorrelationTable contains the pairwise correlations between a set of score types.
func (CorrelationTable) String ¶
func (c CorrelationTable) String() string
type Distortion ¶
Distortion contains data for a distortion of a reference.
type JNDAccuracyScore ¶ added in v0.2.0
JNDAccuracyScore contains the accuracy for a metric when used to predict audible differences, and the threshold when that accuracy was achieved.
type JNDAccuracyScores ¶ added in v0.2.0
type JNDAccuracyScores []JNDAccuracyScore
JNDAccuracyScores contains the accuracy scores for multiple score types.
func (JNDAccuracyScores) Len ¶ added in v0.2.0
func (a JNDAccuracyScores) Len() int
func (JNDAccuracyScores) Less ¶ added in v0.2.0
func (a JNDAccuracyScores) Less(i, j int) bool
func (JNDAccuracyScores) String ¶ added in v0.2.0
func (a JNDAccuracyScores) String() string
func (JNDAccuracyScores) Swap ¶ added in v0.2.0
func (a JNDAccuracyScores) Swap(i, j int)
type MSEScore ¶ added in v0.2.0
type MSEScore struct { Decimals int ScoreType ScoreType MSE float64 MinScore float64 MaxScore float64 MeanScore float64 }
MSEScore is MSE for a score type across a set of studies.
type MSEScores ¶ added in v0.2.0
type MSEScores []MSEScore
MSEScores contains the MSE for multiple score types.
type Measurement ¶
Measurement returns distance between sounds.
type Reference ¶
type Reference struct { Name string Path string Distortions []*Distortion }
Reference contains data for a reference.
type ReferenceBundle ¶ added in v0.2.0
ReferenceBundle is a plain data type containing a bunch of references, typicall the content of a study.
func (*ReferenceBundle) Add ¶ added in v0.2.0
func (r *ReferenceBundle) Add(ref *Reference)
Add adds a reference to a bundle.
func (*ReferenceBundle) Calculate ¶ added in v0.2.0
func (r *ReferenceBundle) Calculate(measurements map[ScoreType]Measurement, pool *worker.Pool[any], force bool) error
Calculate computes measurements and populates the scores of the distortions.
func (*ReferenceBundle) Correlate ¶ added in v0.2.0
func (r *ReferenceBundle) Correlate() (CorrelationTable, error)
Correlate returns a table of all scores in the bundle Spearman correlated to each other.
func (*ReferenceBundle) Correlation ¶ added in v0.2.0
func (r *ReferenceBundle) Correlation(typeA, typeB ScoreType) (float64, error)
Correlation returns the Spearman correlation between score type A and B.
func (*ReferenceBundle) IsJND ¶ added in v0.2.0
func (r *ReferenceBundle) IsJND() bool
IsJND returns if this bundle is one with just-noticeable-difference evaluations, and only those.
func (*ReferenceBundle) JNDAccuracy ¶ added in v0.2.0
func (r *ReferenceBundle) JNDAccuracy() (JNDAccuracyScores, error)
JNDAccuracy returns the accuracy of each score type when used to predict audible differences.
func (*ReferenceBundle) JNDAccuracyAndThreshold ¶ added in v0.2.0
func (r *ReferenceBundle) JNDAccuracyAndThreshold(scoreType ScoreType) (float64, float64, error)
JNDAccuracyAndThreshold returns the treshold for the score type that provides the highest accuracy at predicting the JND score (whether a human observer was able to detect the distortion), and the accuracy it provided.
func (*ReferenceBundle) SortedTypes ¶ added in v0.2.0
func (r *ReferenceBundle) SortedTypes() ScoreTypes
SortedTypes returns the score types of a bundle, alphabetically ordered.
type ReferenceBundles ¶ added in v0.2.0
type ReferenceBundles []*ReferenceBundle
ReferenceBundles is a slice of ReferenceBundle.
func OpenBundles ¶ added in v0.2.0
func OpenBundles(glob string) (ReferenceBundles, error)
OpenBundles is a shortcut to opening multiple bundles from a glob.
func (ReferenceBundles) Leaderboard ¶ added in v0.2.0
func (r ReferenceBundles) Leaderboard(decimals int) (MSEScores, error)
Leaderboard returns the sorted mean squared errors for each score type that is represented in all bundles.
func (ReferenceBundles) References ¶ added in v0.2.0
func (r ReferenceBundles) References() int
References returns the sum of the number of references in all the bundles.
func (ReferenceBundles) Report ¶ added in v0.2.0
func (r ReferenceBundles) Report() (string, error)
Report returns a Markdown report based on the bundles.
func (ReferenceBundles) Split ¶ added in v0.2.0
func (r ReferenceBundles) Split(rng *rand.Rand, split float64) (ReferenceBundles, ReferenceBundles)
Split will split the bundle randomly in two parts, at the split provided.
type ScoreType ¶
type ScoreType string
ScoreType represents a type of score, such as MOS or Zimtohrli.
type ScoreTypes ¶
type ScoreTypes []ScoreType
ScoreTypes is a slice of ScoreType.
func (ScoreTypes) Len ¶
func (s ScoreTypes) Len() int
func (ScoreTypes) Less ¶
func (s ScoreTypes) Less(i, j int) bool
func (ScoreTypes) Swap ¶
func (s ScoreTypes) Swap(i, j int)
type Studies ¶ added in v0.2.0
type Studies []*Study
Studies is a slice of studies.
func OpenStudies ¶ added in v0.2.0
OpenStudies returns the studies contained in the directories defined by the glob.
func (Studies) ToBundles ¶ added in v0.2.0
func (s Studies) ToBundles() (ReferenceBundles, error)
ToBundles returns reference bundles with the content of the studies.
type Study ¶
type Study struct {
// contains filtered or unexported fields
}
Study contains data from a study.
func OpenStudy ¶
OpenStudy opens a study from a database directory. If the study doesn't exist, it will be created.
func (*Study) ClearScore ¶ added in v0.2.0
ClearScore deletes the named score type from all distortions in the study.
func (*Study) ToBundle ¶ added in v0.2.0
func (s *Study) ToBundle() (*ReferenceBundle, error)
ToBundle returns a reference bundle for this study.