mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-20 04:27:48 -05:00
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:
@@ -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()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user