Вы находитесь на странице: 1из 45

Framework of Digital Filters

Filter
Introduction
A filter is essentially a system or network that selectively changes changes the: Wave Shape, AmplitudeAmplitude-Frequency and/ or PhasePhase-Frequency characteristics of a signal in a desired manner.

Filter
Introduction
Common Filtering Objectives: Improve quality of signal (E.g. Removing or reducing noise), Extract information from signals or Separate 2 or more signals previously combined
E.g. When combined to make efficient use of an available communication channel)

Digital Filter
Introduction
A digital filter is a mathematical algorithm implemented in hardware and/ or software that operates on a digital input signal to produce a digital output signal for the purpose of achieving a filtering objective. The term digital digital filter filter refers to the specific hardware or software routine that performs the filtering algorithm.

Digital Filter
Introduction
Simplified block diagram of a realreal-time digital filter with analogue input and output signals:

mapping g the The Digital Processor implements the filtering operation, mappin input sequence, x(n), to the output sequence, y(n), in accordance with the computational algorithm. The DAC converts the digitally filtered output into analogue values values which are then analogue filtered to smooth and remove unwanted high frequency components.

Framework of Digital Filters


Digital Vs Analogue
Digital filters are preferred in a number of applications:
Data compression Biomedical Signal processing Speech processing Image processing Data transmission Digital audio Telephone echo cancellation Etc.

Framework of Digital Filters


Digital Vs Analogue
Advantages of Digital Filters:
Characteristics, such as linear phases, which are not achievable through analogue filters Performance do not vary with environmental changes Adjustment of frequency responses made simple Easy to create multiple filters: copycopy-andand-paste Input and output data can be saved VLSI - digital filters are small Precision only limited by wordlengths Performance repeatable from unit to unit Can be used at very low frequencies

Framework of Digital Filters


Digital Vs Analogue
Disadvantages of Digital Filters: Speed limitation Finite word length effects Long design and development times

Framework of Digital Filters


Types of Digital Filters
Broadly divided into 2 classes: Finite Impulse Response (FIR) Infinite Impulse Response (IIR) Either type of filter can be represented by its impulse response sequence, h(k) (k = 0, 1, . . . ), as in the following diagram

convolution nvolution sum The input and output signals to the filter are related by the co
Finite Impulse Response (FIR):

Infinite Impulse Response (IIR):

It is evident from these equations that, for IIR filters, the impulse impulse response is of infinite duration whereas for FIR it is of finite duration.

Framework of Digital Filters


Types of Digital Filters
In practice, it is not feasible to compute the output of the IIR filter using

because the length of its impulse response is too long (infinite in theory). Instead, the IIR filtering equation is expressed in a recursive form:

where the ak and bk are the coefficients of the filter.

Framework of Digital Filters


Types of Digital Filters The difference equations are thus: Finite Impulse Response (FIR)

Infinite Impulse Response (IIR)

These equations, and in particular the values of h(k), for FIR, or ak and bk, for IIR, are often very important objectives of most filter de design sign problems.

Framework of Digital Filters


Types of Digital Filters Looking at the IIR equation,

it is noted that the current output sample, y(n), is a function of past outputs as well as present and past input samples.
i.e. the IIR is a feedback system of some sort.

This should be compared with the FIR equation,

in which the current output sample, y(n), is a function only of past and present values of the input. Note, however, that when the bk are set to zero, the IIR equation reduces to the FIR equation.

Framework of Digital Filters


Types of Digital Filters
Alternate representations for the filters are shown below: Finite Impulse Response (FIR)

Infinite Impulse Response (IIR)

The transfer functions, H(z), for these filters, are very useful in evaluating their frequency responses.

Digital Filters
Choosing btw. FIR and IIR Filters
The choice between FIR and IIR depends largely on the relative advantages of the 2 filter types: FIR:
FIR filters can have linear phase response FIR filters can be realized nonnon-recursively Finite wordlength effects far less severe in FIR filters

