Download - Semester7 f13 lecture11

Transcript

Filters• Filters are a particularly important class Lof TI systems.

• A filter is a system that passes certain frequency components and totally rejects all others.

• In broader context any system that modifies certain frequencies relative to others is called a filter.

• Analog filters perform filtering on continuous-time signals and yield continuous-time signals.

• Digital filters perform filtering on discrete-time signals and yield discrete-time signal

Filters

• Examples of filtering: • Noise suppression: Received radio signals. Signals received by imaging sensors, such as television cameras or infrared imaging devices.

Electrical signals measured from the human body (such as brain, heart or neurological signals).

Filters• Enhancement of selected frequency range: Treble and bass control or graphic equalizers in audio systems.

Enhancement of edges in image processing.• Bandwidth limiting:Bandwidth limiting as a means of preventing aliasing in sampling.

Application in FDMA communication systems (Frequency Division Multiple Access - FDMA).

Filters• Enhancement of selected frequency range: Treble and bass control or graphic equalizers in audio systems.

Enhancement of edges in image processing.• Bandwidth limiting: Bandwidth limiting as a means of aliasing prevention in sampling.

Application in FDMA communication systems (Frequency Division Multiple Access - FDMA).

• Removal or attenuation of special frequencies: Blocking of the DC component of a signal. Attenuation of interference from power line (50 Hz).4 Dr. B. Khan CECOS University

Ideal Discrete-time Filter characteristics

• Low-pass filter:

Ideal magnitude frequency response

0

jHe

1

0

