From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQ sample clock dependency with small signals

Solved!
Go to solution

I think Henrik, as usual, is pointing us in the right direction.

 

I put a waveform indicator on the output lines from the Read Waveform from File.vi. (I then found that you cannot change the display format of the dt indicator in the wavefrom indicator. See separate post on the topic.) Expanding the display of dt shows that the actual values as reported in the waveforms recorded in the files are:

 

Filename        Recorded dt                Calculated fs

2000.dat    0.005000000000          200.000000000000000

10000.dat  0.001000000000        1000.00000000000000

10001.dat  0.0009998750000      1000.12501562695388

20000.dat  0.0005000000000      2000.00000000000136

20001.dat  0.0004998750000      2000.50012503125822

 

First, note that the actual sampling frequencies are 1/10 the values you said you were using. Second, note that only the 200 and 1000 frequencies are integers. Check the manuals for your DAQ devices to see what sampling frequencies can actually be generated.  At these actual sampling frequencies the Nyquist limit will be well within the typical audio bandwidths. I suspect that you are seeing aliasing of harmonics or noise generated within the circuit you are testing.

 

Lynn

Message 11 of 15
(2,307 Views)

Just tested with a scope. Tested with a sampling rate of 20006 Hz on the DAQ and it produces the same characteristic sawtooth plot. The plot on the scope looks as expected however (ie. looks like the 20 000 Hz plot). Just thinking about the other comments 🙂

 

scope_0.png

0 Kudos
Message 12 of 15
(2,302 Views)

Oh shoot, just realized that the saved data is downsampled by a factor of ten (every tenth point is kept, the rest thrown out, no fitting). Sorry about that!!!!! The data is saved to a database and it was getting too large to handle. The downsampling happens at the very end so that the plot indicattors receive the full data rate.

 

Screenshot_011515_054449_PM.jpg

0 Kudos
Message 13 of 15
(2,300 Views)
Solution
Accepted by topic author tesla745

Resolution.

 
Finally figured out the issue and it was on my end (as might have been expected 🙂 )
 
The issue was that the input and output sampling rates need to be aligned. (As a note the 'actual sampling rates' need to be aligned and the input and output round to different 'actual sampling rates'. eg. setting input to 20001 produces an actual of 20005 and setting output to 20001 produces an actual of 20000. Makes sense in terms of always rounding up for input and rounding to closest for output).
 
Since the circuit I am testing is a noise cancelling circuit it has a strong response to step changes. Since the outputs are actually just a series of small step changes, this was producing small responses at each one of these steps. If the output and input sampling rates did not match, the input would be essentially sampling at different points along these steps creating an aliasing affect. Eg. when sample rates are aligned it would sample at the same region in each step, while when misaligned it would change which part of the step it was sampling.

 

Message 14 of 15
(2,221 Views)

That makes sense. The effects you were seeing acted like aliasing, but it was not clear how it was happening. Thanks for letting us know what you found.

 

Lynn

0 Kudos
Message 15 of 15
(2,214 Views)