From analog to digital signal filtering

Signal filter is electrical equipment that attenuates the unwanted signal characteristic wave. Filters can be analog or digital.

An analog filter processes analog signals. They are mainly arranged with capacitors and resistors.

Digital signal filters process digital signals which are quantized. Digital filters are arranged with solid state components to process the signals.

Let’s start from analog filters.

Analog filter is a circuit which filters unwanted frequencies. Filtering is done by choosing circuit transfer function.

Simplest analog low pass filter:

image001.gif

The current in RC circuit can be calculated as follows:

image003.gif

Then if we think about digital filtering, then Uin(t) and Uex(t) we can change to xn=x(nT) and yn=y(nT). Then we can rewrite equation:

image005.gif

Then we get:

yn=a0xn+a1xn-1-b1yn-1,

Where

a0=1/(1+T/RC), a1=-1/(1+T/RC), b1=-1/(1+T/RC).

This equation now can be used to build digital filter.

Filter can be described using response function. Response function of analog filter is reaction to step function while digital filter response function is response to step function in samples:

u[n] = 1, if n>=0
u[n] = 0, otherwise

According to method described in previous article we can calculate filter transfer function h(n);

Results are in following table:

Filter

h at t/RC

0

0.5

1

1.5

2

Analog

1

0.779

0.368

0.223

0.136

Digital

T=0.5RC

0.667

0.444

0.296

0.198

0.132

T=0.25RC

0.8

0.512

0.328

0.21

0.134

T=0.125RC

0.889

0.555

0.346

0.216

0.135

image007.gif

From this chart you can see, if time T between samples is smaller then digital filter trends to analog filter characteristic. This means that you may choose digital filter error by varying sample step.

Digital filters have some advantages against analog filters. For instance in some circumstances analog filter can’t be valid while digital can be valid.

Besides transfer function filter can be described using Laplace transform:

H(s)=y(s)/x(s).

And x transform:

H(z)=Y(z)/X(z).

Z transform can be done in following way:

image009.jpg

Inverse Z transform:

image011.jpg

I am not going too deep in it as there are tons of information about Z transform:

Using Z transform we can rewrite our filter equation in following form:

image013.jpg

This is one Tap filter and its structure:

image015.jpg

-1 means delay by on sample, T – one clock period. a0, a1 and b1 are filter coefficients (multipliers).

We can rewrite filter equation in other way:

image017.jpg

Now its easy to write filter transfer function:

H(z)=(a0+a1z-1)/(1+b1z-1)

And filter frequency response:

image019.jpg

Blogsphere: TechnoratiFeedsterBloglines
Bookmark: Del.icio.usSpurlFurlSimpyBlinkDigg
RSS feed for comments on this post
 |  TrackBack URI for this post

New on WinAVR Tutorial
Running TX433 and RX433 RF modules with AVR microcontrollers,
Sometimes in embedded design you may want to go wireless. Might be you will want to log various readi …
Programming AVR ADC module with WinAVR,
Most of AVR microcontrollers have Analog to Digital Converter (ADC) integrated in to chip. Such solut …
New on WinARM Tutorial
What are differences between WinARM and WinAVR,
Everyone who is working with AVR microcontrollers knows this powerful tool – WinAVR (http://win …
LPC2000 watchdog timer,
As in all microcontrollers watchdog timers purpose isto reset microcontroller after reasonable amount …

Leave a Reply