Chapter 14 Finite Impulse Response (FIR) Filters

Slides:



Advertisements
Similar presentations
Chapter 19 Fast Fourier Transform (FFT) (Theory and Implementation)
Advertisements

Chapter 15 Infinite Impulse Response (IIR) Filter Implementation
Chapter 11 Interfacing C and Assembly Code
Chapter 15 Infinite Impulse Response (IIR) Filters
1
© 2008 Pearson Addison Wesley. All rights reserved Chapter Seven Costs.
Copyright © 2003 Pearson Education, Inc. Slide 1 Computer Systems Organization & Architecture Chapters 8-12 John D. Carpinelli.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2003 Chapter 3 Data Transmission.
Chapter 1 The Study of Body Function Image PowerPoint
1 Copyright © 2013 Elsevier Inc. All rights reserved. Chapter 1 Embedded Computing.
Copyright © 2011, Elsevier Inc. All rights reserved. Chapter 6 Author: Julia Richards and R. Scott Hawley.
Author: Julia Richards and R. Scott Hawley
1 Copyright © 2013 Elsevier Inc. All rights reserved. Chapter 3 CPUs.
Properties Use, share, or modify this drill on mathematic properties. There is too much material for a single class, so you’ll have to select for your.
UNITED NATIONS Shipment Details Report – January 2006.
FIGURE 3.1 System for illustrating Boolean applications to control.
FIGURE 2.1 The purpose of linearization is to provide an output that varies linearly with some variable even if the sensor output does not. Curtis.
Properties of Real Numbers CommutativeAssociativeDistributive Identity + × Inverse + ×
Create an Application Title 1A - Adult Chapter 3.
FACTORING ax2 + bx + c Think “unfoil” Work down, Show all steps.
Year 6 mental test 5 second questions
Year 6 mental test 10 second questions
Solve Multi-step Equations
REVIEW: Arthropod ID. 1. Name the subphylum. 2. Name the subphylum. 3. Name the order.
Pole Placement.
Laplace Transform Math Review with Matlab:
Announcements Homework 6 is due on Thursday (Oct 18)
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.
Introduction to Electronic Circuit Design
PP Test Review Sections 6-1 to 6-6
DIVISIBILITY, FACTORS & MULTIPLES
EU market situation for eggs and poultry Management Committee 20 October 2011.
Notes 18 ECE Microwave Engineering Multistage Transformers
Chapter 3 Basic Logic Gates 1.
Chapter 3 (part 1) Basic Logic Gates 1.
The Fourier Transform I
Name Convolutional codes Tomashevich Victor. Name- 2 - Introduction Convolutional codes map information to code bits sequentially by convolving a sequence.
Copyright © 2012, Elsevier Inc. All rights Reserved. 1 Chapter 7 Modeling Structure with Blocks.
Constant, Linear and Non-Linear Constant, Linear and Non-Linear
Factor P 16 8(8-5ab) 4(d² + 4) 3rs(2r – s) 15cd(1 + 2cd) 8(4a² + 3b²)
Basel-ICU-Journal Challenge18/20/ Basel-ICU-Journal Challenge8/20/2014.
1..
CONTROL VISION Set-up. Step 1 Step 2 Step 3 Step 5 Step 4.
© 2012 National Heart Foundation of Australia. Slide 2.
Introduction to Feedback Systems / Önder YÜKSEL Bode plots 1 Frequency response:
Model and Relationships 6 M 1 M M M M M M M M M M M M M M M M
Chapter 18 Discrete Cosine Transform. Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2004 Chapter 18, Slide 2 Learning Objectives  Introduction.
Rational Functions and Models
Analyzing Genes and Genomes
Chapter 20 This chapter provides a series of applications. There is no daughter cards with the DSK6713 and DSK6416 Part 1: Applications using the PCM3003.
©Brooks/Cole, 2001 Chapter 12 Derived Types-- Enumerated, Structure and Union.
Essential Cell Biology
Intracellular Compartments and Transport
PSSA Preparation.
Essential Cell Biology
Immunobiology: The Immune System in Health & Disease Sixth Edition
Physics for Scientists & Engineers, 3rd Edition
1 Chapter 13 Nuclear Magnetic Resonance Spectroscopy.
Thomas L. Floyd Digital Fundamentals, 9e
Energy Generation in Mitochondria and Chlorplasts
Math Review with Matlab:
0 x x2 0 0 x1 0 0 x3 0 1 x7 7 2 x0 0 9 x0 0.
Chapter 14 Finite Impulse Response (FIR) Filters.
Chapter 15 Infinite Impulse Response (IIR) Filters.
FIR Filter Design & Implementation
Lecture 09b Finite Impulse Response (FIR) Filters
Lect5 A framework for digital filter design
Everything You Ever Wanted to Know About Filters*
Presentation transcript:

