AC : FIR FILTERS FOR TECHNOLOGISTS, SCIENTISTS, AND OTHER NON-PH.D.S

Similar documents
DSP Laboratory (EELE 4110) Lab#10 Finite Impulse Response (FIR) Filters

Electrical & Computer Engineering Technology

Signal Processing Toolbox

AC : INTERACTIVE LEARNING DISCRETE TIME SIGNALS AND SYSTEMS WITH MATLAB AND TI DSK6713 DSP KIT

Lecture 3 Review of Signals and Systems: Part 2. EE4900/EE6720 Digital Communications

Teaching Digital Signal Processing with MatLab and DSP Kits

System analysis and signal processing

Digital Video and Audio Processing. Winter term 2002/ 2003 Computer-based exercises

ECEGR Lab #8: Introduction to Simulink

DSP Laboratory (EELE 4110) Lab#11 Implement FIR filters on TMS320C6711 DSK.

Appendix B. Design Implementation Description For The Digital Frequency Demodulator

Basic Signals and Systems

DIGITAL SIGNAL PROCESSING (Date of document: 6 th May 2014)

The University of Texas at Austin Dept. of Electrical and Computer Engineering Midterm #1

The University of Texas at Austin Dept. of Electrical and Computer Engineering Final Exam

Problem Point Value Your score Topic 1 28 Filter Analysis 2 24 Filter Implementation 3 24 Filter Design 4 24 Potpourri Total 100

Concordia University. Discrete-Time Signal Processing. Lab Manual (ELEC442) Dr. Wei-Ping Zhu

The University of Texas at Austin Dept. of Electrical and Computer Engineering Midterm #2

Project 2 - Speech Detection with FIR Filters

(i) Understanding of the characteristics of linear-phase finite impulse response (FIR) filters

DFT: Discrete Fourier Transform & Linear Signal Processing

Biomedical Signals. Signals and Images in Medicine Dr Nabeel Anwar

Understanding the Behavior of Band-Pass Filter with Windows for Speech Signal

Brief Introduction to Signals & Systems. Phani Chavali

(i) Understanding of the characteristics of linear-phase finite impulse response (FIR) filters

EE 351M Digital Signal Processing

Lab S-5: DLTI GUI and Nulling Filters. Please read through the information below prior to attending your lab.

INTRODUCTION TO DIGITAL SIGNAL PROCESSING AND FILTER DESIGN

Discrete Fourier Transform (DFT)

EE 422G - Signals and Systems Laboratory

Team proposals are due tomorrow at 6PM Homework 4 is due next thur. Proposal presentations are next mon in 1311EECS.

Contents. Introduction 1 1 Suggested Reading 2 2 Equipment and Software Tools 2 3 Experiment 2

Understanding Digital Signal Processing

ECE438 - Laboratory 7a: Digital Filter Design (Week 1) By Prof. Charles Bouman and Prof. Mireille Boutin Fall 2015

EXPERIMENT 4 INTRODUCTION TO AMPLITUDE MODULATION SUBMITTED BY

Design of FIR Filters

L A B 3 : G E N E R A T I N G S I N U S O I D S

Experiment 6: Multirate Signal Processing

Figure 1: Block diagram of Digital signal processing

1 PeZ: Introduction. 1.1 Controls for PeZ using pezdemo. Lab 15b: FIR Filter Design and PeZ: The z, n, and O! Domains

Problem Point Value Your score Topic 1 28 Discrete-Time Filter Analysis 2 24 Improving Signal Quality 3 24 Filter Bank Design 4 24 Potpourri Total 100

DIGITAL FILTERS. !! Finite Impulse Response (FIR) !! Infinite Impulse Response (IIR) !! Background. !! Matlab functions AGC DSP AGC DSP

ELT COMMUNICATION THEORY

Electrical and Telecommunication Engineering Technology NEW YORK CITY COLLEGE OF TECHNOLOGY THE CITY UNIVERSITY OF NEW YORK

Filters. Phani Chavali

Instruction Manual for Concept Simulators. Signals and Systems. M. J. Roberts

Spring 2018 EE 445S Real-Time Digital Signal Processing Laboratory Prof. Evans. Homework #2. Filter Analysis, Simulation, and Design

