LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Efficient way to filter noise from an analog input

Hi,

 

I am trying to acquire analog input voltage using USB-6212. Currently, I am facing difficulty in filtering unnecessary noise with the data that I acquired. When I use the chebyshev or the butterworth filter, my data seems to go to zero for a short period of time but when I remove the filter, this problem does not persist. I am using NI max to use sine signal to simulate the task as shown on the snippet below. Attached are the VIs for both w/ hardware and w/o hardware. And also may I ask if I'm using the producer-consumer loop correctly? Any help will be appreciated.

 

Kind regards,

Charles Celetaria  

0 Kudos
Message 1 of 13
(512 Views)

Have you read the online Help for that filter function?  That should have been one of the things you did *before* choosing to use it.

 

Once you go back and read it, you'll find that you need to wire a True to the 'init/cont' input so the filter doesn't re-initialize (causing a transient response starting from 0) with every call.  It's typical to wire the loop iteration terminal to a "> 0" comparison operator, then wire the comparison output to the 'init/cont' terminal.

 

 

-Kevin P

0 Kudos
Message 2 of 13
(469 Views)

Let's start thinking about the problem domain here. ( You guessed it! Jay is going to make you all think with a different part of your brain)

The noise is not being caused by the measurement equipment. It exists all the time in the measurement environment. That should be telling you something about what you should be doing BEFORE you even consider post acquisition filtering.

First get rid of the noise source whenever possible.

Second address noise susceptibility. Are wires and cables properly routed/shielded/twisted as appropriate? Is Grounding properly attended to?

Third, since the noise it there all the time filter it all the time. You might be surprised by just how many Resistors, Capacitors, Inductors or Ferrite beads you can purchase and install for the same cost as the hours wasted futzing with a digital filter when you should have addressed proper electrical engineering concerns first anyway!

 

And see, I completely addressed your concerns about Efficiency in noise filtering. 

 


"Should be" isn't "Is" -Jay
Message 3 of 13
(456 Views)

@JÞB wrote:

Let's start thinking about the problem domain here. ( You guessed it! Jay is going to make you all think with a different part of your brain)

The noise is not being caused by the measurement equipment. It exists all the time in the measurement environment. That should be telling you something about what you should be doing BEFORE you even consider post acquisition filtering.

First get rid of the noise source whenever possible.

Second address noise susceptibility. Are wires and cables properly routed/shielded/twisted as appropriate? Is Grounding properly attended to?

Third, since the noise it there all the time filter it all the time. You might be surprised by just how many Resistors, Capacitors, Inductors or Ferrite beads you can purchase and install for the same cost as the hours wasted futzing with a digital filter when you should have addressed proper electrical engineering concerns first anyway!

 

And see, I completely addressed your concerns about Efficiency in noise filtering. 

 


I agree wholeheartedly.  The time to do the filtering is before it ever gets to the software.  This strategy has the additional advantage that it just may save your instruments by filtering any transient spikes BEFORE they get to your detector.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 4 of 13
(442 Views)

No, I don't think this is about noise in the original signal.  This is about the much worse artifacts that show up *after* putting the filter inline.  And those are caused by the filter function being re-initialized every call.  That sets the filter's state variables to 0.  Each time the filter function gets called, we're seeing the filter's own transient step response.

 

 

-Kevin P

0 Kudos
Message 5 of 13
(416 Views)

@Kevin_Price wrote:

No, I don't think this is about noise in the original signal.  This is about the much worse artifacts that show up *after* putting the filter inline.  And those are caused by the filter function being re-initialized every call.  That sets the filter's state variables to 0.  Each time the filter function gets called, we're seeing the filter's own transient step response.

 

 

-Kevin P


I know what was shown in the graph.  And, that is called an "Impulse Response" not a transient step.  You are correct about the cause.

 

Of course, that is just one more very good argument for conditioning the signal in hardware after attending to the proper engineering of the system environment to minimize noise.


"Should be" isn't "Is" -Jay
0 Kudos
Message 6 of 13
(411 Views)

Summary for the OP:  Everyone's right!   At least partly...

 

I was focused on the immediate short-term problem you presented about the filter artifacts, i.e., I was giving you a fish.

 

Both JÞB and billko 

 

You needed both.

 

 

-Kevin P,

"so long and thanks for all..., oh nevermind"

Message 7 of 13
(384 Views)

But ... what if you don't like fish! I like Chicken roll with piri piri. 😄

G# - Award winning reference based OOP for LV, for free! ADDQ VIPM Now on GitHub
"Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
Certified-LabVIEW-Developer
Message 8 of 13
(368 Views)

@Yamaeda wrote:

But ... what if you don't like fish! I like Chicken roll with piri piri. 😄


My 8-Ball response. 

 

Catch the fish. Sell the fish.  Buy chicken roll with piri piri with the money earned from application of the skills you have.  Remember to save some money to pay for training on how to cook chicken rolls and piri piri.

 

Try the fish swimming UPSTREAM they are tastier. 


"Should be" isn't "Is" -Jay
Message 9 of 13
(356 Views)

@JÞB wrote:

@Yamaeda wrote:

But ... what if you don't like fish! I like Chicken roll with piri piri. 😄


My 8-Ball response. 

 

Catch the fish. Sell the fish.  Buy chicken roll with piri piri with the money earned from application of the skills you have.  Remember to save some money to pay for training on how to cook chicken rolls and piri piri.

 

Try the fish swimming UPSTREAM they are tastier. 


But the fish floating downstream upside down are easier to catch.  They don't put up much of a fight!  😆

Message 10 of 13
(330 Views)