comparison data/model/FFTModel.cpp @ 969:a8aed8a85e09

Fix very minor but erroneous non-float-arithmetic
author Chris Cannam
date Wed, 03 Sep 2014 11:06:19 +0100
parents 59e7fe1b1003
children cc27f35aa75c
comparison
equal deleted inserted replaced
968:6b931eeba385 969:a8aed8a85e09
379 percentile = 0.5; 379 percentile = 0.5;
380 if (type == MajorPeaks) return 10; 380 if (type == MajorPeaks) return 10;
381 if (bin == 0) return 3; 381 if (bin == 0) return 3;
382 382
383 int fftSize = m_server->getFFTSize() >> m_yshift; 383 int fftSize = m_server->getFFTSize() >> m_yshift;
384 float binfreq = (sampleRate * bin) / fftSize; 384 float binfreq = (float(sampleRate) * bin) / fftSize;
385 float hifreq = Pitch::getFrequencyForPitch(73, 0, binfreq); 385 float hifreq = Pitch::getFrequencyForPitch(73, 0, binfreq);
386 386
387 int hibin = lrintf((hifreq * fftSize) / sampleRate); 387 int hibin = lrintf((hifreq * fftSize) / sampleRate);
388 int medianWinSize = hibin - bin; 388 int medianWinSize = hibin - bin;
389 if (medianWinSize < 3) medianWinSize = 3; 389 if (medianWinSize < 3) medianWinSize = 3;