Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Aliasing when sampling at high frequencies using DAQ Assistant

I am really new to LabView.My task is to continuously sample multiple analog input channels, view them in real-time, and store them to a file (preferrably .csv file). I also need to command two analog output channels given user input.

 

I began by working with 1 input channel.

My incoming signal ranges from 100 - 200Khz, and I am using the NI USB-6351 which can sample at a maximum of 1MHz. Using the DAQ Assistant I configured it for continuous sampling, a sample rate of 300Khz, and 30k samples to read.

 

Using a function gen, my input is a 100khz sine wave, 1vpp. When I view the signal in a waveform graph on labview, the signal looks aliased. It looks like a triangular waveform.

 

Can anyone help please. I have attached my block and front panel along with a screenshot of the waveform.

 

Download All
0 Kudos
Message 1 of 6
(3,633 Views)

Sample faster...

 

Let me put it this way.  100kHz input signal, 300kHz sample rate.  This means you will have 3 samples/cycle of your sampled sine wave.  That's why it looks funky.  I would recommend running at the full 1MHz sample rate.  I like to sample at at least 5x the maximum desired frequency, which is 200kHz in your situation, meaning you should sample at the 1MHz.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 6
(3,630 Views)

Do you know the reason for this. I assumed that Nyquist theory was upheld. However, this completely boggles me.

0 Kudos
Message 3 of 6
(3,626 Views)

As I said before, you are only getting 3 samples/cycle of your input frequency.  So take a pure sine wave.  Now divide the time into thirds.  Now draw a straight line connecting the points of the sine wave at the 1/3 time markers.  That is what is happening.

 

All Nyquist says is that you have to sample at more than twice the max frequency in order to reproduce the frequency characteristics of the input.  It says nothing about how clean your sampling will look.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 4 of 6
(3,624 Views)

Thank you.

 

Now that I am able to reconstruct my signal, is there a way that I can simultaneously generate an analog output within the same while loop?

 

I am obtaining a command voltage from the user and want to display it while generating an analog output. For some reason when I add this portion, my first Daq Assistant throws an error:

 

Attempted to read samples that are no longer available. The requested sample was previously available, but has since been overwritten.

Increasing the buffer size, reading the data more frequently, or specifying a fixed number of samples to read instead of reading all available samples might correct the problem.


0 Kudos
Message 5 of 6
(3,620 Views)

I would actually recommend reading and writing in separate loops.  This way the different IOs can run at whatever rate they need to.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 6
(3,583 Views)