IIR:
FIR filters require more coefficients than IIR filters to realize realize sharp cutoffs Easy to create IIR filters from equivalent analogue filters FIR filters algebraically more difficult to synthesize

Thus: Use IIRs when only important requirements are sharp cutoffs Use FIRs if the number of coefficients is not too large and little or no phase distortion is required

Framework of Digital Filters


Filter Design
The design of a digital filter involves 5 steps:
1. 2. 3. 4. 5.

Specification of the filter requirements Calculation of suitable filter coefficients Representation of the filter by a suitable structure (Realisation) (Realisation) Analysis of the effects of finite wordlength on filter performance performance Implementation of a filter in SW and/ or HW

The 5 steps are not necessarily independent; nor are they always performed in the order given.

Filter Design
1. Specification of the filter requirements Requirement specifications include specifying:
1.1. 1.2. 1.3. 1.4. Signal characteristics Characteristics of the filter Manner of implementation Other design constraints

Filter Design
1. Specification of the filter requirements
1.1. Signal characteristics

Include:
Types of signal source and sink Input/ Output interface Data rates and width Highest frequency of interest

Filter Design
1. Specification of the filter requirements
1.2. characteristics of the filter

Include:
Desired amplitude, phase and tolerances Speed of operation Modes of filtering (Real time or batch)

The characteristics of digital filters are often specified in the the frequency domain.

Filter Design
1. Specification of the filter requirements
1.2. characteristics of the filter For frequency selective filters, such as LP and BP filters, the specifications are often in the form of tolerance schemes. The following figure depicts a scheme for a LPF

The shaded horizontal lines indicate the tolerance limits. To be discussed in more detail later on during FIR filter design

Filter Design
1. Specification of the filter requirements
1.3. Manner of implementation

Include:
High level language routine in a computer, or DSPDSP-based system Choice of signal processor

Filter Design
1. Specification of the filter requirements
1.4. Other design constraints

Include:
Cost Size

Framework of Digital Filters


Filter Design
The design of a digital filter involves 5 steps:
2.

Specification of the filter requirements Calculation of suitable filter coefficients

Filter Design
2. Calculation of suitable filter coefficients and nd In this step we select one of a number of approximation method a calculate the values of the coefficients. For FIR we obtain h(k) using:
Window method Frequency sampling method Optimal method

For IIR we obtain ak and bk using:


Impulse invariant method BZT (Bilinear transformation) method PolePole-zero placement method

Framework of Digital Filters


Filter Design
The design of a digital filter involves 5 steps:
Specification of the filter requirements Calculation of suitable filter coefficients Representation of the filter by a suitable structure (Realisation) (Realisation)

3.

Filter Design
3. Representation of the filter by a suitable structure (Realisation) Realistion involves converting a given transfer function, H(z), into a suitable filter structure. Block or flow diagrams are often used to depict filter structures and they show the computational procedure for implementing the digital filter. The structure used depends whether the filter is FIR or IIR.

Filter Design
3. Representation of the filter by a suitable structure (Realisation) For FIR the following realisation structures are used:
Transversal (Direct) Frequency Sampling Fast Convolution Lattice

For IIR the following realisation structures are used:


Direct Form Cascade Parallel Lattice

Filter Design
3. Representation of the filter by a suitable structure (Realisation) Transversal (Direct) realisation (FIR):

Filter Design
3. Representation of the filter by a suitable structure (Realisation) Frequency Sampling (FIR):

Filter Design
3. Representation of the filter by a suitable structure (Realisation) Basic lattice structure (IIR or FIR):

Filter Design
3. Representation of the filter by a suitable structure (Realisation) FIR realisation structures:
Transversal (Direct) Frequency Sampling Fast Convolution Lattice

From the above:


The Direct form is the most widely used structure for FIR because because of its simplicity. efficient nt as it Frequency sampling structure can be computationally more efficie leads to fewer coefficients, but not easy to implement and would require more storage. Fast convolution has the computational advantage of the FFT and favourable where the power spectrum of the signal is also required required. ed

