Hi,
I´ve just tinkering today with this...
http://arduino.cc/forum/index.php/topic,68855.msg510474.html#msg510474 (Reply 23). I´m sorry, it´s in spanish, but the code is C and a graph easy to understand....

It´s a 50 Hz signal (from a trafo connected to a 230V power supply plug).
It´s the first test to be sure that eveything was working as expected. I´m just working on it.
I also need a fastest serial routines to try to plot in real time...
This example achieve 35.6 kHz!! t_sample=28 us!!
#define mysize 600
unsigned long tStart;
unsigned long tEnd;
byte mydata[mysize];
void setup()
{
Serial.begin(115200);
//Prescaler
//ADPS2 - ADPS1 - ADPS0 - Division Factor
//0 - 0 - 0 ->2
//0 - 0 - 1 ->2
//0 - 1 - 0 ->4
//0 - 1 - 1 ->8
//1 - 0 - 0 ->16
//1 - 0 - 1 ->32
//1 - 1 - 0 ->64
//1 - 1 - 1 ->128
//Configure to Prescaler=32
bitWrite(ADCSRA,ADPS2,1);
bitWrite(ADCSRA,ADPS1,0);
bitWrite(ADCSRA,ADPS0,1);
//Input A5
ADMUX=(1<<ADLAR)|(0<<REFS1)|(1<<REFS0)|(0<<MUX3)|(1<<MUX2)|(0<<MUX1)|(1<<MUX0);
}
void loop()
{
tStart=micros();
for (int i=0; i<mysize;i++)
{
mydata[i]=analogReadFast();
}
tEnd=micros();
Serial.println("NEW ACQUISITION");
Serial.print("tStart=");
Serial.println(tStart);
Serial.print("tEnd=");
Serial.println(tEnd);
Serial.print("nPoints=");
Serial.println(mysize);
for (int i=0; i<mysize;i++)
{
Serial.println(mydata[i],DEC);
}
}
int analogReadFast()
{
ADCSRA|=(1<<ADSC);
// ADSC is cleared when the conversion finishes
while (bit_is_set(ADCSRA, ADSC));
return ADCH;
}
