Skip to content

Commit b7b15a1

Browse files
committed
Added support for f32 bin files, and other tweaks.
1 parent 056555c commit b7b15a1

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

source/NSD.UI/MainWindow.axaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@
120120
<ComboBoxItem>131072</ComboBoxItem>
121121
<ComboBoxItem>262144</ComboBoxItem>
122122
<ComboBoxItem>524288</ComboBoxItem>
123+
<ComboBoxItem>1048576</ComboBoxItem>
123124
</ComboBox>
124125
</StackPanel>
125126
<StackPanel x:Name="spLinearStacking" Orientation="Horizontal" Margin="6,0,0,0" IsVisible="{Binding AlgorithmLinStack}">
@@ -139,6 +140,7 @@
139140
<ComboBoxItem>131072</ComboBoxItem>
140141
<ComboBoxItem>262144</ComboBoxItem>
141142
<ComboBoxItem>524288</ComboBoxItem>
143+
<ComboBoxItem>1048576</ComboBoxItem>
142144
</ComboBox>
143145
<Label VerticalAlignment="Stretch" VerticalContentAlignment="Center">Minimum FFT length</Label>
144146
<ComboBox SelectedIndex="2" SelectedItem="{Binding SelectedLinearStackingMinLengthItem, Mode=OneWayToSource}" IsEnabled="{Binding Enabled}" HorizontalAlignment="Stretch">
@@ -155,6 +157,7 @@
155157
<ComboBoxItem>65536</ComboBoxItem>
156158
<ComboBoxItem>131072</ComboBoxItem>
157159
<ComboBoxItem>262144</ComboBoxItem>
160+
<ComboBoxItem>524288</ComboBoxItem>
158161
</ComboBox>
159162
</StackPanel>
160163
</StackPanel>

source/NSD.UI/MainWindow.axaml.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public async void BtnSearch_Click(object sender, RoutedEventArgs e)
4646
viewModel.InputFilePaths.Add(file);
4747
viewModel.InputFileNames.Add(Path.GetFileName(file));
4848
}
49-
files = Directory.EnumerateFiles(viewModel.ProcessWorkingFolder, "*.bin"); // Hidden functionality that supports F32 bin files
49+
files = Directory.EnumerateFiles(viewModel.ProcessWorkingFolder, "*.f32"); // Hidden functionality that supports F32 bin files
5050
foreach (var file in files)
5151
{
5252
viewModel.InputFilePaths.Add(file);
@@ -156,7 +156,7 @@ await Task.Run(() =>
156156
fileParseFinish = DateTimeOffset.UtcNow;
157157
break;
158158
}
159-
case ".bin":
159+
case ".f32":
160160
{
161161
fileParseStart = DateTimeOffset.UtcNow;
162162
await Task.Run(() =>

source/NSD/NSD.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ public static Spectrum Linear(ReadOnlyMemory<double> input, double sampleRate, i
88
{
99
//var window = Windows.HFT90D(outputWidth, out double optimumOverlap, out double NENBW);
1010
var window = Windows.FTNI(outputWidth, out double optimumOverlap, out double NENBW);
11+
//var window = Windows.HFT95(outputWidth, out double optimumOverlap, out double NENBW);
1112
// Switched from HFT90D to FTNI
1213
// FTNI has the useful feature where Math.Ceiling(NENBW) is 1 less than most flaptop windows,
1314
// therefore showing one more usable frequency point at the low frequency end of the spectrum.
@@ -33,7 +34,7 @@ public static Spectrum Linear(ReadOnlyMemory<double> input, double sampleRate, i
3334
ConvertWorkSpectrumToAverageVSDInPlace(workSpectrum, spectrumCount);
3435
var nsd = Spectrum.FromValues(workSpectrum, sampleRate, spectrumCount);
3536
//nsd.TrimDC(); // Don't need to trim DC if trimming start/end
36-
nsd.TrimStartEnd((int)Math.Ceiling(NENBW));
37+
nsd.TrimStart((int)Math.Ceiling(NENBW * 2));
3738
return nsd;
3839
}
3940

0 commit comments

Comments
 (0)