1 Introduction to Digital Filters Filter: A filter is essentially a system or network that selectively changes the wave shape, amplitude/frequency and/or.

Slides:



Advertisements
Similar presentations
Design of Digital IIR Filter
Advertisements

Chapter 8. FIR Filter Design
Digital Signal Processing IIR Filter IIR Filter Design by Approximation of Derivatives Analogue filters having rational transfer function H(s) can be.
Nonrecursive Digital Filters
EE513 Audio Signals and Systems Digital Signal Processing (Synthesis) Kevin D. Donohue Electrical and Computer Engineering University of Kentucky.
FILTERS Presented by: Mohammed Alani Supervised By: Dr. Nazila Safavi
Signal and System IIR Filter Filbert H. Juwono
Hossein Sameti Department of Computer Engineering Sharif University of Technology.
Filtering Filtering is one of the most widely used complex signal processing operations The system implementing this operation is called a filter A filter.
So far We have introduced the Z transform
Digital Signal Processing – Chapter 11 Introduction to the Design of Discrete Filters Prof. Yasser Mostafa Kadah
Unit 9 IIR Filter Design 1. Introduction The ideal filter Constant gain of at least unity in the pass band Constant gain of zero in the stop band The.
Ideal Filters One of the reasons why we design a filter is to remove disturbances Filter SIGNAL NOISE We discriminate between signal and noise in terms.
LINEAR-PHASE FIR FILTERS DESIGN
Chapter 8 FIR Filter Design
AGC DSP AGC DSP Professor A G Constantinides 1 Digital Filter Specifications Only the magnitude approximation problem Four basic types of ideal filters.
EEE422 Signals and Systems Laboratory Filters (FIR) Kevin D. Donohue Electrical and Computer Engineering University of Kentucky.
Network Analysis and Synthesis
Relationship between Magnitude and Phase (cf. Oppenheim, 1999)
Dan Ellis 1 ELEN E4810: Digital Signal Processing Topic 6: Filters - Introduction 1.Simple Filters 2.Ideal Filters 3.Linear Phase and FIR filter.
Finite Impuse Response Filters. Filters A filter is a system that processes a signal in some desired fashion. –A continuous-time signal or continuous.
Digital Signals and Systems
Unit III FIR Filter Design
1 Lecture 2: February 27, 2007 Topics: 2. Linear Phase FIR Digital Filter. Introduction 3. Linear-Phase FIR Digital Filter Design: Window (Windowing)
Practical Signal Processing Concepts and Algorithms using MATLAB
DSP. What is DSP? DSP: Digital Signal Processing---Using a digital process (e.g., a program running on a microprocessor) to modify a digital representation.
1 Diagramas de bloco e grafos de fluxo de sinal Estruturas de filtros IIR Projeto de filtro FIR Filtros Digitais.
1 Lecture 5: March 20, 2007 Topics: 1. Design of Equiripple Linear-Phase FIR Digital Filters (cont.) 2. Comparison of Design Methods for Linear- Phase.
Chapter 7 IIR Filter Design
Nov'04CS3291: Section 41 University of Manchester Department of Computer Science CS3291 Digital Signal Processing '04-'05 Section 4: ‘A design technique.
EE Audio Signals and Systems Digital Signal Processing (Synthesis) Kevin D. Donohue Electrical and Computer Engineering University of Kentucky.
IIR Filter design (cf. Shenoi, 2006) The transfer function of the IIR filter is given by Its frequency responses are (where w is the normalized frequency.
Copyright © 2001, S. K. Mitra Digital Filter Structures The convolution sum description of an LTI discrete-time system be used, can in principle, to implement.
1 Lecture 3: March 6, 2007 Topic: 1. Frequency-Sampling Methods (Part I)
Chapter 7 Finite Impulse Response(FIR) Filter Design
Chapter 9-10 Digital Filter Design. Objective - Determination of a realizable transfer function G(z) approximating a given frequency response specification.
1 Conditions for Distortionless Transmission Transmission is said to be distortion less if the input and output have identical wave shapes within a multiplicative.
Technological Educational Institute Of Crete Department Of Applied Informatics and Multimedia Neural Networks Laboratory Slide 1 FOURIER TRANSFORMATION.
Chapter 7. Filter Design Techniques
1 Digital Signal Processing Digital Signal Processing  IIR digital filter structures  Filter design.
1 Lecture 4: March 13, 2007 Topic: 1. Uniform Frequency-Sampling Methods (cont.)
Digital Signal Processing
Chapter 4 LTI Discrete-Time Systems in the Transform Domain
Summary of Widowed Fourier Series Method for Calculating FIR Filter Coefficients Step 1: Specify ‘ideal’ or desired frequency response of filter Step 2:
Z Transform The z-transform of a digital signal x[n] is defined as:
Nov '03csDSP61 CS3291: Section 6 IIR discrete time filter design Introduction: Many design techniques for IIR discrete time filters have adopted ideas.
The IIR FILTERs These are highly sensitive to coefficients,
Chapter 6 Discrete-Time System. 2/90  Operation of discrete time system 1. Discrete time system where and are multiplier D is delay element Fig. 6-1.
DISP 2003 Lecture 5 – Part 1 Digital Filters 1 Frequency Response Difference Equations FIR versus IIR FIR Filters Properties and Design Philippe Baudrenghien,
Digital Signal Processing Lecture 6 Frequency Selective Filters
What is filter ? A filter is a circuit that passes certain frequencies and rejects all others. The passband is the range of frequencies allowed through.
Lecture 09b Finite Impulse Response (FIR) Filters
Finite Impulse Response Filtering EMU-E&E Engineering Erhan A. Ince Dec 2015.
Finite Impuse Response Filters. Filters A filter is a system that processes a signal in some desired fashion. –A continuous-time signal or continuous.
In summary If x[n] is a finite-length sequence (n  0 only when |n|
Professor A G Constantinides 1 Digital Filter Specifications We discuss in this course only the magnitude approximation problem There are four basic types.
Digital Signal Processing
IIR Filter design (cf. Shenoi, 2006)
Lattice Struture.
EEE422 Signals and Systems Laboratory
Fourier Series FIR About Digital Filter Design
Chapter 8 Design of Infinite Impulse Response (IIR) Digital Filter
LINEAR-PHASE FIR FILTERS DESIGN
Filter Design by Windowing
Lect5 A framework for digital filter design
Ideal Filters One of the reasons why we design a filter is to remove disturbances Filter SIGNAL NOISE We discriminate between signal and noise in terms.
Chapter 6 Discrete-Time System
Chapter 7 Finite Impulse Response(FIR) Filter Design
Tania Stathaki 811b LTI Discrete-Time Systems in Transform Domain Ideal Filters Zero Phase Transfer Functions Linear Phase Transfer.
Chapter 7 Finite Impulse Response(FIR) Filter Design
Presentation transcript:

1 Introduction to Digital Filters Filter: A filter is essentially a system or network that selectively changes the wave shape, amplitude/frequency and/or phase/frequency characteristics of a system in a desired manner. Filter: A filter is essentially a system or network that selectively changes the wave shape, amplitude/frequency and/or phase/frequency characteristics of a system in a desired manner. Common filtering objectives: Common filtering objectives:  to improve the quality of a signal  to extract information from a signal  to separate two or more signals previously combined.

2 Digital Filter: 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. A simplified block diagram of a real time digital filter is shown below: x(t) Input filter ADC with sample & hold Digital processor DAC output filter

3 Advantages of Digital Filters: Digital filters can have characteristics which are not possible with analogue filters, such as a truly linear response. Digital filters can have characteristics which are not possible with analogue filters, such as a truly linear response. Unlike analog filters, the performance of digital filters does not vary with environmental changes. This eliminates the need to calibrate periodically. Unlike analog filters, the performance of digital filters does not vary with environmental changes. This eliminates the need to calibrate periodically. The frequency response of a digital filter can be automatically adjusted if it is implemented using a programmable processor, which is why they are widely used in adaptive filters. The frequency response of a digital filter can be automatically adjusted if it is implemented using a programmable processor, which is why they are widely used in adaptive filters. Several input signals or channels can be filtered by one digital filter without the need to replicate the hardware. Several input signals or channels can be filtered by one digital filter without the need to replicate the hardware. Both filtered and unfiltered data can be saved for further use. Both filtered and unfiltered data can be saved for further use.

4 Advantages of Digital Filters: Advantages can be readily taken of the tremendous advancements in VLSI technology to fabricate digital filters and to make them small in size, to consume low power, and to keep the cost down. Advantages can be readily taken of the tremendous advancements in VLSI technology to fabricate digital filters and to make them small in size, to consume low power, and to keep the cost down. In practice the precision achievable with analog filters is restricted. With digital filters precision is limited only by the wordlength used. In practice the precision achievable with analog filters is restricted. With digital filters precision is limited only by the wordlength used. The performance of digital filters is repeatable from unit to unit. The performance of digital filters is repeatable from unit to unit. Digital filters can be used at very low frequencies. Also, digital filters can be made to work over a wide range of frequencies by a mere change to the sampling frequency. Digital filters can be used at very low frequencies. Also, digital filters can be made to work over a wide range of frequencies by a mere change to the sampling frequency.

5 Disadvantages of Digital Filters Speed Limitation: The maximum bandwidth of signals that digital filter can handle, in real time, is much lower than for analog filters. In real time situations, the analog- digital-analog conversion processes introduce a speed constraint on the digital filter performance. The conversion time of the ADC and the settling time of the DAC limit the highest frequency that can be processed. Further, the speed of operation of a digital filter depends on the speed of the digital processor used and on number of arithmatic operations that must be performed for the filtering algorithm, which increases as the filter response is made tighter. Speed Limitation: The maximum bandwidth of signals that digital filter can handle, in real time, is much lower than for analog filters. In real time situations, the analog- digital-analog conversion processes introduce a speed constraint on the digital filter performance. The conversion time of the ADC and the settling time of the DAC limit the highest frequency that can be processed. Further, the speed of operation of a digital filter depends on the speed of the digital processor used and on number of arithmatic operations that must be performed for the filtering algorithm, which increases as the filter response is made tighter. Finite Wordlength Effects: Digital filters are subject to ADC noise resulting from quantizing a continuous signal, and to roundoff noise incurred during computation. With higher order recursive filters, the accumulation of roundoff noise could lead to instability. Finite Wordlength Effects: Digital filters are subject to ADC noise resulting from quantizing a continuous signal, and to roundoff noise incurred during computation. With higher order recursive filters, the accumulation of roundoff noise could lead to instability.

6 Disadvantages of Digital Filters Long Design and Development Times: The design and development times for digital filters, especially hardware development, can be much longer than for analog filters. However, once developed the hardware and/or software can be used for other filtering or DSP tasks with little or no modifications. Long Design and Development Times: The design and development times for digital filters, especially hardware development, can be much longer than for analog filters. However, once developed the hardware and/or software can be used for other filtering or DSP tasks with little or no modifications.

7 Filter Design Steps: Specification of the filter requirements. Specification of the filter requirements. Calculation of suitable filter coefficients. Calculation of suitable filter coefficients. Representation of the filter by a suitable structure (realization). Representation of the filter by a suitable structure (realization). Analysis of the effects of finite wordlength on filter performance. Analysis of the effects of finite wordlength on filter performance. Implementation of filter in software and/or hardware. Implementation of filter in software and/or hardware.

8 Types of digital filters: FIR and IIR filters FIR filters FIR filters IIR filters IIR filters

9 Finite Impulse Response (FIR) Filters Definition: These filters are represented by the following equation: The corresponding transfer function of the filter is given by where h[i] are impulse response coefficients, y[n] is output and x[n] is input of the filter. Alternative Names: Non-recursive filters, All-zero filters. Reason for the name Finite Impulse Response filter: the unit impulse response consists of a finite number (M+1) of terms, i.e. its duration in real time is finite. (M+1) is called the filter Length. (1) (2)

10 Designing Frequency-Selective FIR Filters Ideally we wish to realize a “brick-wall” magnitude response and a linear phase response. In practice we can realize a reasonable approximation to this magnitude response, together with a linear phase response. The design problem may be stated thus: Given an ideal/desired frequency response F d (jw), decide on a filter length and decide on a filter coefficients which will give an actual response F(jw) approximating to F d (jw) to within a given specification in magnitude and phase.

11 Digital Filters: A digital filter can be represented by the following equation: y n = b 0 x n + b 1 x n-1 + …. + b M x n-M + a 1 y n-1 + … + a P y n-P (4) This equation This equation  Mathematically describes a digital filter  Can be directly implemented in a computer, real time processor, or special purpose hardware to do the actual filtering. Design Issues: Determination of the filter coefficients. Software / hardware implementation of the filter.

12 Finite Impulse Response (FIR) Filters Definition: These filters have all the a coefficients zero in equation (4): y n = b 0 x n + b 1 x n-1 + …… + b M x n-M Alternative Names: Non-recursive filters, All- zero filters. Reason for the name Finite Impulse Response filter: the unit impulse response consists of a finite number (M+1) of terms, i.e. its duration in real time is finite. (M+1) is called the filter Length.

13 Designing Frequency-Selective FIR Filters Ideally we wish to realize a “brick-wall” magnitude response and a linear phase response. In practice we can realize a reasonable approximation to this magnitude response, together with a linear phase response. The design problem may be stated thus: Given an ideal/desired frequency response F d (jw), decide on a filter length and decide on a filter coefficients which will give an actual response F(jw) approximating to F d (jw) to within a given specification in magnitude and phase.

14 Design of FIR filter using Fourier Methods Transform Pair: (5) (6) To illustrate the method, we try to obtain a design for the ideal low-pass, zero delay filter H d (w) = 1  0 0, -w c < w < w c (7) = 0, |w| > w c where w c is the cutoff frequency. On substituting this into (6) we get (8)

15 which evaluates to (9) n = -  … . A filter with the impulse response (8) would realize the ideal specification (7) exactly, However, (a)This impulse response is infinite in length i.e. the filter would require an infinite number of coefficients. Solution: Truncate to a finite number of coefficients. The response will now be an approximation to the ideal. (b) This impulse response is double-sided as shown in the fig on the next slide.If we truncate the series symmetrically, it will have terms for negative k and the filter will be non-causal i.e. will require foreknowledge. It will not be realizable in real time.

17 Solution: Shift the impulse response by N sampling intervals in time, where N = M/2. On denoting the shifted response by h[n], this gives h[n] = h d (n-N) (10) and now we have a standard finite length causal filter. This will have the effect of delaying the response by N sampling intervals. Instead of the zero delay filter of (7), we will have a constant delay filter with delay time . This is equivalent to a linear phase filter, the phase being given by  = 2  f  radians. On taking account of the truncation and the shift, (8) becomes (11)

18 Shifting of impulse response

19 The effect of truncation: The effect is to introduce Gibbs Oscillations into the frequency response. Reducing the effects of truncation: Increasing the filter length has relatively little effect. A better method is to window the impulse response: each term h[n] is multiplied by the corresponding term w[n] in a window: h w [n] = h[n]w[n] (12) h w [n] = h[n]w[n] (12) Many windows have been proposed. Some of these are described below:

20 Rectangular Window: The rectangular window is defined as The filter coefficients b[n] = h[n] can now be computed as Example 1: Design a low-pass FIR filter with cut-off frequency at 200 Hz relative to a Nyquist frequency of 1KHz. Use the rectangular window to truncate the impulse response. The length of the filter is 21. (13) (14)

21 Solution: The normalized cut-off frequency is w c = 2  f c /f s = 2  (200/(1000) = 0.4  h[0] = = h[20] h[1] = = h[19] h[2] = = h[18] h[3] = = h[17] h[4] = = h[16] h[5] = = h[15] h[6] = = h[14] h[7] = = h[13] h[8] = = h[12] h[9] = = h[11] h[10]= Frequency (Hz) Amplitude gain where M = 20

22 Hamming Window The Hamming window is defined as M The filter coefficients can be found as follows: h[n] = h d [n – N]  w[n] (15) (16)

23 Example 2: Repeat example 1 for a Hamming window. The filter coefficients can be computed by using equation (16) as: h[0] = = h[20] The magnitude response h[0] = = h[20] The magnitude response h[1] = = h[19] of the filter and its h[1] = = h[19] of the filter and its h[2] = = h[18] comparison with h[2] = = h[18] comparison with h[3] = = h[17] the magnitude response h[3] = = h[17] the magnitude response h[4] = = h[16] of the filter with h[4] = = h[16] of the filter with h[5] = = h[15] rectangular window is h[5] = = h[15] rectangular window is h[6] = = h[14] given in the figure on h[6] = = h[14] given in the figure on h[7] = = h[13] the next slide. h[7] = = h[13] the next slide. h[8] = = h[12] h[8] = = h[12] h[9] = = h[11] h[9] = = h[11] h[10]= h[10]=

Frequency (Hz) Amplitude gain Hamming window Rectangular window Hamming window is better than rectangular window.

25 Hann Window The Hann Window is defined as The Hann Window is defined as 0M Yellow = Hamming Red = Hann window (17)

26 Example 3: Repeat Example 1 with the Hann Window Solution: The coefficients of the filter in this case can be computed as follows: (18) The coefficients are: h[0] = = h[20] h[1] = = h[19] h[2] = = h[18] h[3] = = h[17] h[4] = = h[16] h[5] = = h[15] h[6] = = h[14] h[7] = = h[13] h[8] = = h[12] h[9] = = h[11] h[10] =

Frequency (Hz) Amplitude gain 1 Hamming and Hann window Rectangular window

28 Kaiser Window The windows studied so far are very simple, but do not provide good control over the filter design specifications. Kaiser window is a highly suitable for achieving the required pass-band and/or stop-band ripple, along with the cut-off requirements. Consider the following figure. 1-  1 Passband ripple wpwp wsws 22 1+  1 w c Ideal response

29 The passband/stopband frequencies {w p, w s } are related to the ideal cutoff frequency w c and transition width  w by w c = ½ (w p + w s ),  w = w s – w p (19) w c = ½ (w p + w s ),  w = w s – w p (19) The passband and stopband overshoots {A p, A s } are expressed in dB as, (20) Equation (20) can be inverted to give: (21) Although  1 and  2 can be specified independently of each Other, it is a property of all windows designs that the final designed filter will have equal pass-band and stop-band ripples.

30 Therefore, we must design the filter on the basis of the smaller of the two ripples, that is,  = min(  1,  2 ) (22) = min(  1,  2 ) (22) The Kaiser window is mathematically represented as The Kaiser window is mathematically represented as (23) where I 0 (x) is the modified Bessel function of the first kind And 0 th order. The parameter  can be computed as follows: (24)

31 The filter length can be obtained as (25) (26) where f s is the sampling frequency in Hz,  f is the transition Width in Hz and The shape of the Kaiser window for M = 51 &  = 7 is given below:

32 Example 4: Using Kaiser Window, design a low- pass digital filter with the following specifications: Sampling frequency = 20 KHz pass-band frequency = 4 KHz Stop-band frequency = 5 KHz A p = 0.1 dB, A s = 80 dB Solution: and Therefore,  = min(  1,  2 ), which in db is A = -20log 10  = A s = 80.  = (A-8.7) = 7.857, D = (A-7.95)/14.36 = The transition width =  f = f s – f p = 5 – 4 = 1KHz f c = ½ (f s + f p ) = 4.5 KHz, w c = (2  f c /f s ) = 0.45 . M– 1 = Df s /  f  M = 103  (M-1)/2 = 102/2 = 51

33 The windowed impulse response will be (27)

34 Generalized FIR Digital Filter Design: The windows described above can easily be used to design a High-pass and other frequency selective filters FIR filter. Following are the main steps: Define an ideal magnitude response function. Define an ideal magnitude response function. Obtain the ideal (infinite) impulse response sequence h d [n]by evaluating the Fourier inverse transform of the magnitude response of step1. Obtain the ideal (infinite) impulse response sequence h d [n]by evaluating the Fourier inverse transform of the magnitude response of step1. Use appropriate delay factor and window to compute the coefficients of the filter. Use appropriate delay factor and window to compute the coefficients of the filter.

35 High Pass Filter: The magnitude response of a normalized ideal high-pass filter is given by (28) By evaluating the inverse Fourier Transform, we obtain the ideal impulse response sequence (29) Tutorial Q1: Derive equation (29) from equation (28). Example 5: Design a high-pass filter with a cutoff frequency of 2.5 KHz and a sample interval of s; The length of the filter is 21 and the rectangular window is used to truncate the ideal impulse response function.

36 Solution: The normalized cutoff frequency is w c = 2500  = 0.25 w c = 2500  = 0.25 The filter coefficients can be found from equation (29) with M = 20. These coefficients are given below: h[0] = = h[20] H[1] = = h[19] The magnitude response is as shown below: H[2] = = h[18] h[3] = = h[17] h[4] = = h[16] h[4] = = h[16] H[5] = = h[15] H[6] = = h[14] H[7] = = h[13] H[8] = = h[12] H[9] = = h[11] H[10]= Frequency (kHz) Amplitude

37 Band-Pass Filter: The magnitude of an ideal constant delay band-pass filter is given by (30) where w L and w H are the low and high edges of the pass-band and M/2 is the delay. When H d (w) of (30) is inverse transformed, we find that the Band-pass impulse response is given by (31) Tutorial Q2: Derive equation (31) from (30)

38 Example 6:Design a Band-Pass Digital FIR filter of length 21. The band edges are specified to be at 1.5 and 3.5 kHz and the sampling interval is s. Use the Hamming window. Solution: The normalized cutoff frequencies are.15 and The filter coefficients are obtained by multiplying (31) and (15) and are given below: h[0] = = h[20] h[8] = = h[12] h[0] = = h[20] h[8] = = h[12] h[1] = = h[19] h[9] = = h[11] h[1] = = h[19] h[9] = = h[11] h[2] = = h[18] h[10] = h[3] = = h[17] h[4] = = h[16] h[4] = = h[16] h[5] = =h[15] h[6] = =h[14] H[7] = = h[13] The magnitude response of the Designed filter is shown overleaf

Frequency (kHz) Amplitude

40 Band-Stop Filter: The ideal frequency response of a Band-Stop filter is given by where w L and w H now specify the low and high edges of the stop-band. Taking the inverse Fourier transform of (32) yileds (32) (33) Example 7: Design a band-stop filter with edges frequencies At 1.5 and 3.5 kHz relative to a sample interval of Use Hann window. Length of the filter is 21. Solution: the normalized frequencies are 0.15 and.35. The Filter coefficients can be obtained by multiplying (33) and (17) and are given by

The magnitude response is as under: Amplitude