#2704 Waterfall contrast for weak signals relative to the noise floor (#2712)

The waterfall mapped 256 palette indexes over the absolute dBFS level of the
mean bin value, about 2.5 steps per dB at a -100 dBFS floor, so weak signals
were only a few steps above the noise.  WaterfallScaler now tracks the noise
floor as a smoothed 25th percentile of the bins (robust to occupied spans) and
maps a fixed 45 dB span above it, so contrast no longer depends on sample size,
DFT size or tuner gain.  The classic palette's flat blue blocks are replaced
with a blue ramp over the bottom quarter, where the noise floor now sits.

Co-authored-by: denny <dennis.sheirer@gmail.com>
This commit is contained in:
Denny Sheirer
2026-11-20 02:47:57 -05:00
committed by GitHub
parent 838e7708c0
commit 8324233acb
8 changed files with 799 additions and 78 deletions

View File

@@ -39,15 +39,25 @@ public class SpectralDisplayThemeTest
}
@Test
void classicPaletteMatchesTheOriginalWaterfall()
void classicPaletteUsesTheOriginalWaterfallColors()
{
int[] palette = WaterfallPalette.classic();
assertEquals(0xFF00007F, palette[0]);
assertEquals(0xFF0000BF, palette[16]);
assertEquals(0xFFFFFF00, palette[60]);
assertEquals(0xFF0000BF, palette[63]);
assertEquals(0xFFFFFF00, palette[100]);
assertEquals(0xFFFF0000, palette[255]);
}
@Test
void classicPaletteHasDistinctColorsNearTheNoiseFloor()
{
int[] palette = WaterfallPalette.classic();
for(int index = 1; index < 64; index++)
{
assertTrue((palette[index] & 0xFF) > (palette[index - 1] & 0xFF), "index " + index);
}
}
@Test
void everyThemeHasAnOpaqueWaterfallAndALabel()
{