Spectrum/Waterfall display zoom feature - work in progress (issue #33)

Implements zoom in/out by mouse scroll wheel and by right-click context
menu.

Still have to add ability to drag spectrum left/right when zoomed in.
This commit is contained in:
denny
2015-11-11 20:07:37 -05:00
parent c178e99a5d
commit 7455077cfa
12 changed files with 559 additions and 280 deletions

View File

@@ -21,7 +21,7 @@ public class RealDecibelConverter extends DFTResultsConverter
@Override
public void receive( float[] results )
{
float dftScalor = 1.0f / (float)( results.length ^ 2 );
float dftBinSizeScalor = 1.0f / (float)results.length;
float[] processed = new float[ results.length / 4 ];
@@ -33,7 +33,7 @@ public class RealDecibelConverter extends DFTResultsConverter
processed[ x ] = 20.0f * (float)Math.log10(
( ( results[ index ] * results[ index ] ) +
( results[ index + 1 ] * results[ index + 1 ] ) ) * dftScalor );
( results[ index + 1 ] * results[ index + 1 ] ) ) * dftBinSizeScalor );
}
dispatch( processed );