p5.js-sound
p5.js-sound copied to clipboard
Set frequency range for FFT Analyze?
I'm using analyze to create a circular spectrum graphic, but the issue I have is that the "end" of the circle typically stays put, as the frequency range is simply never hit.
Is there a way to "dial in" a frequency range, or put a max frequency for the analysis?
You can see in my image, the peaks are the low frequencies, which get a lot of usage. Even if I play a high frequency tone, to get any peaks at the end, it's such a high frequency, its like a mosquito buzzing around.
@paulcanning
new p5.FFT([smoothing], [bins])
this see the constructor .
provide value of [bins] to get the desired output
@Ajaya1000
I think the bins argument which control the fft length can't help you adjust the frequency range. The frequency range of you fft result is determined by the sample rate of you time domain data(e.g. for mp3 file it's 44.1khz). By changing the fft length you are actually changing the frequency domain resolution(checkout this post).
@paulcanning
I believe what you should do here is add some additional logic into you UI code. You can add logic to identify the frequency band you are interested in plotting by checking the magnitude of spectrum.