Filter Design
3. Representation of the filter by a suitable structure (Realisation) Direct realisation (IIR):

Filter Design
3. Representation of the filter by a suitable structure (Realisation) Cascade realisation (IIR):

Filter Design
3. Representation of the filter by a suitable structure (Realisation) Parallel realisation (IIR):

Filter Design
3. Representation of the filter by a suitable structure (Realisation) IIR realisation structures:
Direct Form Cascade Parallel Lattice

From the above:


The Direct form is simply a straight forward representation of the the IIR transfer function. Cascade and Parallel structures are most widely used for IIR because: because:
Simpler filtering algorithms Far less sensitive with regards to a finite number of bits, as opposed opposed to direct form.

Filter Design
3. Representation of the filter by a suitable structure (Realisation) Conclusion All structures for implementing a given filter would perform identically under infiniteinfinite-precision arithmetic, but produce different
quantisation noise, coefficient quantisation effects, and limit cycles

when implemented in finitefinite-precision.

Framework of Digital Filters


Filter Design
The design of a digital filter involves 5 steps:

4.

Specification of the filter requirements Calculation of suitable filter coefficients Representation of the filter by a suitable structure (Realisation) (Realisation) Analysis of the effects of finite wordlength on filter performance performance

Filter Design
4. Analysis of the effects of finite on filter performance wordlength

The approximation and realisation steps assume infinite or very high precision. In actual implementation it is often necessary to represent the filter coefficients using a limited number of bits. The effects of using a finite number of bits are to degrade the performance of the filter and in some cases make it unusable. The designer must analyse these affects and choose suitable wordlengths wordlengths for the:
coefficients, filter variables, and arithmetic operations within the filter

Filter Design
4. Analysis of the effects of finite on filter performance wordlength

are re as The main sources of performance degradation in digital filters a follows: Input/output quantisation
ADC noise

Coefficient quantisation
Deviation in frequency response

Arithmetic roundround-off errors


Finite precision arithmetic

Overflow
Results when addition exceeds permissible wordlength

Framework of Digital Filters


Filter Design
The design of a digital filter involves 5 steps:
Specification of the filter requirements Calculation of suitable filter coefficients Representation of the filter by a suitable structure (Realisation) (Realisation) Analysis of the effects of finite wordlength on filter performance performance Implementation of a filter in SW and/ or HW

5.

Filter Design
5. Implementation of a filter (SW and/ or HW) Having calculated the filter coefficients, chosen a suitable structure, verified the filter degradation (wordlength effects) the difference equation must be implemented as a software routine routine or in hardware.

Filter Design
5. Implementation of a filter (SW and/ or HW) To implement a filter the following building blocks are required: required:
Memory (ROM) for storing filter coefficients Memory (RAM) for storing present and past inputs and outputs. Hardware and software multipliers Adder or ALU

Filter Design
5. Implementation of a filter (SW and/ or HW) These components are configured depending on whether
Batch (non(non-real time), or RealReal-time

processing is required.

Filter Design
5. Implementation of a filter (SW and/ or HW) Batch processing may be described as a purely software implementation implementation
Although the designer may wish to incorporate additional hardware hardware to increase the speed of processing.

Filter Design
5. Implementation of a filter (SW and/ or HW) For RealReal-time processing, the filter is required either
to operate on the present input sample, x(n), to produce the current output sample, y(n), before the next input sample arrives (i.e. within the interinter-sample period), or to operate on an input block of data, using an FFT algorithm for example, to produce an output block of data within a period proportional to the block length.

RealReal-time filtering may require fast and dedicated hardware if the sample rate is very high or if the filter is of a high order.

Filter Design
5. Implementation of a filter (SW and/ or HW) Finally
In addition to the signal processing hardware, the designer must also provide suitable inputinput-output interfaces to the digital hardware, depending on the type of data source and sink. E.g. Analogue to digital conversion

Вам также может понравиться