Chapter 14 Finite Impulse Response (FIR) Filters.

Slides:



Advertisements
Similar presentations
Chapter 11 Interfacing C and Assembly Code
Advertisements

Chapter 14 Finite Impulse Response (FIR) Filters
Chapter 15 Infinite Impulse Response (IIR) Filters
Design of Digital IIR Filter
Chapter 8. FIR Filter Design
Digital Filter Banks The digital filter bank is set of bandpass filters with either a common input or a summed output An M-band analysis filter bank is.
Chapter 18 Discrete Cosine Transform. Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2004 Chapter 18, Slide 2 Learning Objectives  Introduction.
Chapter 16 Adaptive Filters
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
Chapter 15 Infinite Impulse Response (IIR) Filters.
Chapter 19 Fast Fourier Transform (FFT) (Theory and Implementation)
Chapter 11 Interfacing C and Assembly Code. Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2002 Chapter 11, Slide 2 Learning Objectives 
EE313 Linear Systems and Signals Fall 2010 Initial conversion of content to PowerPoint by Dr. Wade C. Schwartzkopf Prof. Brian L. Evans Dept. of Electrical.
Systems: Definition Filter
Lecture 9 FIR and IIR Filter design using Matlab
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)
0 - 1 © 2010 Texas Instruments Inc Practical Audio Experiments using the TMS320C5505 USB Stick “FIR Filters” Texas Instruments University Programme Teaching.
Nov'04CS3291: Section 41 University of Manchester Department of Computer Science CS3291 Digital Signal Processing '04-'05 Section 4: ‘A design technique.
Chapter 6 Digital Filter Structures
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.
Digital Signal Processing FIR Filter Design
1 Lecture 1: February 20, 2007 Topic: 1. Discrete-Time Signals and Systems.
Lecture 10a Infinite Impulse Response (IIR) Filters.
LIST OF EXPERIMENTS USING TMS320C5X Study of various addressing modes of DSP using simple programming examples Sampling of input signal and display Implementation.
Fundamentals of Digital Signal Processing. Fourier Transform of continuous time signals with t in sec and F in Hz (1/sec). Examples:
Chapter 7 Finite Impulse Response(FIR) Filter Design
1 Introduction to Digital Filters Filter: A filter is essentially a system or network that selectively changes the wave shape, amplitude/frequency and/or.
FIR Filter Design & Implementation
Copyright 2004 Ken Greenebaum Introduction to Interactive Sound Synthesis Lecture 20:Spectral Filtering Ken Greenebaum.
Digital filters Honza Černocký, ÚPGM. Aliases Numerical filters Discrete systems Discrete-time systems etc. 2.
Technological Educational Institute Of Crete Department Of Applied Informatics and Multimedia Neural Networks Laboratory Slide 1 FOURIER TRANSFORMATION.
Chapter 7. Filter Design Techniques
Digital Signal Processing
Summary of Widowed Fourier Series Method for Calculating FIR Filter Coefficients Step 1: Specify ‘ideal’ or desired frequency response of filter Step 2:
DEPARTMENTT OF ECE TECHNICAL QUIZ-1 AY Sub Code/Name: EC6502/Principles of digital Signal Processing Topic: Unit 1 & Unit 3 Sem/year: V/III.
Copyright ©2010, ©1999, ©1989 by Pearson Education, Inc. All rights reserved. Discrete-Time Signal Processing, Third Edition Alan V. Oppenheim Ronald W.
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,
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
EEE4176 Application of Digital Signal Processing
 What is Filter ? A Filter is an electrical network that can transmit signal within a specified frequency range. This Frequency range is called PASS BAND.
IIR Filter design (cf. Shenoi, 2006)
CEN352 Dr. Nassim Ammour King Saud University
EEE422 Signals and Systems Laboratory
Speech Signal Processing
Digital Signal Processing Lecture 4 DTFT
蔡宗珉 : Multi-stage Filter Implementation
ECET 350 Competitive Success/snaptutorial.com
ECET 350 Education for Service-- snaptutorial.com.
ECET 350 Teaching Effectively-- snaptutorial.com.
LINEAR-PHASE FIR FILTERS DESIGN
لجنة الهندسة الكهربائية
CT-321 Digital Signal Processing
Lect5 A framework for digital filter design
Everything You Ever Wanted to Know About Filters*
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.
UNIT V Linear Time Invariant Discrete-Time Systems
Lecture 16a FIR Filter Design via Windowing
Chapter 6 Discrete-Time System
Chapter 7 Finite Impulse Response(FIR) Filter Design
Signal Processing First
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
Chapter 15 Infinite Impulse Response (IIR) Filters
Presentation transcript:

