09-21-2006 09:29 AM
09-21-2006 09:35 AM
09-21-2006 01:43 PM
Sounds like you get frequency artifacts from your external sampling clock but not from the board's internal clock, right?
How constant is the external clock? How is it being generated? Can you vary its frequency? If so, do the artifacts disappear, shift proportionally, or stay right at 32 kHz.
I notice that the 768 kHz external clock is an integer multiple of the 32 kHz artifact. I would be pretty suspicious of such a "coincidence," and work hard to rule out irregularities in the external clock before moving down my list of suspects.
-Kevin P.
09-25-2006 12:25 AM
09-25-2006 09:57 AM
I've gotta confess -- I haven't developed the automatic habit of "trusting" DAQmx to handle things behind the scenes. So I haven't really explored the options for specifying an external clock and also specifying its (alleged) frequency in the call to DAQmx Timing. When I *do* use an external clock, I always wire a "1" into the input for sample rate and construct the rest of my app to think of it as "samples per cycle." Then I deal with the actual timebase information manually. DAQmx may handle everything just fine, but most of my uses of external clocks are clocks that aren't necessarily a constant freq. In such a case, there is no single constant value to feed to DAQmx Timing anyway. Also, I tend to avoid the waveform datatypes, dealing directly with arrays for efficiency.
I would agree with your choice to use the external signal as an External Clock rather than as a Trigger. You'll need to check your board's specs for maximum external clock rate -- it may be a bit less than when it uses an internal clock. I'm assuming you're sampling only 1 channel? If more than 1 channel, you're already in trouble because the max conversion rate of 1.25 MHz with an internal clock must be divided by the # of channels. So the max sample rate for 2 channels would be 625 kHz with an internal clock, possible less with an external.
Again, I still find the fact that the 32 kHz artifact is an integer multiple of the 768 kHz sampling rate to be suspicious. Just a gut feel from general experience -- such relationships usually arise from a systematic source rather than purely by coincidence. You've checked the clock itself though, so I'm not certain where else to look. You might try adding an analog anti-aliasing filter and see if it helps, because if there were a real phenomanon at 800 kHz while you sampled at 768 kHz, it'd show up as if it were a phenomenon at 32 kHz. Anti-aliasing would help suppress the 800 kHz, thereby suppressing the apparent 32 kHz artifact. No guarantees here, just another avenue to investigate.
-Kevin P.