logging 400 Hz A/D data

I can take A/D data, format the data with a time stamp, and save it, which works fine for data that is changing every second , or minute. But if I want to take faster data, like 300-400 Hz I assume I cant put a time stamp on it, and the write rate to an SD card will be too slow to keep up with the incoming data.
How do you handle and store A/D data that is 300-400 Hz?
How can I put a time stamp on each sample?
thanks.

On what arduino, on what permanent storage, for how long you Ned to sample ??

(micros or millis could give you a time stamp)

Perhaps an external SPI-FRAM memory would be good. I think they are faster than SD-card storage.

Do you need a real-time timestamp? Wouldn't it be sufficient to store the samples knowing that they are recorded every 400th of a second?

J-M
Uno, SD card shield, sampling duration atm would be 10-20 seconds

JohnW
How can I be sure they are stored every 400th second?
We want an accurate timing because we will do frequency analysis on the data.

thanks

SD library could typically buffer 0.5k byte for a buffered write
Assuming a record is 4 bytes got the timestamp and 2 bytes of data, you could have 85 samples in the buffer, enough for 0.2 seconds at 400Hz...
So that won’t work for your 10-20 secs

You need faster storage JohnWasser suggestion is worth studying (you can also read this thread)

jgolden:
JohnW
How can I be sure they are stored every 400th second?
We want an accurate timing because we will do frequency analysis on the data.

Record a known signal, such as a 60 Hz sine wave. If the samples reproduce a 60 Hz sine wave then you can be sure that every sample was captured and stored.

jgolden:
How can I be sure they are stored every 400th second?
We want an accurate timing because we will do frequency analysis on the data.

You can set the ADC to trigger a sample and start conversion based on one of the hardware Timer/Counters. This allows you to set a precise sample rate. See section 24 of the ATMega328P datasheet.

EDIT:
Doing it this way also means you won't need a time stamp as the sampling rate is fixed.