Does the Arduino have enough memory for storing signals?

Does the Arduino have enough memory for storing signals?

My signals would need to be only few seconds in length.

You mean samples of an analogue signal? Then we need the sampling rate, bits per sample per channel and number of channels. Then just calculate how many bytes one second needs, find out how much memory is available on your Arduino and then you should know how many seconds you can store.

Yeah.

I assume a PWM signal wouldn't require much sampling rate.

As they're generally around 25Hz, then 50Hz would be sufficient?

soundmodel:
Does the Arduino have enough memory for storing signals?

That's a a bit like asking if a drawer is big enough to store your CD collection without saying how many CDs you have.

You need to tell us how many signal samples you want to store.

An Arduino does not have much memory - 2k on an Uno, 8k on a Mega. And some of that is required for working memory for your program.

Maybe you need to use a shield with an SD Card to store your data?

...R

Yes, but as stated, the flash memory available is the limiting factor.

I built a sampler and I'm storing a few seconds of 20KHz audio data in the flash of an ATMEGA1284 (has 128kb flash). No problem.

Here's the code that defines and also reads the stuff from the flash, maybe it'll help you:

thomai:
Yes, but as stated, the flash memory available is the limiting factor.

I don't believe "flash" was mentioned prior to your Reply #4

Flash memory has a limited number of write cycles.

...R

soundmodel:
I assume a PWM signal wouldn’t require much sampling rate.

As they’re generally around 25Hz, then 50Hz would be sufficient?

No you need to be much faster than that if you hope to play the PWM signal into something and have that something react as if the PWM signal is properly generated.

However the exact sample rate depends on what that something is. Are you talking about a learning remote by any chance?

soundmodel:
I assume a PWM signal wouldn't require much sampling rate.

As they're generally around 25Hz, then 50Hz would be sufficient?

Assuming the transitions are very fast then a PWM 'signal' is either high or low at any time. What matters then is when the transitions occur and I would expect this to be what is stored. Typically though one would store just the time since the last transition (the deltas). If your PWM is 25Hz then if uncompressed you would need 2 delta values (high to low then low to high) per PWM cycle so exactly 50 samples per second.

If your PWM signal is a control signal (say driving a motor) then I suggest you think in terms of the information bandwidth and not the PWM frequency. It is likely that the information bandwidth is much much lower than the PWM frequency. You would then use a low pas filter to recover the information signal and sample that with an A-D converter. In this case the Nyquist sampling theorem say the theoretical minimum sampling rate is twice the information bandwidth which is likely to be much lower than 50 Hz.