11-17-2014 01:20 PM
I'm using a very simple program with a while loop to graph the voltages from a function generator, collected in a DAQ card, in a waveform chart. For some reason thought, I can't seem to produce a smooth sin curve in labview when I switch the the function generator to sin. The curve that is graphed on the waveform chart is very rough and doesn't really resemble a sin curve. My square curve from the function generator graphs better, but it still isn't uniform and it's still rought. It looks perfect in a Oscilloscope however. Any ideas?
11-17-2014 01:23 PM - edited 11-17-2014 01:23 PM
11-17-2014 01:52 PM
We need to see some code. Maybe also show is a picture of the waveforms you are seeing. I don't know what "rough" means! (noisy, jumpy, quantized, etc. )
Even if you violate nyquest you should get a regular waveform (but maybe not what you are expecting to see) unless the sampling is irregular in time. Do you use hardware of software based timing?
What is the frequency of your signal?
What is you sampling rate?
What is the amplitude of the signal and what are your gain settings?
11-17-2014 02:23 PM
Your symptoms point directly at your sample rate. What is the frequency of the signal you are trying to sample? What sample rate are you using?
According to Nyquist, you have to sample a signal at least twice the signal's bandwidth. So if you are trying to measure a 1kHz signal, you have to sample at least 2kHz in order to get the frequency characteristics of your signal. I prefer to sample at 10 times, 5 times being a good minimum. So back to that 1kHz signal, I would try to sample at least 10kHz.