EECS 452 Midterm Exam Winter 2012

Interpolated Lowpass FIR Filters

Digital Filters IIR (& Their Corresponding Analog Filters) Week Date Lecture Title

Experiment # 4. Frequency Modulation

RTTY: an FSK decoder program for Linux. Jesús Arias (EB1DIX)

Two-Dimensional Wavelets with Complementary Filter Banks

The Discrete Fourier Transform. Claudia Feregrino-Uribe, Alicia Morales-Reyes Original material: Dr. René Cumplido

Digital Filters - A Basic Primer

LABORATORY - FREQUENCY ANALYSIS OF DISCRETE-TIME SIGNALS

F I R Filter (Finite Impulse Response)

DIGITAL FILTERING OF MULTIPLE ANALOG CHANNELS

Signal Processing. Introduction

EEL 4350 Principles of Communication Project 2 Due Tuesday, February 10 at the Beginning of Class

EECS 452 Midterm Closed book part Winter 2013

FAST Fourier Transform (FFT) and Digital Filtering Using LabVIEW

4. Design of Discrete-Time Filters

GUJARAT TECHNOLOGICAL UNIVERSITY

FIR window method: A comparative Analysis

Fourier Series and Gibbs Phenomenon

Spring 2014 EE 445S Real-Time Digital Signal Processing Laboratory Prof. Evans. Homework #2. Filter Analysis, Simulation, and Design

Designing Filters Using the NI LabVIEW Digital Filter Design Toolkit

Digital Signal Processing

Sampling and Reconstruction of Analog Signals

DIGITAL SIGNAL PROCESSING FOR THE AUDITORY SCIENTIST: A TUTORIAL INTRODUCTION

Wavelet Transform. From C. Valens article, A Really Friendly Guide to Wavelets, 1999

Lab 8. Signal Analysis Using Matlab Simulink

Filter Banks I. Prof. Dr. Gerald Schuller. Fraunhofer IDMT & Ilmenau University of Technology Ilmenau, Germany. Fraunhofer IDMT

DSP First Lab 03: AM and FM Sinusoidal Signals. We have spent a lot of time learning about the properties of sinusoidal waveforms of the form: k=1

Adaptive Filters Application of Linear Prediction

ECE Digital Signal Processing

ELEC3104: Digital Signal Processing Session 1, 2013

EE 311 February 13 and 15, 2019 Lecture 10

Wavelet Transform. From C. Valens article, A Really Friendly Guide to Wavelets, 1999

ECE 5650/4650 Exam II November 20, 2018 Name:

CS3291: Digital Signal Processing

Common Pitfalls in Communications Systems Simulation

Signal processing preliminaries

Keywords FIR lowpass filter, transition bandwidth, sampling frequency, window length, filter order, and stopband attenuation.

Mathematical Operations on Basic Discrete Time Signals with MATLAB Programming

The Fast Fourier Transform

Introduction. A Simple Example. 3. fo = 4; %frequency of the sine wave. 4. Fs = 100; %sampling rate. 5. Ts = 1/Fs; %sampling time interval

Outline. Introduction to Biosignal Processing. Overview of Signals. Measurement Systems. -Filtering -Acquisition Systems (Quantisation and Sampling)

Signal Processing. Naureen Ghani. December 9, 2017

Introduction to Simulink

Bibliography. Practical Signal Processing and Its Applications Downloaded from

Digital Signal Processing. VO Embedded Systems Engineering Armin Wasicek WS 2009/10

Lecture Schedule: Week Date Lecture Title

EE 403: Digital Signal Processing

Copyright S. K. Mitra

Fourier Theory & Practice, Part I: Theory (HP Product Note )

Performance Analysis of FIR Filter Design Using Reconfigurable Mac Unit

Window Method. designates the window function. Commonly used window functions in FIR filters. are: 1. Rectangular Window:

MATLAB/Simulink For Digital Signal Processing Ebooks Free

Transcription:

AC 29-125: FIR FILTERS FOR TECHNOLOGISTS, SCIENTISTS, AND OTHER NON-PH.D.S William Blanton, East Tennessee State University Dr. Blanton is an associate professor and coordinator of the Biomedical Engineering Technology concentration at East Tennessee State University. His scholarly interests are the applications of digital signal processing to electronic instrumentation, especially medical instrumentation and medical imaging. American Society for Engineering Education, 29 Page 14.632.1