Chapter 14 Finite Impulse Response (FIR) Filters

Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2002 Chapter 14, Slide 2 Learning Objectives  Introduction to the theory behind FIR filters:  Properties (including aliasing).  Coefficient calculation.  Structure selection.  Implementation in Matlab, C, assembly and linear assembly.

Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2002 Chapter 14, Slide 3Introduction  Amongst all the obvious advantages that digital filters offer, the FIR filter can guarantee linear phase characteristics.  Neither analogue or IIR filters can achieve this.  There are many commercially available software packages for filter design. However, without basic theoretical knowledge of the FIR filter, it will be difficult to use them.

Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2002 Chapter 14, Slide 4 Properties of an FIR Filter  Filter coefficients: x[n] represents the filter input, b k represents the filter coefficients, y[n] represents the filter output, N is the number of filter coefficients (order of the filter).

Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2002 Chapter 14, Slide 5 Properties of an FIR Filter  Filter coefficients: FIR equation Filter structure

Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2002 Chapter 14, Slide 6 Properties of an FIR Filter  Filter coefficients:  If the signal x[n] is replaced by an impulse  [n] then:

Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2002 Chapter 14, Slide 7 Properties of an FIR Filter  Filter coefficients:  If the signal x[n] is replaced by an impulse  [n] then:

Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2002 Chapter 14, Slide 8 Properties of an FIR Filter  Filter coefficients:  If the signal x[n] is replaced by an impulse  [n] then:

Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2002 Chapter 14, Slide 9 Properties of an FIR Filter  Filter coefficients:  Finally:

Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2002 Chapter 14, Slide 10 Properties of an FIR Filter  Filter coefficients: With:  The coefficients of a filter are the same as the impulse response samples of the filter.

Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2002 Chapter 14, Slide 11 Frequency Response of an FIR Filter  By taking the z-transform of h[n], H(z):  Replacing z by e -j  in order to find the frequency response leads to:

Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2002 Chapter 14, Slide 12 Frequency Response of an FIR Filter  Since e -j2  k = 1 then:  Therefore:  FIR filters have a periodic frequency response and the period is 2 .

Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2002 Chapter 14, Slide 13 Frequency Response of an FIR Filter  Frequency response: FIRy[n]x[n] F s /2 Freq Freq x[n]y[n]

Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2002 Chapter 14, Slide 14 Frequency Response of an FIR Filter  Solution: Use an anti-aliasing filter. FIRy[n] x[n] ADC Analogue Anti-Aliasing x(t) F s /2 Freq Freq x(t)y[n]

Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2002 Chapter 14, Slide 15 Phase Linearity of an FIR Filter  A causal FIR filter whose impulse response is symmetrical is guaranteed to have a linear phase response. Even symmetry Odd symmetry

Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2002 Chapter 14, Slide 16 Phase Linearity of an FIR Filter  A causal FIR filter whose impulse response is symmetrical (ie h[n] = h[N-1-n] for n = 0, 1, …, N-1) is guaranteed to have a linear phase response.

Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2002 Chapter 14, Slide 17 Phase Linearity of an FIR Filter  Application of 90° linear phase shift: Signal separation 90 o delay delay I Q Reverse Forward IH QH

Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2002 Chapter 14, Slide 18 Design Procedure  To fully design and implement a filter five steps are required: (1)Filter specification. (2)Coefficient calculation. (3)Structure selection. (4)Simulation (optional). (5)Implementation.

Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2002 Chapter 14, Slide 19 Filter Specification - Step 1

Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2002 Chapter 14, Slide 20 Coefficient Calculation - Step 2  There are several different methods available, the most popular are:  Window method.  Frequency sampling.  Parks-McClellan.  We will just consider the window method.

Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2002 Chapter 14, Slide 21 Window Method  First stage of this method is to calculate the coefficients of the ideal filter.  This is calculated as follows:

Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2002 Chapter 14, Slide 22 Window Method  Second stage of this method is to select a window function based on the passband or attenuation specifications, then determine the filter length based on the required width of the transition band. Using the Hamming Window:

Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2002 Chapter 14, Slide 23 Window Method  The third stage is to calculate the set of truncated or windowed impulse response coefficients, h[n]: for Where: for

Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2002 Chapter 14, Slide 24 Window Method  Matlab code for calculating coefficients: close all; clear all; fc = 8000/44100;% cut-off frequency N = 133;% number of taps n = -((N-1)/2):((N-1)/2); n = n+(n==0)*eps; % avoiding division by zero [h] = sin(n*2*pi*fc)./(n*pi);% generate sequence of ideal coefficients [w] = *cos(2*pi*n/N);% generate window function d = h.*w;% window the ideal coefficients [g,f] = freqz(d,1,512,44100);% transform into frequency domain for plotting figure(1) plot(f,20*log10(abs(g)));% plot transfer function axis([0 2*10^ ]); figure(2); stem(d);% plot coefficient values xlabel('Coefficient number'); ylabel ('Value'); title('Truncated Impulse Response'); figure(3) freqz(d,1,512,44100);% use freqz to plot magnitude and phase response axis([0 2*10^ ]);

Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2002 Chapter 14, Slide 25 Window Method

Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2002 Chapter 14, Slide 26 Realisation Structure Selection - Step 3  Direct form structure for an FIR filter:

Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2002 Chapter 14, Slide 27 Realisation Structure Selection - Step 3  Linear phase structures:  N even:  N Odd:  Direct form structure for an FIR filter:

Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2002 Chapter 14, Slide 28 Realisation Structure Selection - Step 3 (a) N even. (b) N odd.

Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2002 Chapter 14, Slide 29 Realisation Structure Selection - Step 3  Cascade structures:  Direct form structure for an FIR filter:

Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2002 Chapter 14, Slide 30 Realisation Structure Selection - Step 3  Cascade structures:  Direct form structure for an FIR filter:

Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2002 Chapter 14, Slide 31 Implementation - Step 5  Implementation procedure in ‘C’ with fixed-point:  Set up the codec (\Links\CodecSetup.pdf). \Links\CodecSetup.pdf  Transform: to ‘C’ code. (\Links\FIRFixed.pdf) \Links\FIRFixed.pdf  Configure timer 1 to generate an interrupt at 8000Hz (\Links\TimerSetup.pdf). \Links\TimerSetup.pdf  Set the interrupt generator to generate an interrupt to invoke the Interrupt Service Routine (ISR) (\Links\InterruptSetup.pdf). \Links\InterruptSetup.pdf

Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2002 Chapter 14, Slide 32 Implementation - Step 5  Implementation procedure in ‘C’ with floating-point: Same set up as fixed-point plus:  Convert the input signal to floating-point format.  Convert the coefficients to floating-point format.  With floating-point multiplications there is no need for the shift required when using Q15 format.  See \Links\FIRFloat.pdf \Links\FIRFloat.pdf

Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2002 Chapter 14, Slide 33 Implementation - Step 5  Implementation procedure in assembly: Same set up as fixed-point, however:  is written in assembly. (\Links\FIRFixedAsm.pdf) \Links\FIRFixedAsm.pdf  The ISR is now declared as external.

Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2002 Chapter 14, Slide 34 Implementation - Step 5  Implementation procedure in assembly: The filter implementation in assembly is now using circular addressing and therefore: circular addressingcircular addressing  The circular pointers and block size register are selected and initialised by setting the appropriate values of the AMR bit fields.  The data is now aligned using:  Set the initial value of the circular pointers, see \Links\FIRFixedAsm.pdf. \Links\FIRFixedAsm.pdf #pragma DATA_ALIGN (symbol, constant (bytes))

Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2002 Chapter 14, Slide 35 Implementation - Step 5 y0 = b0*x0 + b1*x1 + b2*x2 + b3*x3 Circular addressing link slide. time y[n] 012 *B5 *B5 *B5 *B5 *A5 *A5 *A5 *A5 b0b0b0b0 b1b1b1b1 b2b2b2b2 b3b3b3b3 x0x0x0x0 x1x1x1x1 x2x2x2x2 x3x3x3x3

Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2002 Chapter 14, Slide 36 x4x4x4x4 x1x1x1x1 x2x2x2x2 x3x3x3x3 Implementation - Step 5 y0 = b0*x0 + b1*x1 + b2*x2 + b3*x3 y1 = b0*x1 + b1*x2 + b3*x4 + b2*x3 Circular addressing link slide. time y[n] 012 *B5 *B5 *B5 *B5 *A5 *A5 *A5 *A5 b0b0b0b0 b1b1b1b1 b2b2b2b2 b3b3b3b3

Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2002 Chapter 14, Slide 37 x4x4x4x4 x5x5x5x5 x2x2x2x2 x3x3x3x3 Implementation - Step 5 y0 = b0*x0 + b1*x1 + b2*x2 + b3*x3 y1 = b0*x1 + b1*x2 + b3*x4 + b2*x3 y2 = b0*x2 + b1*x3 + b3*x5 + b2*x4 Circular addressing link slide. time y[n] 012 *B5 *B5 *B5 *B5 *A5 *A5 *A5 *A5 b0b0b0b0 b1b1b1b1 b2b2b2b2 b3b3b3b3

Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2002 Chapter 14, Slide 38 FIR Code  Code location:  Code\Chapter 14 - Finite Impulse Response Filters  Projects:  Fixed Point in C:\FIR_C_Fixed\  Floating Point in C:\FIR_C_Float\  Fixed Point in Assembly:\FIR_Asm_Fixed\  Floating Point in Assembly:\FIR_Asm_Float\

Chapter 14 Finite Impulse Response (FIR) Filters - End -