Mercurial > hg > svcore
comparison data/model/FFTModel.cpp @ 980:6e6da0636e5e tonioni
Merge from default branch
| author | Chris Cannam |
|---|---|
| date | Tue, 09 Sep 2014 16:36:21 +0100 |
| parents | a8aed8a85e09 |
| children | cc27f35aa75c |
comparison
equal
deleted
inserted
replaced
| 954:35b05cac32d0 | 980:6e6da0636e5e |
|---|---|
| 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; |