FIR Filters for Technologists, Scientists, and Other Non-PhDs ABSTRACT The digital filter used most often in digital signal processing (DSP) is the Finite Impulse Response (FIR) filter because it is the easiest to design and it is always stable. An interesting demonstration of the design and implementation of a FIR filter can be shown using MATLAB. The Remez function in MATLAB can be used to generate the filter coefficients for the lowpass, highpass, bandpass, or bandstop filter. MATLAB can be used to generate a set of sinusoidal signals that can be observed in the time domain and frequency domain. The appropriate filter can be applied to pass or block one or all the signals. In addition, MATLAB provides a graphic user interface tool, the Filter Design and Analysis Tool (fdatool), that can be used to generate the filter coefficients. Regardless of the method, the design and implementation of a FIR filter is shown to be straightforward. INTRODUCTION Human reality revolves around the analog domain where perception of events is formed by information that can take on any numeric value at any time. Unfortunately, most modern information is collected, manipulated, collated, and stored in the digital domain associated with computers where data must be a discrete value having limited values for specific times only (Figure 1). The general scheme for converting from the analog domain to the discrete (digital) domain is shown in Figure 2. Digital signal processing (DSP) generally consists of an antialiasing filter to limit the bandwidth of the analog signal, an analog-to-digital converter (ADC) that converts analog signals to discrete signals that the computer or microcontroller can use, a DSP chip that manipulates (filters) the digital signal, a digital-to-analog converter (DAC) to convert the digital Page 14.632.2

signal back to an analog signal, and a reconstruction filter to reduce the discontinuities associated with digital-to-analog conversion. The manipulation of data is demonstrated in Figure 3. Figure 1: Analog and digital functions. Figure 2: The general scheme of DSP. Page 14.632.3

Figure 3: An example of DSP. Because digital signal processing is so pervasive in modern applications, Figure 4, all students throughout the electrical engineering spectrum need a general working Figure 4. DSP applications. knowledge of digital filters. The objective is to present such knowledge in a way that technologists, scientists, and other non-phds are not frightened by the mathematical rigor of the subject. The most straightforward method of digital signal processing is the FIR filter, and the most straightforward method to mask the mathematical rigor is to use MATLAB 1. Page 14.632.4

FIR FILTERS FIR filters are defined by the following discrete equation: y N ] n_? bk x] n/ k_ (1) k? The present discrete output, y[n], is the result of the sum of a stream of weighted discrete inputs, b k x k. The equation can be demonstrated figuratively in Figure 5. An important Figure 5. FIR filter block diagram. factor associated with the FIR filter is that the output is related only to inputs and not the previous outputs. That is, there are no feedback components in a FIR filter; therefore, the FIR filter is always stable. The FIR filter response is dependent upon the weighted coefficients, b k, associated with the various inputs, x k. MATLAB can be used to generate a coefficient matrix that can be inserted into the memory of a digital signal processor to perform the indicated filtering. Page 14.632.5

A FIR FILTER EXAMPLE Consider the following example adapted from Kehtarnavaz and Keramat 2 consisting of a composite signal of three sinusoids created by the following MATLAB code and shown in Figure 6. The spectrum of the composite waveform can be derived using the fast Fourier transform function routine, Figure 7. A very simple FIR filtering method can be implemented using the Remez method 3 in MATLAB. The Remez method normalizes (sets to 1) the folding frequency (1/2 the sampling frequency). The corresponding magnitudes for the corresponding frequencies are denoted by mag and nu, respectfully, Figure 8. For a sampling frequency of 1, Hz and if the magnitude is 1 for the normalized frequencies of ( Hz) and.3 (15 Hz) and for the normalized frequencies of.35 (155 Hz) and 1 (5 Hz), a lowpass filter will be realized as shown in Figure 9. Note that the FIR filter passes the 1 khz signal while blocking the 2 khz and 3 khz signals, Figure 1. We can compare the original waveform with the filtered waveform as shown in Figure 11. Note that in the time domain, the signal has been transformed from a waveform with several frequencies into a signal with a single frequency. More importantly, the Remez algorithm generated a set of coefficients that can be downloaded into a digital signal processor memory, Figure 12. These coefficients are the weighted coefficients, b k, in equation 1. These are the coefficients that define the frequency response of the digital filter, and when implemented in the processor software allow the digital signal processor to filter the input signal. By varying the coefficients, the digital signal processor can function as a lowpass, highpass, bandpass, or bandstop filter. Page 14.632.6

