Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Difference between sampling rate of ADC and Sampling frequency #1

Open
ranjanpal111 opened this issue Dec 5, 2020 · 1 comment
Open

Comments

@ranjanpal111
Copy link

ranjanpal111 commented Dec 5, 2020

Thanks a lot for your work. Its very helpful.

I have a query based on your codes.
(ref link: https://github.com/OpenLabTools/RPi_ADS1115/blob/master/code/continuous_read_adc.py ).

Line 18, asks for user defined sampling frequency.
And then in Line 43, this 'user defined sampling frequency ' is used to define time step ( as mentioned in line 22) and save it in csv file.

Line 19, asks for sapling rate (sps) of the ADC convertor i.e. ADS1115 (which can be any one of 8, 16, 32, 64, 128, 250, 475, 860 sps).
And then In line 27, ADC conversion is done wrt to this sps as mentioned in line 19.

However, as per my understanding, sapling frequency and sampling rate are same.

So how can we have two different inputs ?

If you could please let me know where is my understanding going wrong, I would be very appreciative.

@akabla
Copy link
Member

akabla commented Dec 6, 2020

Dear @ranjanpal111
thanks for your message. It's been a while since I last looked at this, but I'll try to answer!
The SPS is the rate at which the ADC will sample data and update its registers. The sampling frequency determines how often the python code will query the ADC. So they are different, but not independent. You'd certainly want the SPS to be higher than the sampling freq of the python code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants