Hey everybody,
I want to ask few questions about ARDUINO-Duemilanove 328, before I buy it.
does it have DAC inside? ( NOT PWM, normal DAC of 8 or 10 bits to analog )?
how many bits are in use on SPI?
I want to work with sound so I need a quick work, do you think 16MHZ will apply me to work with 20KHZ of sound? ( because each command isn't 1 cycle ).
according to that shannon nyqist theorem that is good for frequencies up to 5kHz... so u would need a low-pass that has a sharp border frequency of about 5kHz...
i dont know if fast fourier transformation can be done in 1600 clock cycles... possibly not...
but u could find out if the volume is higher than usual or such things...
i like to use this memory saving forumula for such things:
uint32_t avg = 0; // initial average value
avg = (avg*1023/1024+1) + sample;
according to that shannon nyqist theorem that is good for frequencies up to 5kHz... so u would need a low-pass that has a sharp border frequency of about 5kHz...
i dont know if fast fourier transformation can be done in 1600 clock cycles... possibly not... Smiley
but u could find out if the volume is higher than usual or such things...
i like to use this memory saving forumula for such things:
Code:
uint32_t avg = 0; // initial average value
avg = (avg*1023/1024+1) + sample;
-arne
yeah, I'm gonna checking just the volume...
I put a value that I want to stabilize on him, so I need to check the volume to get higher or lower...
yup - u can use that capacitor + voltage divider trick from grumpy's url...
and my little formula... i dont know if that kind of average has already a name... i call it quick&dirty average...
oh - u should transform the sample value to a signed integer and then use the absolute value of it, because u just care for the amount of deviation from silence ("0" depends on the voltage divider)...
oh so 16MHZ is good for me just to check the volume and calculate the correct one I chose.
My project is like VGA ( Variable Gain Amplifier ).
I put a value ( in db ) which I want to balance on,
then I sample the sound from the mic.
and check if it's lower or higher than I need.
and output a value to change a resistance to an amplifier for changing the gain ( which I need to increase or decrease ).
can you tell me how can I output value in 8 or 10 bits from SPI ?