bandstop),,(for 0band-pass ),,0(for 1)(

0

0

jeH

Ideal Discrete-time Filter characteristics

• High-pass filter:

bandpass),,(for 1band-stop ),,0(for 0)(

0

0

jeH

0

jHe

1

0

Ideal magnitude frequency response

Ideal Discrete-time Filter characteristics

• Band-pass filter: bandpass),(for 1

band-stop), (),0(for 0)(21

21

jeH

Ideal magnitude frequency response

1

jHe

2

1

0

Ideal Discrete-time Filter characteristics

• Band-stop filter: ),(for 0

), (),0(for 1)(21

21

bandstop

bandpasseH j

Ideal magnitude frequency response

2

jHe

1

1

0

Ideal Discrete-time Filter characteristics

• Multiple band filters: This type of filters generalizes the previous four types of filters in away that allows for different gains or attenuations in different frequency bands.

• A piecewise–constant multi-band filter is characterized by the following parameters:

• A division of the frequency range to a finite union of intervals; some of which are pass bands, some are stop bands, and the remaining can be transition bands.

Ideal Discrete-time Filter characteristics

• Multiple band filters: A desired gain and a permitted tolerance for each pass band and attenuation threshold for each stop-band

Possible ideal magnitude frequency response

1

jHe

2 3 4 5 6

1

0

Ideal Discrete-time Filter characteristics

• The phase response of an ideal filter is linear:

• The group delay of an ideal filter is constant

11 Dr. B. Khan CECOS University

0)( t

0)()( t

dd

Characteristics of practical frequency selective filters

Dr. B. Khan CECOS University12

• The characteristic of ideal frequency selective filters are not obtainable. However, they are not always desirable in practice.

• For example, in many filtering contexts, the signals to be separated do not always lie in totally disjoint frequency bands such as:

jX1 jX2

Characteristics of practical frequency selective filters

Dr. B. Khan CECOS University13

• In such cases, we may wish to trade off the fidelity with which the filter preserves one of these signals against the level to which the frequency components of the second signal are attenuated.

• In general, firstly a gradual transition from pass-band to stop-band is preferred when filtering the superposition of signals with overlapping spectra..

Characteristics of practical frequency selective filters

Dr. B. Khan CECOS University14

• Secondly, the step response of ideal low-pass filter asymptotically approaches to a constant equal to the value of the step. But, in the vicinity of the discontinuity it overshoots this value and exhibits ringing.

• Thirdly, the ideal low-pass filter is non-causal, and cannot be implemented in real-time.

• Fourthly, the ideal low-pass filter is not flexible and therefore its implementation is very costly.

Characteristics of practical frequency selective filters

Dr. B. Khan CECOS University15

• However, in many applications , a precise filter characteristics may not be required and simple non-ideal filter with specified characteristics may be enough. These specifications are:

• Flexibility in the pass-band and stop-band .

• Gradual transition between the pass-band and stop-band.

Frequency domain aspect of non-ideal Frequency Selective Filters

Dr. B. Khan CECOS University16

11

11

TransitionPassban

d Stopband2

0

jH

Pass-band ripple 12

Stop-band ripple

sp

Time-domain aspect of non-ideal Frequency Selective Filters

Dr. B. Khan CECOS University17

2

overshoot

Rise time rt st tSetling time

Filter Design• Filter design is process of designing a filter that satisfies a set of requirements, some of which are contradictory.

• The purpose is to find a realization that meets each of the requirements to a sufficient degree to make it useful.

• The filter design process is therefore an optimization problem where each requirement contributes with a term to an error function which should be minimized.

18 Dr. B. Khan CECOS University

Typical design requirements• The filter should have a specific frequency response, and a specific phase shift or group delay.

• The filter should have a specific impulse response.

• The filter should be causal and stable.• The filter should be localized.• The filter should be computationally simpler.

• The filter should be implemented in a particular hardware or software.19 Dr. B. Khan CECOS University

Typical design requirements• Typical examples of frequency response are:• A low-pass filter cuts unwanted high-frequency.

• A high-pass filter cuts any high-frequency. • A band-pass filter passes a limited range of frequencies.

• A band-stop filter passes frequencies above and below certain range. A very narrow band stop-filter is know as notch filter.

• A differentiator has amplitude response proportional to the frequency.

20 Dr. B. Khan CECOS University

Typical design requirements• A low-shelf filter passes all frequencies, but increases or reduces frequencies below the shelf frequency by specified amount.

• A high-shelf filter passes all frequencies, but increases or reduces frequencies above the shelf frequency by specified amount.

• A peak EQ filter makes a peak or dip in the frequency response, commonly used In parametric equalizer.21 Dr. B. Khan CECOS University

Typical design requirements• Typical examples of phase and group delay :• A Hilbert transformer is a complex band-pass that rejects non-causal signals, and rotates the phase by ±90◦ .

• An all-pass filter passes through all frequencies unchanged, but changes the phase of the signal. This type of filter is used in phaser effects, and also to equalize the group delay of a recursive filter. A fraction delay filter is low pass filter and Lagrange interpolator that has a constant group delay.

22 Dr. B. Khan CECOS University

Typical design requirements• There is direct correspondence between the impulse response and frequency response: the later is the Fourier transform of the former. This means that any requirement on the frequency response is the requirement on impulse response.

• However, in certain applications it may be the filter’s impulse response that is explicit and the design process is then aims at producing as close an approximation as possible to the desired impulse response.23 Dr. B. Khan CECOS University

Typical design requirements• In some cases it may even be relevant to consider a frequency and impulse response of the filter which are chosen independently from each other. For, example, we may want both a specific frequency function of the filter and the resulting filter have a small effective width in the signal domain as possible. The latter condition can be realized by considering a very narrow function as the wanted impulse response of the filter even though this function has no relation to the desired frequency function. The goal of the design process is then to realize a filter which tries to meet these contradictory design goals as much as possible.

24 Dr. B. Khan CECOS University

Typical design requirements• In order to be implementable any time-dependent filter (operating in real time) must be causal.

• If the resulting filter is not causal, it can be mad causal by introducing an appropriate time-shift (or delay).

• Care has to taken in introducing the time-shift if the system is a part a larger system.

• Filter that do not operate in real-time, for example image processing, can be non-causal.25 Dr. B. Khan CECOS University

Typical design requirements• Stability: A stable filter assures that every limited input signal produces a limited filter response. A filter which does not meet this requirement may in some situation prove useless, or even harmful.

• Certain design approaches can guarantee stability, for example by using only feed-forward circuits such as an FIR filter

• Filters based on feed-back circuits have other advantages and may therefore be preferred, even if this class of filters include unstable filters.

• Such filters must be carefully designed in order to avoid instability.

26 Dr. B. Khan CECOS University

Typical design requirements• Locality: In certain applications we have to deal with signals which contain components which can be described as local phenomena, for example pulses or steps, which have certain time duration.

• In intuitive terms, the filter extends the duration of the local phenomena by the width of the filter. This means that it is sometimes important to keep the width of the filter’s impulse response function as short as possible.

27 Dr. B. Khan CECOS University

Typical design requirements• Computational complexity: There are several ways in which a filter can have different computational complexity. For example, the order of a filter is more or less proportional to the number of operations. Low-order filters are therefore computationally inexpensive.

• For digital filters the computational complexity is more or less proportional to the number of filter coefficients. For example, in multidimensional signals such as tomography data, it may be relevant to reduce the number of coefficients by removing those which are sufficiently small

28 Dr. B. Khan CECOS University

Typical design requirements• Another issue related to computational complexity is separabality, that is, if and how a filter can be written as convolution of two or more simpler filters.

• In particular, this issue is of particular importance for multidimensional filters, e.g., 2D filters in image processing.

• A significant reduction can be achieved if the filters are implemented as two- one dimensional filters(horizontal and vertical).

29 Dr. B. Khan CECOS University

Typical design requirements• Other considerations: It must be decided how the filter is going to be implemented such as:

• Analog filter• Analog sampled filter• Mechanical Filter• Digital filter: These filters are classified into basic forms: Finite Impulse Response (FIR) filters and Infinite Impulse Response (IIR) filters.30 Dr. B. Khan CECOS University

FIR filters• FIR filters express each output sample as weighted sum of the last N inputs, where N is the order of the filter.

• Since they do not use feedback, they are inherently stable.

• If the coefficients are symmetrical (the usual case) then such a filter is linear phase, so it delays signal of all frequency equally. It is also straight forward to avoid overflow in FIR filters.

• The main disadvantage of FIR filters is that they may require more processing and memory resources.31 Dr. B. Khan CECOS University

FIR filter specifications• Continuous-time and corresponding discrete-time filter specifications.

32 Dr. B. Khan CECOS University

Discrete-time filter frequency response

Specifications of discrete-time filter

33 Dr. B. Khan CECOS University

pass band ripple

stop band ripple

FIR filters• Filter specification parameters

pass-band edge frequencystop-band edge frequencypeak ripple value (absolute) in the pass-band

peak ripple value (absolute) in the stop-band

In pass-band34 Dr. B. Khan CECOS University

ps

p

sp 0 devaition with ,1)( jeH

ppj

p eH ,1)(1

FIR filters• Filter specification parameters In the stop-band with a deviation

Practical specifications are relative and are often given in terms of loss of function (in dB)

dB scale=

35 Dr. B. Khan CECOS University

0)( jeH s

ssjeH ,)(

0)(

)(log20 max

10

j

j

eHeH

FIR filters• Filter specification parameters

The pass-band ripple in dB:

The stop-band attenuation in dB:

36 Dr. B. Khan CECOS University

p

ppR

11log20 10

p

spA

1log20 10

FIR filters• Filter specification parameters

Or peak pass-band ripple in dB:

Minimum stop-band attenuation in dB:

37 Dr. B. Khan CECOS University

)1(log20 10 pp s

)(log20 10 ss

FIR filters• Digital Filter specification parameters

In practice

Minimum stop-band attenuation in dB:

38 Dr. B. Khan CECOS University

)1(log20 10 pp s

)(log20 10 ss

FIR filters• Filter specification parameters

Or peak pass-band ripple in dB:

Minimum stop-band attenuation in dB:

39 Dr. B. Khan CECOS University

)1(log20 10 pp s

)(log20 10 ss

FIR filters• Filter specification parameters

• In practice, pass-band edge frequency Fp and stop-band edge frequency Fs are the frequencies of analog or continuous-time signal and are specified in Hz.

• For digital filter design, normalized band-edge frequencies (frequencies of the discrete-time signal) need to be computed from specifications in Hz using sampling frequency Fsam frequency.

40 Dr. B. Khan CECOS University

FIR filters• Filter specification parameters

The relation between analog frequency F or Ω and discrete-time frequency f or ω is:

41 Dr. B. Khan CECOS University

samsam FFf

F

samssam

s

sam

ps TF

FF

F

22

sampsam

p

sam

pp TF

FF

F

22

42

56.01025)107(2

3

3

p

24.01025)103(2

3

3

s

Frequency Analysis of SystemDigital Signal Processing

55.3 .The Concept of Filtering

Example:

Let Fp = 7 kHz, Fs = 3 kHz, and FT = 25 kHz

Then

FIR Filters• An FIR digital filter is a non-recursive LTI system where the output only depends on the present and past inputs. In general, it is characterized by the difference equation of the form:

• The modeling equation is:where bk’s are called the coefficient of the filters also known as tap weights.

)](),...1(),([)( MnxnxnxFny

43 Dr. B. Khan CECOS University

)()(0

knxbnyM

kk

FIR Filters• The impulse response h(n) of a discrete-time FIR filter of order M lasts for M+1 samples, and then dies to zero.

• The impulse response can be calculated if set x(n) = δ(n):

• The impulse response becomes the set of coefficients bn where n = 0,1 2, … , M.

• The z-transform of h(n) is the system function H(z).

44 Dr. B. Khan CECOS University

n

M

kk bknbnh

)()(0

FIR Filter Design• Unlike, IIR filter design, the FIR filter design does not have any connection with the design of analog filter.

• The design of FIR digital filters is based on a direct approximation of the specified magnitude response, with the often added requirement that the phase response be linear.

• There are two direct approached to the design of FIR filter1. Windowed Fourier series approach2. The frequency sampling approach

45 Dr. B. Khan CECOS University

Design of FIR filters by windowing method

•Design ideas•Properties of commonly used windows

•Effects on frequency response

•Design steps

46 Dr. B. Khan CECOS University

Properties of commonly used windows• Rectangular widow:

• Bartlett (triangular)

otherMnnw

0,0,1][

otherMnM

Mn

Mn

Mn

nw

2

20

,0

22

,2

][

47 Dr. B. Khan CECOS University

Properties of commonly used windows

• Hanning widow:

• Hamming window

otherMn

Mn

nw

0,

0

2cos5.05.0][

otherMn

Mn

nw

0,

0

2cos46.054.0][

48 Dr. B. Khan CECOS University

Properties of commonly used windows

• Blackman window

• Qaiser window

otherMn

Mn

Mn

nw

0,

0

4cos08.02cos5.042.0][

other

Mn

I

MMnInw

0

0)(

)]2/)2[(1(][

0

21

20

49 Dr. B. Khan CECOS University

50 Dr. B. Khan CECOS University

51 Dr. B. Khan CECOS University

Windowing effects• We can view the truncation of the infinite impulse response of an ideal filter as windowing.

• In frequency domain, this operation is equivalent to convolution of a frequency response of the window function with the frequency response of an ideal filter.

• Truncation of the Fourier series produces the familiar Gibbs phenomenon.

Dr. B. Khan CECOS University52

Windowing effects

Dr. B. Khan CECOS University53

-1 -0.5 0 0.5 1-0.2

0

0.2

0.4

0.6

0.8

1

1.2

/

|Ht(

)||W ()||Hd(

)|

Windowing effects• Rectangular window and Bartett window

Dr. B. Khan CECOS University54

0 10 20 30 40 50 600

0.5

1

sequence (n)

T(n)

Rectangular window

0 10 20 30 40 50 600

0.5

1

sequence (n)

T(n)

Bartlett window

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1-100

-50

0

50

100

pi units

Frequency response T(jw)(dB)

Rectangular window

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1-100

-50

0

50

100

pi units

Frequency response T(jw)(dB)

Bartlett window

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1-100

-50

0

50

100

pi units

Frequency response T(jw)(dB)

Hanning window

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1-100

-50

0

50

100

pi units

Frequency response T(jw)(dB)

Ham m ing window

0 10 20 30 40 50 600

0.5

1

sequence (n)

T(n)

Hanning window

0 10 20 30 40 50 600

0.5

1

sequence (n)

T(n)

Ham m ing window

The effects of widowing• Hanning window and Hamming window

The effects of windowing

( / )s M

Window Peak sidelobe level (dB)

Transition bandwidth

Max. stop-band ripple(dB)

Rectangular -13 0.9 -21Hann -31 3.1 -44Hamming -41 3.3 -53Blackman -57 5.5 -74

The effects of widowing• Blackman & Qaiser windows

0 10 20 30 40 50 600

0.5

1

sequence (n)

T(n)

Blackm an window

0 10 20 30 40 50 600

0.5

1

sequence (n)

T(n)

Kaiser window

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1-100

-50

0

50

100

pi units

Frequency response T(jw)(dB)

Blackm an window

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1-150

-100

-50

0

50

100

pi units

Frequency response T(jw)(dB)

Kaiser window