Skip to content

Commit 7c84603

Browse files
committed
additional SFF test #20
1 parent 8249be0 commit 7c84603

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

src/Spectrogram.Tests/FileFormat.cs

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ public void Test_SFF_Linear2()
6262

6363
// save the SFF
6464
int fftSize = 1 << 12;
65-
var spec = new Spectrogram(sampleRate, fftSize, stepSize: 700, maxFreq: 2000);
66-
spec.SetWindow(FftSharp.Window.Hanning(fftSize / 3)); // sharper window than typical
65+
var spec = new Spectrogram(sampleRate, fftSize, stepSize: 300, maxFreq: 2000);
6766
spec.Add(audio);
6867
spec.SaveData("testDoor.sff");
6968

@@ -77,5 +76,19 @@ public void Test_SFF_Linear2()
7776
Assert.AreEqual(spec.Height, spec2.Height);
7877
Assert.AreEqual(spec.OffsetHz, spec2.OffsetHz);
7978
}
79+
80+
[Test]
81+
public void Test_SFF_LinearBigMaxFreq()
82+
{
83+
// test creating SFF file from 16-bit 48kHz mono WAV file
84+
85+
(int sampleRate, double[] audio) = WavFile.ReadMono("../../../../../data/03-02-03-01-02-01-19.wav");
86+
Assert.AreEqual(48000, sampleRate);
87+
88+
int fftSize = 1 << 12;
89+
var spec = new Spectrogram(sampleRate, fftSize, stepSize: 300, maxFreq: 7999);
90+
spec.Add(audio);
91+
spec.SaveData("testDoorBig.sff");
92+
}
8093
}
8194
}

0 commit comments

Comments
 (0)