Chapter 14 Finite Impulse Response (FIR) Filters

Learning Objectives Introduction to the theory behind FIR filters: Properties (including aliasing). Coefficient calculation. Structure selection. Implementation in Matlab, C, assembly and linear assembly.

Introduction 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.

Properties of an FIR Filter Filter coefficients: x[n] represents the filter input, bk represents the filter coefficients, y[n] represents the filter output, N is the number of filter coefficients (order of the filter).

Properties of an FIR Filter Filter coefficients: FIR equation Filter structure

Properties of an FIR Filter Filter coefficients: If the signal x[n] is replaced by an impulse [n] then:

Properties of an FIR Filter Filter coefficients: If the signal x[n] is replaced by an impulse [n] then:

Properties of an FIR Filter Filter coefficients: If the signal x[n] is replaced by an impulse [n] then:

Properties of an FIR Filter Filter coefficients: Finally:

Properties of an FIR Filter Filter coefficients: With: The coefficients of a filter are the same as the impulse response samples of the filter.

Frequency Response of an FIR Filter By taking the z-transform of h[n], H(z): Replacing z by ej in order to find the frequency response leads to:

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.

Frequency Response of an FIR Filter y[n] x[n] Fs/2 x[n] y[n] Freq Freq Fs/2

Frequency Response of an FIR Filter Solution: Use an anti-aliasing filter. x[n] x(t) ADC FIR y[n] Analogue Anti-Aliasing Fs/2 x(t) y[n] Freq Freq Fs/2

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

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.

Phase Linearity of an FIR Filter Application of 90° linear phase shift: IH 90o I + Reverse delay + Signal separation delay - Forward 90o Q + QH

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.

Filter Specification - Step 1

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.

Window Method First stage of this method is to calculate the coefficients of the ideal filter. This is calculated as follows:

Window Method Using the Hamming Window: 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:

Window Method The third stage is to calculate the set of truncated or windowed impulse response coefficients, h[n]: for Where: for

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] = 0.54 + 0.46*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^4 -70 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

Truncated Impulse Response Window Method 20 40 60 80 100 120 140 -0.1 0.1 0.2 0.3 0.4 Truncated Impulse Response h(n) Coefficient number, n

Realisation Structure Selection - Step 3 Direct form structure for an FIR filter:

Realisation Structure Selection - Step 3 Direct form structure for an FIR filter: Linear phase structures: N even: N Odd:

Realisation Structure Selection - Step 3 (a) N even. (b) N odd.

Realisation Structure Selection - Step 3 Direct form structure for an FIR filter: Cascade structures:

Realisation Structure Selection - Step 3 Direct form structure for an FIR filter: Cascade structures:

Implementation - Step 5 Implementation procedure in ‘C’ with fixed-point: Set up the codec (\Links\CodecSetup.pdf). Transform: to ‘C’ code. (\Links\FIRFixed.pdf) Configure timer 1 to generate an interrupt at 8000Hz (\Links\TimerSetup.pdf). Set the interrupt generator to generate an interrupt to invoke the Interrupt Service Routine (ISR) (\Links\InterruptSetup.pdf).

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

Implementation - Step 5 Implementation procedure in assembly: Same set up as fixed-point, however: is written in assembly. (\Links\FIRFixedAsm.pdf) The ISR is now declared as external.

Implementation - Step 5 Implementation procedure in assembly: The filter implementation in assembly is now using circular addressing and therefore: 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. #pragma DATA_ALIGN (symbol, constant (bytes))

Circular addressing link slide. Implementation - Step 5 b0 b1 b2 b3 x0 x1 x2 x3 y0 = b0*x0 + b1*x1 + b2*x2 + b3*x3 time y[n] 1 2 Circular addressing link slide.

Circular addressing link slide. Implementation - Step 5 b0 b1 b2 b3 x4 x1 x2 x3 y0 = b0*x0 + b1*x1 + b2*x2 + b3*x3 y1 = b0*x4 + b1*x1 + b2*x2 + b3*x3 time y[n] 1 2 Circular addressing link slide.

Circular addressing link slide. Implementation - Step 5 b0 b1 b2 b3 x4 x5 x2 x3 y0 = b0*x0 + b1*x1 + b2*x2 + b3*x3 y1 = b0*x4 + b1*x1 + b2*x2 + b3*x3 y2 = b0*x4 + b1*x5 + b2*x2 + b3*x3 time y[n] 1 2 Circular addressing link slide.

FIR Code Code location: Projects: 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 -