Welcome to the Tweaking4All community forums!
When participating, please keep the Forum Rules in mind!
Topics for particular software or systems: Start your topic link with the name of the application or system.
For example “MacOS X – Your question“, or “MS Word – Your Tip or Trick“.
Please note that switching to another language when reading a post will not bring you to the same post, in Dutch, as there is no translation for that post!
[Solved] Difference between sampling rate of ADC and Sampling frequency
December 5, 2020 9:40 AM
Hi, I was referring to following codes given in reference: https://github.com/OpenLabTools/RPi_ADS1115/blob/master/code/continuous_read_adc.py
Line 18, asks for user defined sampling frequency.
Line 19, asks for sapling rate of ADS1115 (which can be any one of 8, 16, 32, 64, 128, 250, 475, 860 sps).
However, as per my understanding, sapling frequency and sampling rate are same.
So how can we have two different inputs ?
So if someone could please let me know where is my understanding going wrong, I would be very much thankful!
This topic was modified 2 years ago 2 times by ranjanpal
December 5, 2020 10:20 AM
Not sure why you started a new topic, which is not a problem by the way. I'll just add the link to your original post. 😉
It is indeed confusing, but my best guess would be the sampling frequency done by the ads1115 (sps), and the sampling frequency done by the application (frequency)?
This is just a guess, but an ADS could for example sample with a frequency of 1000 Hz, where as the application actually only asks for a sample with a frequency of 500 Hz.
Since I'm not full in the know about the ads1115 specs, there may or may not be a good reason for this. Normally I'd assume that these values would be the same, but maybe the ads1115 gives better results when sampling more often.
Either way I'd assume frequency to be lower or equal to sps.
Again: just doing an educated guess here. 🙂
December 5, 2020 10:25 AM
THanks a lot for your valuable suggestions.
So, by intuition, at hardware level does it make any difference wrt overload on ADC and accuracy of our results ?
December 5, 2020 10:31 AM
Ehm, I honestly wouldn't know if this would make a difference.
I'd normally use the same frequence for both - not even thinking twice about that.
Higher frequency means more sampling (obviously), which wouldn't be very useful if you'd read only half of them? Right?
So in short: I have no clue why they'd do that, unless there are other factors in play.
(eg. other hardware is involved, or the ADS has some logic build in which would make a higher sample rate produce different or better results).
Note: Maybe one is used to read data at a certain frequency and the other one is used to plot a chart (for example)?
I'm not familiar with the project you're looking at.