jscalo / tempi-fft

Real-time audio input and FFT written entirely in Swift for iOS.
253 stars 47 forks source link

Strange values when working on octave #4

Closed kvacquier closed 7 years ago

kvacquier commented 7 years ago

Hello. i'm trying to use it with bands per octave but i have a very strange result. any idea of why ?

img_1054

I've change the line to : fft.calculateLogarithmicBands(minFrequency: 20, maxFrequency: 20000, bandsPerOctave: 7)

(all small values are "grouped" and it's precise only when in high range) please don't care of the bottom label

jscalo commented 7 years ago

You're seeing this in the sample app, right? If so it's because the labels in the sample app are drawn assuming a linear distribution. If you use logarithmic instead, you'd have to change how the labels are placed. Can you use fft.calculateLinearBands() instead?

kvacquier commented 7 years ago

When i use fft.calculateLinearBands i only have the two first bands that cause problems (between 20 and 200). I would like to use it to detect bass pulse so that's a bit annoying (bass notes are between 40hz and 400hz)

Edit : Founded why : iPad microphone sucks in bass frequencies : screen shot 2017-04-18 at 15 22 49

jscalo commented 7 years ago

Ha yeah that would explain it 😀 There are some decent inexpensive mics you can get that might help.