Pages: [1]   Go Down
Author Topic: Using FFT for audio synthesizer  (Read 516 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


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.

* visualizer.zip (127.42 KB - downloaded 6 times.)
Logged

North Queensland, Australia
Offline Offline
Edison Member
*
Karma: 64
Posts: 2100
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: December 14, 2012, 05:52:43 am by pYro_65 » Logged


Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 285
Posts: 25630
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This same question was also posted in the Audio section, and has now been deleted.

DO NOT CROSS-POST - it wastes time.
Logged

"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.

Pages: [1]   Go Up
Jump to: