Simple FFT #249
-
What would be the simplest way to get a single value for audio amplitude for a defined band (approx. 20-300Hz)? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
If you already use FFT I would suggest to use the max value of magnitude(int idx) for the values where frequency(int idx) is >20 and <300. An alternative could be to use a FilteredStream() with a bandpass filter and output it to VolumePrint() |
Beta Was this translation helpful? Give feedback.
-
I suggest that you have a look at the AudioTools project and that you read the related documentation in the Wiki of the AudioTools. You can find a simple FFT example in the audio kit folder: It is just like writing to any Audio Sink! Here is an a2dp example using the AudioTools. Just replace the write to i2s with a write to the FFT stream. However if you plan to update a screen with this information, the screen update logic might need to be in it's separate task, so that the audio output does not get delayed. Here is an example that uses a separate task |
Beta Was this translation helpful? Give feedback.
-
Ok I will look into that. How would the FilteredStream() and VolumePrint() Method work? |
Beta Was this translation helpful? Give feedback.
I suggest that you have a look at the AudioTools project and that you read the related documentation in the Wiki of the AudioTools.
You can find a simple FFT example in the audio kit folder: It is just like writing to any Audio Sink!
Here is an a2dp example using the AudioTools. Just replace the write to i2s with a write to the FFT stream.
However if you plan to update a screen with this information, the screen update logic might need to be in it's separate task, so that the audio output does not get delayed. Here is an example that uses a separate task