Go Down

### Topic: Using FFT for audio synthesizer (Read 908 times)previous topic - next topic

#### ABEIQ

##### Dec 14, 2012, 06:15 am

Hi Guys,

Currently im working with the example code provided by the FFT library, and for the life of me, i cannot work out how to change the frequency range the the FFT calculation. im sorry if this is very confusing as to what im asking, i have a vague understanding of how it works. Pretty much, im using the fft library to divide the frequencies into 64 bins, then im using the values from these bins (only 3 bins for the moment) to fade in a rgb led string. the original author has said "Analog signal is captured at 9.6 KHz, 64 spectrum bands each 150Hz which can be change from adcInit()" - i have gone there and cant work out what to change, could anyone please help me out, cheers, Abraham smiley. I have atatched the original example code, note, this contains all the files required, even the fft lib which you will have to add, as well as the processing code, which displays the data as a graph, and the complete original arduino code.

#### pYro_65

#1
##### Dec 14, 2012, 11:49 amLast Edit: Dec 14, 2012, 11:52 am by pYro_65 Reason: 1
I'm pretty sure its the Nyquist theorem that dictates the usable sinusoids within a signal, its basically n/2 where n is the sampling rate.

CD's are for example sampled at 44.1 kHz, this gives a usable range of the full audible spectrum of just over 20 kHz.

The granularity of the bins returned by the transform is dependant on the window size ( more samples, more bins ). There are trade off's to consider regarding speed, size, and resolution as most fast FFT's use 2^n values meaning an almost exponential increase in processing time too, but smaller sets may not give the frequency distribution you are after.

Standard deviation will help find the fundamental harmonic in a frequency domain distribution. You can also repeat windows to create dithered bins. I don't recommend this however, window repetition of data to create a single large window for FFT will not add any more information into the transform.
https://forum.arduino.cc/index.php?action=dlattach;topic=327736.0;attach=128670 New EEPROM library released

#### AWOL

#2
##### Dec 14, 2012, 02:06 pm
This same question was also posted in the Audio section, and has now been deleted.

DO NOT CROSS-POST - it wastes time.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Go Up

Please enter a valid email to subscribe