LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Processing signal acquired from arduino / Arrays indexing / FFT (Help please )

Hi everyone , here is my issue:

 

First , I'm reading the variation of voltage trough a potentiometer (an analog voltage that goes from 0 to 5v when rotating the dial) using an arduino , therefore Im reading these values from pin A0. So what I get in a graphic chart is the signal in real time. Ok fine.   What I trying to do with the signal is to obtain the FFT.  I saw some solutions but they are using the arduino toolkit  , but I cannot do that since the real signal wont come from arduino but from a controller (ATmega8).  

So the logic Im following is this:

  • Save the adquire data into an array of defined size (lets say 100 and initialized with zeros) [Cannot understand why in the VI it doesnt work]
  • Somehow update every 100 values saved wich means after I save 100 values the array throws away the last one and updates the first one and so on  [trying to figure out hot to do this exactly]
  • Then this self uptdating array should be the input of a FFT box or a Waveform Graph and could allow me to see the response in time every 100 samples and the FFT every 100 samples.

But what Im trying  doesnt work , Im knew using labview and I've been overthinking this a lot. Maybe the solution is quite complex or quite easy , dont know really but if you could help me to get this trough at least in something I would be very glad. 

 

Here some screenshots with some commets.

niquestion.PNG

And the front panel view to show what I want to get at the end.

niquestion2.PNG

0 Kudos
Message 1 of 6
(2,004 Views)

There used to be a link to LabVIEW Tutorials on the initial page of the LabVIEW Forums.  Several of us (like Uday) have posted a set as a Reply to new users, such as yourself (Uday -- please post here!).

 

Learn about Shift Registers, a way of keeping data around between iterations of a loop.  What you want to do is start with a blank array and then accumulate new data into the same array (maintained on a Shift Register).  Look up Build Array and study how it works.  Read the LabVIEW Help on For Loops and While Loops.

 

Bob Schor

Message 2 of 6
(1,985 Views)

My advice is to go through some LabVIEW tutorials. It is really not effective to seek help in this forum before you learn at least the very basic concepts in LabVIEW. One example shift registers, array functions, timing, etc...

I guess you have some kind of licence, like student licence? Either way, you should be able to access the Core 1 online training. Please go through this online course (can be done via a weekend roughly), and post back here in this thread your new VI based on your improved knowledge of LV. You will see, this is a much more efficient way to learn LV.

 

link: http://ni.com/myni/self-paced-training

0 Kudos
Message 3 of 6
(1,982 Views)

The array should stay the same size, so you cannot use the "Insert Into Array" block. It is entering new values and making the array bigger in every iteration. You should play with "Replace Array Subset" to implement some kind of a circular buffer. As mentioned above, shift registers are a good solution as long as you don't have too many elements in your array.

You can also use one of the circular buffer implementations available on LTN (example), however I have no experience with them.

0 Kudos
Message 4 of 6
(1,977 Views)

Hi Emepecuatro,

Please review the following information, it will help you to improve your skills in LabVIEW and you will be able to create a better solution for you problem:

 

http://www.ni.com/white-paper/3625/en/

https://zone.ni.com/reference/en-XX/help/371361M-01/glang/array_functions/

https://zone.ni.com/reference/en-XX/help/371361H-01/lvanls/fft/

http://www.ni.com/getting-started/labview-basics/esa/examples

http://www.ni.com/product-documentation/14031/es/

 

I hope it helps you!.

Regards.

 

Lis V.

0 Kudos
Message 6 of 6
(1,931 Views)