DFT for as specific frequency

Thread Starter

selfbg

Joined Jun 11, 2010
23
Hello to everyone,

I'm making very simple project to fade LED using PWM. I want to control the LED according to audio signal and I want to use specific frequency (about 100Hz). I don't want to use band-pass filter, but software implementation of DFT. I have these questions?

How many samples do i need and for what period?
Can you refer me to some example of calculation?
 

tshuck

Joined Oct 18, 2012
3,534
Hello to everyone,

I'm making very simple project to fade LED using PWM. I want to control the LED according to audio signal and I want to use specific frequency (about 100Hz). I don't want to use band-pass filter, but software implementation of DFT. I have these questions?

How many samples do i need and for what period?
Can you refer me to some example of calculation?
According to Nyquist's Theorem, you'll need to sample at at least twice the highest expected frequency, though it's best to sample in the 8-10 times that rate.

Here is the Wikipedia article which does a good explanation of the process...
 

Thread Starter

selfbg

Joined Jun 11, 2010
23
Ok... So my audio is 22kHz, but I want to use the 100Hz... so I need to do samples at least 200Hz or 44kHz?
 

tshuck

Joined Oct 18, 2012
3,534
Ok... So my audio is 22kHz, but I want to use the 100Hz... so I need to do samples at least 200Hz or 44kHz?
If you are having a signal whose spectrum is up to 22kHz, you'll need to sample at least at 44kHz. Though if your signal is only up to 100Hz, then 200 Hz is your minimum...
 
Top