Page 1 of 1
Forum

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!




Difference between ...
 
Share:
Notifications
Clear all

[Solved] Difference between sampling rate of ADC and Sampling frequency


(@ranjanpal)
Active Member
Joined: 11 months ago
Posts: 16
Topic starter  

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 10 months ago 2 times by ranjanpal

ReplyQuote
Topic Tags
 Hans
(@hans)
Noble Member Admin
Joined: 8 years ago
Posts: 2018
 

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. 🙂 


ranjanpal liked
ReplyQuote
(@ranjanpal)
Active Member
Joined: 11 months ago
Posts: 16
Topic starter  

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 ?


ReplyQuote
 Hans
(@hans)
Noble Member Admin
Joined: 8 years ago
Posts: 2018
 

You're welcome.

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.


ReplyQuote

Like what you see and you'd like to help out? 

The best way to help is of course by assisting others with their questions here in the forum, but you can also help us out in other ways:

- Do your shopping at Amazon, it will not cost you anything extra but may generate a small commission for us,
- send a cup of coffee through PayPal ($5, $10, $20, or custom amount),
- become a Patreon,
- donate BitCoin (BTC), or BitCoinCash (BCH).

Share: