Skip to content

Commit

Permalink
Fix cluster tests
Browse files Browse the repository at this point in the history
Issue #291
  • Loading branch information
towsey authored and atruskie committed Aug 17, 2020
1 parent a577f49 commit 0a83479
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ public void TestCalculateEventStatistics()
LoggedConsole.WriteLine($"Stats: DominantFrequency= {stats.DominantFrequency}");

Assert.AreEqual(0.0, stats.TemporalEnergyDistribution, 1E-4);
Assert.AreEqual(0.6062, stats.SpectralEnergyDistribution, 1E-4);
Assert.AreEqual(6687, stats.SpectralCentroid);
Assert.AreEqual(8003, stats.DominantFrequency);
Assert.AreEqual(0.61647, stats.SpectralEnergyDistribution, 1E-4);
Assert.AreEqual(6011, stats.SpectralCentroid);
Assert.AreEqual(3998, stats.DominantFrequency);

Assert.AreEqual(1500, stats.LowFrequencyHertz);
Assert.AreEqual(8500, stats.HighFrequencyHertz);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ public void TestBinaryClusteringOfSpectra()
var clusterSpectrum = SpectralClustering.RestoreFullLengthSpectrum(clusterInfo.ClusterSpectrum, freqBinCount, lowerBinBound);

// test the cluster count - also called spectral diversity in some papers
Assert.AreEqual(clusterInfo.ClusterCount, 17);
Assert.AreEqual(clusterInfo.ClusterCount, 19);

// test the trigram count - another way of thinking about spectral change
Assert.AreEqual(clusterInfo.TriGramUniqueCount, 342);
Assert.AreEqual(clusterInfo.TriGramUniqueCount, 436);

// test what used to be the CLS spectral index. Sum of the rows of the weight vectors.
var expectedSpectrumFile = PathHelper.ResolveAsset("BinaryClustering", "clusterSpectrum.bin");
Expand Down
2 changes: 1 addition & 1 deletion tests/Fixtures/BinaryClustering/clusterSpectrum.bin
Git LFS file not shown

0 comments on commit 0a83479

Please sign in to comment.