Doc. # 1-137715461 | |||
---|---|---|---|
Date Updated | 06-21-2007 | Date Created | 06-21-2007 |
Document Type | Knowledge Base | Related OS | |
Related Product | PCI-1710U/ PCI-1711/ PCI-1712/ PCI-1713U/ PCI-1716/ PCI-1741U/ PCI-1742U/ PCL-711B/ PCL-818 Series |
How to know the real sampling rate of AI, according to user set sampling rate | |||
---|---|---|---|
Solution:
Description:
This document introduces the way the driver decides sampling rate by using two counters and one 10MHz timer.
Solution:
There are two counters for divisors to divide the sampling frequency. The first counter will find the latest integer from 2 to 65536 (as the divisor of counter #1) so that divisor of the counter #2 can be less than 65536.
For these DAS cards, the base frequency provided by the oscillator is 10MHz.
For example, if you want to set the sampling rate as 100Hz.
The counter#1 * counter#2 is
(10M / 100) = 100000
and divided by counter#1
100000/2=50000 < 65536
Even you set sampling rate as slow as 100Hz, the divisor 1 is still 2.
So you might consider divisor as 2 for all conditions.
Another example is given for better explanation:
If we set the sampling rate as 100kHz. (max. sampling rate)
(10M / 100k) = 100
(100 / 2) < 65536 => divisor 1 =2
divisor 2 = 100/2 = 50
For the principle, you could know the real sampling rate you set.
If you set 39683Hz, the real frequency is 40000Hz. (dividers are 2 and 125)
If you set 39682Hz, the real frequency is 39682Hz as well. (dividers are 2 and 126)
|