Record and replay of analog waveform

Im investigating the best method to record, store and play back a ~2second analog waveform at a later time. The waveform will not be 0V and 5V, there will be periods where the voltage will vary in between.

I would like to use the Arduino Nano controller. I also purchased a SD card shield as I don't believe the micro's flash would be sufficient.

Im looking for best methods on doing this as there will be a couple thousand datapoints.

Eventually I will also like to play back two different waveforms on separate pins but they will need to be synced.

Any suggestions?

How are you playing back an analogue waveform?

I don't believe the micro's flash would be sufficient.

or indeed accessible.

Right now Im accessing an array and using the analogwrite command. Is there a different way?

You've got a low pass filter on your PWM pin?

Yes, So I have a nice clean waveform ready to boost up to 100V. This is where Im stuck

If my Merge worked correctly, I would Merge these two:
http://forum.arduino.cc/index.php?topic=374517.msg2582815#msg2582815
AWOL, can you help out?

jimihendrix85:
Right now Im accessing an array and using the analogwrite command. Is there a different way?

I used the arduino to produce sine waveforms once, using a bunch of 10k and 20k resistors to make an 8 bit resistor ladder. It gave a resolution of 1/256*5V, but you could use fewer resistors giving lower resolution. I connected it to the 8 pins of the D port on the arduino (digital pins 0 - 7) so that I could address all the pins simultaneously. I stored the values for the sine curve in an array which was created initially. I was able to achieve quite a high frequency with this, if I remember correctly almost 100kHz with lower delay-times (I know delays shouldn't be there :)). Maybe you could use a resistor ladder and store the analog values of the waveform externally?

#include <math.h>
#define steps 100 // horizintal resolution of sine wave

//byte sine[] = {127, 134, 142, 150, 158, 166, 173, 181, 188, 195, 201, 207, 213, 219, 224, 229, 234, 238, 241, 245, 247, 250, 251, 252, 253, 254, 253, 252, 251, 250, 247, 245, 241, 238, 234, 229, 224, 219, 213, 207, 201, 195, 188, 181, 173, 166, 158, 150, 142, 134, 127, 119, 111, 103, 95, 87, 80, 72, 65, 58, 52, 46, 40, 34, 29, 24, 19, 15, 12, 8, 6, 3, 2, 1, 0, 0, 0, 1, 2, 3, 6, 8, 12, 15, 19, 24, 29, 34, 40, 46, 52, 58, 65, 72, 80, 87, 95, 103, 111, 119,};
byte sine2[steps]; // Array to store values of sine


void setup(){
  #if  defined(SERIALDEBUG)
  Serial.begin(115200);
  #endif
  createSine();
  //set digital pins 0-7 as outputs
  for (int i=0;i<8;i++){
    pinMode(i,OUTPUT);
  }
  
}

void loop(){
  for (int t=0;t<steps;t++){//increment "t"
    //PORTD = sine[t];//send sine wave to DAC, centered around (127/255)*5 = 2.5V
    PORTD = sine2[t];
    delayMicroseconds(10);//wait 50us
  }
}

void createSine(){
  for (unsigned int i = 0; i < steps; i++){
    sine2[i] = 127*(1 + sin(2*PI*i / steps));
    #if defined(SERIALDEBUG)
    Serial.println(sine2[i]);
    #endif
    }
  }