LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to get smooth data

Hi all,

 

I have incoming signal with some noise on it. i Would like to get rid of this noise.

Question is how to do that ? 

I am trying to use Butterworth Filter but with no luck. 

0 Kudos
Message 1 of 18
(5,799 Views)

Go back and spend more time with the LabVIEW Basics tutorials (look for some on the first page of this Forum).  You start off well, using DAQmx functions, but don't do as well inside the Acquisition Loop.

 

You are acquiring data from 2 channels, so your output is an array of two waveforms.  What LabVIEW Structure is designed for arrays?  I don't see any in your code, but I do see an ugly Split Signals node (get rid of it, process the Array as an Array, noting you do pretty much the same thing to each channel).

 

Use Shift Registers.  You have a Select function that wants a True the first time through the While loop, and False thereafter.  Wire True to the Shift Register from outside the Loop (so it will be True the first time through), and wire False from inside (on the right hand edge) of the Loop so it will be False thereafter (until you re-enter the loop).  Much more direct, no need to think about the value of "i".

 

Click on the Low Pass function and get Help on its inputs.  See the red Coercion Dot on the top left input?  You wired the wrong thing (it might work, but you still wired the wrong thing).  Did you need to wire any other inputs?  You might check.

 

Avoid Dynamic Data Wires like the plague (that they are)!  If you processed Arrays in, you should get Arrays out, and they will plot just fine.

 

Bob Schor

Message 2 of 18
(5,773 Views)

Hi Bob,

 

Pablo already accepted a solution with remarks on how to avoid ExpressVIs.

 

It seems he doesn't care about (good) advise…

Best regards,
GerdW


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

every body says do not use express vis but nobody says why.

 

So question is why do not use express vis  ? 

and originally posted question how to get rid of the noise from my signal ?

0 Kudos
Message 4 of 18
(5,752 Views)

Hi Pablo,

 

Because DDT wires hide most information from programmers view!

 

From looking at the block diagram you cannot know which kind of data are transferred in such a wire...

Best regards,
GerdW


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

@plpablo wrote:

every body says do not use express vis but nobody says why.

 

So question is why do not use express vis  ? 

and originally posted question how to get rid of the noise from my signal ?


Express vis hide configuration information in the code.  They also have code for every configuration setting inside.   They are often so bloated that it impacts performance. 

 

Some, are useful like time delay and prompt user since well, time does not matter for them delay is time consuming and users are slow.


"Should be" isn't "Is" -Jay
0 Kudos
Message 6 of 18
(5,734 Views)

Ok, thank you guys for explaining. Please lets focus on may problem, so How to get rid of the noise on my signal ? 

0 Kudos
Message 7 of 18
(5,726 Views)

@plpablo wrote:

Please lets focus on may problem, so How to get rid of the noise on my signal ? 


 

If you use a lowpass filter, you need to set the low cutoff frequency. Wiring a high cutoff frequency (as you did) does nothing. You wired to the wrong input.

 

FilterLowpass.png

 

Now go an play with the other filter parameters until things look OK. 😄

 

And yes, you have a huge amount of duplicate code that only differs in a single diagram constant (0.997 vs 0.995). You only need one instance of that code! It belongs into a FOR loop, autoindexing on a 2D array of data and autoindexing on an array of (0.997 vs 0.995), all the other constants can remain scalar. (See how I do the filtering above)

Message 8 of 18
(5,719 Views)

thank you looks perfect.

Next question is how to get rid of my DDT and all express Vi . 

my input is AI from NI USB6210. I made program for one input, please have look.

First problem is difference in values between graph 1 and graph 2. don't know why it is there. 

Second question is how to get rid of ddt ? 

 

Best regards 

0 Kudos
Message 9 of 18
(5,703 Views)

I thought you are acquiring two channels, so the output should be a 2D array. Maybe you need to correctly configure your DAQ functions (I don't have DAQmx installed here, so I cannot help).

Currently, you are processing the same data twice in parallel. You can get rid of the =0 and select by simply initializing the shift register, right?

 

(And please don't attach a changed VI with the same filename as an earlier, different attachment. That can get confusing very fast!)

0 Kudos
Message 10 of 18
(5,698 Views)