Relationship between sampling rate and get samples - WPC-Systems-Ltd/WPC_Python_driver_release GitHub Wiki
In this article, we discuss about how to use our AI API
AI_setSamplingRate(port, sampling_rate, timeout=timeout)
AI_readStreaming(port, get_samples, delay=delay)
Sampling rate
- Sampling rate is the number of samples or measurements taken from an analog signal in one second. If you specify a sample rate of 1k, that means 1000 samples/sec. A higher sampling rate captures more waveform details of the original signal. In this example, the higher sample rate more accurately captures the waveform shape. The following figure illustrates a 1 Hz sine wave sampled by 5 points/s and 25 points/s ADC.
get_samples
- Number of points to retrieve at once from the buffer
What happen if we set get_samples = sampling_rate?
Let take get_samples=1000 and sampling_rate=1000 for example.
Typically, at a sampling rate of 1K, we can retrieve 1K data points at once, which appears to update once per second.
It looks like freeze or do nothing.
What happen if we set get_samples < sampling_rate?
Let take get_samples=100 and sampling_rate=1000 for example.
Typically, at a sampling rate of 1K, we can retrieve 100 points data points at once, which appears to update 10 times per second.
It looks like animation.
What happen if we set get_samples > sampling_rate?
Let take get_samples=2000 and sampling_rate=1000 for example.
Typically, at a sampling rate of 1K, we can retrieve 2K data points at once. It only updates the screen once every two seconds, which would feel very slow.