0
votes

I am reading a analog sensor value through arduino and getting this data onto my matlab. Is there a way to find the sampling rate of the signal and does baud rate play any role in the sampling rate or its just for maintaining data rate for serial communication.

Thanks.

1

1 Answers

0
votes

The only answer to these answer is just "you should know".

Everything depends on how you implemented it. If you used a timer to start the acquisitionthen the sampling time is the timer period. If you just wrote the acquisition in the loop function and there are other routines in there then the sampling interval can vary and depends on what is being executed.

The baud rate influences the sampling rate because if you have to send (for instance) 10 bytes per acquisition at 9600 bps you can have a max throughput of about 1 sample per 10 ms; at 152000 you are transmitting 15 times faster, so you can send more than one sample per millisecond.

Note that if you are using a software serial you will get a lot of delays if your serial transmission is slow.