Skip to content

Commit

Permalink
Merge pull request #491 from bw1129/SpectralTool
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeller authored Jan 5, 2021
2 parents dfbbcc5 + 7b44038 commit 973f354
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions js/graph_spectrum_calc.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,14 @@ GraphSpectrumCalc.dataLoadFrequencyVsThrottle = function() {

var fftInput = flightSamples.samples.slice(fftChunkIndex, fftChunkIndex + fftChunkLength);
var fftOutput = new Float64Array(fftChunkLength * 2);

fft.simple(fftOutput, fftInput, 'real');


// Hanning window applied to input data
if(userSettings.analyserHanning) {
this._hanningWindow(fftOutput, fftChunkLength * 2);
this._hanningWindow(fftInput, fftChunkLength);
}

fft.simple(fftOutput, fftInput, 'real');

fftOutput = fftOutput.slice(0, fftChunkLength);

// Use only abs values
Expand Down
2 changes: 1 addition & 1 deletion js/user_settings_dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function UserSettingsDialog(dialog, onLoad, onSave) {
graphExpoOverride : true, // Ability to toggle Expo off=normal/ on=force 100%
graphGridOverride : true, // Ability to toggle Grid off=normal/ on=force disabled
analyserSampleRate : 2000/*Hz*/, // the loop time for the log
analyserHanning : false, // use a hanning window on the analyser sample data
analyserHanning : true, // use a hanning window on the analyser sample data
eraseBackground : true, // Set to false if you want the graph to draw on top of an existing canvas image
spectrumType : 0, // By default, frequency Spectrum
overdrawSpectrumType: 0, // By default, show all filters
Expand Down

0 comments on commit 973f354

Please sign in to comment.