Jump to content
  • 0

Software filters


jfdo

Question

Hi All,

What type of law pass filter would be suitable to filter noise in the ADC inputs?

I am using a simple average. It does reduce some noise, but I still have some noise. If I drive an 7-segment LED display there is flickering. 

It looks awful.

As I have understood for Moving Average is lags the original signal.

I am not familiar with FIR, IIR  low pass filters and there performances. 

I appreciate if someone can shed some light. Thanks

 Best Regards

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

Hi,

you can try a so-called "alpha tracker"

y = alpha * prevY + (1-alpha) * x

where y is the output, x the input and prevY the output from the previous compute cycle.

It's "the" standard quick&dirty "IIR" filter.
alpha is a constant slightly below 1 (e.g. 0.9, .99, 0.999 are typical values.

 

"Moving average" is computationally even cheaper

y = prevY + x - xDelayedByK

where xDelayedByK is a past input value from a delay line.

It's "the" standard "FIR" filter (the recursive equation is just an implementation shortcut).
It has a comb-shaped frequency response. Rule of thumb is, any frequency that fits a full number of cycles into the delay line is notchedout.

That's the short answer. The long answer might stretch across shelf meters in an EE library :-)

Link to comment
Share on other sites

BTW, any real-world("causal") filter causes lag on the signal.

The difference you're probably looking for is that a FIR filter settles to an input within a finite time span, where an IIR filter settles only asymptotically.

E.g. don't be fooled by the structure of the alpha tracker. It can be (and usually is) very slow to react to the input signal (aka "group delay") even if it's based on a single delay element.

Link to comment
Share on other sites

Hi,

Thank you very much for the answers.

Which filter, Casual filter or non-casual, lags more? Or non-casual filter doesn't lag?

In another words which filter,  casual or non-casual filter, is slow to  respond to the input?

Does the Centred averaging (centred about the point of measurement) filer is casual? and one-sided (non centred, and the averaging depends on the future inputs) filter is non-causal?

Thank you.

 

Link to comment
Share on other sites

Well non-causal filters are a specialized topic... Most students fail the exam first time because you have to hand in the answers actually before knowing the questions :-)

Anticipating what you're asking for: Usually the control theory guys use IIR filters because speed matters. Communications guys use FIR cause they can't stand the damage IIR does to their signal. Take this with a grain of salt.

You might want to think some more on what exactly it is you want to find out, otherwise it's unlikely you'll get replies that are actually useful for your specific problem.

Link to comment
Share on other sites

Thank you.

Good example .... "Most students fail the exam first time because you have to hand in the answers actually before knowing the questions  ".

If you store (buffer) data inputs and outputs,  can't we perform IIR filter?

 

Link to comment
Share on other sites

I'll take the bait ... the problem with "buffering output" in an IIR filter is that the output is the result out of the filter. But despaireth not - mathematically I can do it for a cyclic signal: write as discrete Fourier series, scale with the frequency response of the filter (Z domain transfer function), transform back to time domain. This works for non-causal and/or instable IIR filters, as long as there is no division by zero anywhere.
It's the kind of thing that makes engineers run into walls in an otherwise straight corridor.

But I'll be the first one to admit that besides possible entertainment value it is totally, utterly useless assuming your post is about a practical problem to solve. So you might want to provide some additional information, or review the earlier answers.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...