From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I get the acquired data (signals) to be more clear on higher frequency?

Solved!
Go to solution

 

Hi,

 

I am working on a data acquiring project and I have faced a problem.

 

The goal is to measure and log data from incoming signals, up to 10KHz, into a file, so it can later be used for analysis.

 

I have a CompactRIO and I use Labview to program it.

 

At the moment I have two main programs, one on the FPGA that samples the data and send it to FIFO DMA, and another one on my PC that read the data from FIFO and save it on a file.

 

So far I use the highest sampling frequency that I can at 50KHz. In theory, I must be able to obtain data up to 25KHz (which is higher than what I need, but I do it for higher resolution)

 

The problem is that all signals over 3KHz will lose their shape. I send an AC sine signal as a test signal to the CRIO.

 

I will attach the files and a picture of 2 signals, one with 2000Hz and another one with 6000Hz, so you can see the difference.

 

How can I solve this problem? Is there anything that I am missing here? I have spent a lot of time thinking about what can cause this problem, but I have not been able to figure it out. I appreciate your suggestions.

0 Kudos
Message 1 of 5
(906 Views)
Solution
Accepted by topic author outis323

There is not a "problem" here.  This is simply the nature of sampling theory.  In the same way a 32x32 pixel icon can't carry as much detail and resolution as a 10 megapixel photograph, a 6 kHz sine wave sampled at 50 kHz doesn't carry as much detail and resolution as one sampled on a scope at 1 GHz.

 

A common guideline for time domain analysis is to sample at 10x the highest freq content in the signal.  20x is commonly recommended when feasible.  The higher the oversampling factor, the better detail & resolution you get.  But also the higher demands on the circuitry and data bandwidth.  10x-20x has tended to be a reasonable tradeoff in many cases.

 

Maybe you can shift your analysis to the frequency domain?  There 2x oversampling can be sufficient (and is also the minimum required).

 

 

-Kevin P

 

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
Message 2 of 5
(889 Views)
Solution
Accepted by topic author outis323

Hi outis,

 


@outis323 wrote:

How can I solve this problem? Is there anything that I am missing here?


You cannot solve this issue.

You missed: Nyquist criteria is still valid for 6kHz signals sampled at 50 kHz, but on the other hand you only get 8.3 samples per signal period. And now you wonder why there are some "issues" in your Excel plots when you want to see a sine wave from less than 9 samples per period?

 

Simple solution: change the plot properties in Excel to "aliased" (or similar wording) to get "more round" curves! 🙂

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 3 of 5
(887 Views)

Thanks for the reply.

 

Is there any way I can go up to 100KHz sampling frequency on FPGA or is it not practical?

So far the highest I could go was 60KHz, I wonder if it is limited due to the amount of code or something else.

0 Kudos
Message 4 of 5
(840 Views)

Hi outis,

 


@outis323 wrote:

So far the highest I could go was 60KHz, I wonder if it is limited due to the amount of code or something else.


You are reading samples from 8 channels of your AI module: which module do you use?

Did you follow the example VIs for that module to read samples as fast as possible?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 5
(768 Views)