Fs=1e3; %1 khz sampling frequency Ts=1/Fs; %Sampling time Ns=124; %Number of samples t= [:Ts:Ts*(Ns-1)]; f1=1; %frequncey 1 f2=2; %frequency 2 f3=3; %frequency 3 x1=sin(2*pi*f1*t); %1 khz Sinusoid x2=sin(2*pi*f2*t); %2 khz Sinusoid x3=sin(2*pi*f3*t); %3 khz Sinusoid x=x1+x2+x3; %Composite signal consisting of three sine waves plot(t,x), grid; %Plot of the composite signal axis([.8-3 3]) ; 3 2 1-1 -2-3 1 2 3 4 5 6 7 8 x 1-3 Figure 6. Composite signal consisting of 1 khz, 2kHz, and 3kHz sine waves. Page 14.632.7

function va_fft(x,ns,fs) X=fft(x,Ns); XX=(abs(X)); XXX=XX(1:length(XX)/2); y=xxx; f=[1:1:length(y)]; plot(f*fs/ns,y); grid on; 5 45 4 35 3 25 2 15 1 5 5 1 15 2 25 3 35 4 45 5 Figure 7. Spectrum of composite waveform. Page 14.632.8

%MAT33.M FIR LOWPASS WITH 33 COEFFICIENTS USING MATLAB nu=[.3.35 1]; mag=[1 1 ]; c=remez(32,nu, mag); bp33=c ; save c:\matbp33.cofbp33 -ascii; [h,w]=freqz(c, 1, 124); You can change this to whichever file you use to save data! plot(5*nu,mag,w/pi,abs(h)) %normalized frequencies %magnitude @ normalized freqs %invoke remez algorithm for 33 coefficients %coefficient vector transposed %save coefficients in ascii file (dest,source) %frequency plot with 124 points %plot ideal magnitude response Figure 8. Remez FIR method. 5 45 4 35 3 25 2 15 1 5 5 1 15 2 25 3 35 4 45 5 Figure 9. Lowpass Fir filter using Remez method. Page 14.632.9

nu=[.3.35 1]; mag=[1 1 ]; c=remez(32,nu, mag); a=1; freqz(c,a);grid on subplot(3,1,1) va_fft(x,124,1); subplot(3,1,2),grid on [h,w]=freqz(c,1,256); plot(w/(2*pi),1*log(abs(h))); subplot(3,1,3);grid on y=filter(c,a,x); va_fft(y,124,1); 6 4 2 5 1 15 2 25 3 35 4 45 5 5-5 -1.5.1.15.2.25.3.35.4.45.5 4 3 2 1 5 1 15 2 25 3 35 4 45 5 Figure 1. Filtered signal in the frequency domain. Page 14.632.1

n= 128; subplot(2,1,1); plot(t(1:n),x( 1:n)); grid on; axis([ 8e-3-3 3]); xlabel('time(s)'); ylabel('amplitude '); title('original and Filtered Signal '); subplot(2,1,2); plot(t(1:n),y(1:n)); grid on; axis([ 8e-3-3 3]); xlabel('times(s)'); ylabel('amplitude '); 3 Original and Filtered Signal Amplitude 2 1-1 -2-3 1 2 3 4 5 6 7 8 time(s) x 1-3 Amplitude 3 2 1-1 -2-3 1 2 3 4 5 6 7 8 times(s) x 1-3 Figure 11. Original and filtered signals in time domain. Page 14.632.11

