I am working with a NI-USB-6251 board and have the problem, that I can set the analog out sampling frequency in steps only - so if I set it to 300 kHz it will run with 298507,462687 Hz.
The problem is, that I need to sample out some predefined waveforms (created with a certain sampling rate) and due to the frequency shift og the output I get a streched or compressed waveform out.
Does somebody know why it is like that? I have attched a screenshot from a set-get-loop to show better what I mean.
Solved! Go to Solution.
The way the clocks work in most DAQ systems is you have a base clock and then you apply a divider to get the desired sample rate. In the case of the 6251, it appears to be using a 20MHz base clock which is divided by 67 to get 298.507kHz. In your case, this will give a 0.5% timing error.
If you need extreme absolute accuracy, you should use an external clock that is phase locked to whatever is generating your source waveform. If you don't, you will never be perfectly synchronized because of the finite resolution of the PLL generating your sampling clock, and because of the limited accuracy of the crystal oscillator driving the PLL.
Luckily we do not need extreme accuracy. We were just wondering why our outputted signals were shifted in frequency. But with the above knowledge we can just adapt our analysis to the minimal lower frequencies.
You can do a resampling (vi's are provided by NI) if needed.