0% found this document useful (0 votes)
41 views4 pages

Lab 11

project lab

Uploaded by

mohsin89
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views4 pages

Lab 11

project lab

Uploaded by

mohsin89
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 4

Signal Processing Lab 11

Filters:

Electronic filters are electronic circuits which perform signal processing functions, specifically to remove
unwanted frequency components from the signal and/or to enhance wanted ones. Electronic filters can be:

 passive or active
 analog or digital
 high-pass, low-pass, band-pass, band-reject (band reject; notch), or all-pass.
 discrete-time (sampled) or continuous-time
 linear or non-linear
 infinite impulse response (IIR type) or finite impulse response (FIR type)

The most common types of electronic filters are linear filters, regardless of other aspects of their design

Digital Filters:

A digital filter is a system that performs mathematical operations on a sampled, discrete-time signal to reduce
or enhance certain aspects of that signal. This is in contrast to the other major type of electronic filter, the
analog filter, which is an electronic circuit operating on continuous-time analog signals. An analog signal may
be processed by a digital filter by first being digitized and represented as a sequence of numbers, then
manipulated mathematically, and then reconstructed as a new analog signal. In an analog filter, the input
signal is "directly" manipulated by the circuit.

In digital signal processing applications, it is often necessary to change the relative amplitudes of frequency
components or remove undesired frequencies of a signal. This process is called filtering. Digital filters are
used in a variety of applications. Digital filter design requires the use of both frequency domain and time
domain techniques. This is because filter design specifications are often given in the frequency domain, but
filters are usually implemented in the time domain with a difference equation. Typically, frequency domain
analysis is done using the Z-transform and the Discrete Time Fourier Transform (DTFT).

In general, a linear and time invariant digital filter with input x(n) and output y(n)may be specified by its
difference equation.

(1)

where bi and ak are coefficients which parameterise the filter. This filter is said to have N zeros and M poles.
Each new value of the output signal, y(n) , is determined by past values of the output, and by present and past
values of the input. The impulse response, h(n) , is the response of the filter to an input of δ (n) , and is
therefore the solution to the recursive difference equation.

(2)

There are two general classes of digital filters: infinite impulse response (IIR) and finite impulse response
(FIR). The FIR case occurs when ak = 0, for all k. Such a filter is said to have no poles, only zeros. In this
case, the difference equation in (2) becomes

(3)

1
Signal Processing Lab 11

Since (3) is no longer recursive, the impulse response is finite with length N.
In the case where ak ≠ 0 , the difference equation usually represents an IIR filter. In this case, (2) will usually
generate an impulse response which has nonzero values as n → ∞. However, later we will see that for certain
values of ak ≠0 and bi , it is possible to generate an FIR filter response.

The Z-transform is the major tool used for analysing the frequency response of filters and their difference
equations. The Z-transform of a discrete time signal, x(n), is given by

(4)

The DTFT may be thought of a special case of the Z-transform, where z is evaluated on the unit circle in the
complex plane.

(5)

From the definition of the Z-transform, a change of variable shows that a delay of K samples in the time
domain is equivalent to multiplication by Z-k in the Z-transform domain.

(6)

We may use this fact to rewrite the equation (1) in the Z-transform domain, by taking Z-transforms of both
sides of the equation:

(8)

(9)

2
Signal Processing Lab 11

(10)

From this form, we see that any filter, which can be represented by a difference equation, has a rational
transfer function (i.e. a transfer function which is a ratio of polynomials). From this result, we may compute
the frequency response of the filter by evaluating H(z) on the unit circle.

(11)

There are many different methods for implementing a general recursive difference equation. Depending on the
application, some methods may be more robust to quantisation error, require fewer multiplies or adds, or
require less memory. Fig. 1 shows a system diagram known as the direct form implementation; it works for
any discrete time filter described by a difference equation. Note that the boxes containing the symbol z−1
represent unit delays, while a parameter written next to a signal path represents multiplication by that
parameter.

Figure 1: Direct form implementation for a discrete time filter described by a general difference equation

Exercise:

Task#1: Generate two sinusoid signals with frequency of 100 Hz and 400 Hz. Add these two signals. Design
a filter to extract 100 Hz signal.

Task#2: Taking the signals of Task#1, design a filter to extract 400Hz signal.
3
Signal Processing Lab 11

Task#3: Generate the code for the given FIR filter, having the coefficient b0=1, b1= -1 and b2=1. Taking
sinusoid as x(n) having 80 samples, frequency =1/8 and phase= pi/6.

y(n) = b0x(n) +b1x(n-1)+b2x(n-2)


Task#4 Generate the code for the FIR filter in Task#3, having the coefficient b0=1, b1= -1 and b2=2. Taking
impulse signal as x(n) having 16 samples.
Task#5: Generate the code for the given IIR filter, having the coefficient b0=0, b1= 1 and a0=1, a1=0.97.
Taking impulse signal as x(n) having 80 samples.

a=0.97

y(n) = x(n-1)+ ay(n-1)

You might also like