3.646389e-2-2.623148e-2-3.63887e-2 6.59395e-4 1.1311239e-2-2.166658e-2-2.3917629e-2 2.2122339e-2 2.262e-2-3.8139676e-2-2.4148287e-2 5.6624944e-2 2.3685121e-2-1.258764e-1-2.512318e-2 3.1675284e-1 5.247762e-1 3.1675284e-1-2.512318e-2-1.258764e-1 2.3685121e-2 5.6624944e-2-2.4148287e-2-3.8139676e-2 2.262e-2 2.2122339e-2-2.3917629e-2-2.166658e-2 1.1311239e-2 6.59395e-4-3.63887e-2-2.623148e-2 3.646389e-2 Figure 12. Coefficients generated by Remez method. Page 14.632.12

FDATOOL EXAMPLE The fdatool command in MATLAB can also be used to design a FIR filter. Typing fdatool in the command line of MATLAB invokes the Filter Design & Analysis Tool, Figure 13. Using the previous parameters for a 33 coefficient lowpass filter, the response type can be set for lowpass, the design method can be set for window, the filter order can be set for 33, the window option can be set for rectangular, the sampling frequency can be set for 1 khz, and the cutoff frequency can be set for 15 Hz. Selecting the design button designs the filter, Figure 14. The corresponding coefficients are shown in Figure 15. Figure 13. MATLAB s Filter Design & Analysis Tool graphic user interface. Page 14.632.13

Figure 14. A 33 coefficient FIR filter design developed by MATLAB s Filter Design & Analysis Tool graphic user interface. Replacing the coefficients in variable c in MATLAB script in Figure 1 with the coefficients in Figure 15, the FIR filter once again passes the 1 khz signal while blocking the 2 khz and 3 khz signals, Figure 16. We can compare the original waveform with the filtered waveform as shown in Figure 17. Once again, the signal has been transformed from a waveform with several frequencies into a signal with a single frequency. Moreover, the techniques used in these examples can be extended to highpass filters, bandpass filters, and bandstop filters. Page 14.632.14

.29.176.188.35 -.173 -.263 -.132.146.356.289 -.74 -.496 -.66 -.137.866.216.278.278.216.866 -.137 -.66 -.496 -.74.289.356.146 -.132 -.263 -.173.35.188.176 Figure 15. Coefficients generated by MATLAB s Filter Design & Analysis Tool. Page 14.632.15

6 4 2 5 1 15 2 25 3 35 4 45 5 2-2 -4-6.5.1.15.2.25.3.35.4.45.5 4 3 2 1 5 1 15 2 25 3 35 4 45 5 Figure 16. Filtered signal in the frequency domain. 3 Original and Filtered Signal Amplitude 2 1-1 -2-3 1 2 3 4 5 6 7 8 time(s) x 1-3 Amplitude 3 2 1-1 -2-3 1 2 3 4 times(s) 5 6 7 8 x 1-3 Figure 17. Original and filtered signal in time domain. Page 14.632.16

CONCLUSIONS Once used primarily for academic research and futuristic military applications, digital signal processing has become a widely accessible commercial technology. A variety of highperformance, integrated digital siganl processors have made digital signal processing technology easier and more affordable to use. Digital signal processors are dedicated microprocessors. Because they are programmed and interfaced much like microprocessors, DSP theory provides a superb alternative for teaching microprocessor theory, especially for programs that emphasize digital communications and digital control. Also, software and development tools are more available so that students can easily become proficient in the use of DSP. Digital signal processing has been transformed from a relatively new, esoteric technology to a mature, well understood technology. It is not impossible to learn, it doesn't require a Ph.D. in mathematics, and it really can be useful. There are texts 4,5 and other resources aimed at the non-phd, and it has never been easier to experiment with signal processing. REFERENCES 1. The Mathworks, MATLAB & Simulink, R28b. Natick, MA: The Mathworks (28). 2. Kehtarnavaz, N and Keramat, M., DSP System Design Using the TMS32C6. Upper Saddle River, NJ: Prentice-Hall (21). 3. Chassaing, R., Digital Signal Processing and Applications with the C6713 and C6416 DSK. New York: Wiley, (25). 4. Lyons, R., Understanding Digital Signal Processing, 2nd Ed., Upper Saddle River, NJ: Prentice-Hall (24). 5. McClellan, J., Schafer, R., and Yoder, M., Dsp First: A Multimedia Approach. Upper Saddle River, NJ: Prentice-Hall (1998). Page 14.632.17