IIR Half-band Filter Design with TMS320VC33 DSP



Similar documents
Design of Efficient Digital Interpolation Filters for Integer Upsampling. Daniel B. Turek

Filter Comparison. Match #1: Analog vs. Digital Filters

ELEN E4810: Digital Signal Processing Topic 8: Filter Design: IIR

Em bedded DSP : I ntroduction to Digital Filters

Transition Bandwidth Analysis of Infinite Impulse Response Filters

A Basic Introduction to Filters Active Passive and Switched-Capacitor

SECTION 6 DIGITAL FILTERS

Design of FIR Filters

Simulation of Frequency Response Masking Approach for FIR Filter design

LM833,LMF100,MF10. Application Note 779 A Basic Introduction to Filters - Active, Passive,and. Switched Capacitor. Literature Number: SNOA224A

First, we show how to use known design specifications to determine filter order and 3dB cut-off

Digital Signal Processing IIR Filter Design via Impulse Invariance

LMS is a simple but powerful algorithm and can be implemented to take advantage of the Lattice FPGA architecture.

Infinite Impulse Response Filter Structures in Xilinx FPGAs

Analog Filters. A common instrumentation filter application is the attenuation of high frequencies to avoid frequency aliasing in the sampled data.

chapter Introduction to Digital Signal Processing and Digital Filtering 1.1 Introduction 1.2 Historical Perspective

CHAPTER 6 Frequency Response, Bode Plots, and Resonance

Introduction to Digital Filters

2.161 Signal Processing: Continuous and Discrete Fall 2008

Impedance 50 (75 connectors via adapters)

An Introduction to Digital Filters

Motorola Digital Signal Processors

Lecture 9. Poles, Zeros & Filters (Lathi 4.10) Effects of Poles & Zeros on Frequency Response (1) Effects of Poles & Zeros on Frequency Response (3)

DESIGN AND SIMULATION OF TWO CHANNEL QMF FILTER BANK FOR ALMOST PERFECT RECONSTRUCTION

CHAPTER 8 ANALOG FILTERS

Understanding CIC Compensation Filters

Frequency Response of Filters

How to Design 10 khz filter. (Using Butterworth filter design) Application notes. By Vadim Kim

Sophomore Physics Laboratory (PH005/105)

Synchronization of sampling in distributed signal processing systems

NAPIER University School of Engineering. Electronic Systems Module : SE32102 Analogue Filters Design And Simulation. 4 th order Butterworth response

LAB 12: ACTIVE FILTERS

Analog and Digital Filters Anthony Garvert November 13, 2015

ELECTRONIC FILTER DESIGN HANDBOOK

What you will do. Build a 3-band equalizer. Connect to a music source (mp3 player) Low pass filter High pass filter Band pass filter

A DESIGN OF DSPIC BASED SIGNAL MONITORING AND PROCESSING SYSTEM

Time series analysis Matlab tutorial. Joachim Gross

Chapter 16. Active Filter Design Techniques. Excerpted from Op Amps for Everyone. Literature Number SLOA088. Literature Number: SLOD006A

SECTION 5-5: FREQUENCY TRANSFORMATIONS

AN-837 APPLICATION NOTE

PRACTICAL GUIDE TO DATA SMOOTHING AND FILTERING

Teaching DSP through the Practical Case Study of an FSK Modem

Application Report SLOA024B

SUMMARY. Additional Digital/Software filters are included in Chart and filter the data after it has been sampled and recorded by the PowerLab.

HYBRID FIR-IIR FILTERS By John F. Ehlers

PHYSICS LAB #2 Passive Low-pass and High-pass Filter Circuits and Integrator and Differentiator Circuits

MPC 4. Machinery Protection Card Type MPC 4 FEATURES. Continuous on-line Machinery Protection Card

Combining the ADS1202 with an FPGA Digital Filter for Current Measurement in Motor Control Applications

Continuous-Time Converter Architectures for Integrated Audio Processors: By Brian Trotter, Cirrus Logic, Inc. September 2008

Experimental validation of loudspeaker equalization inside car cockpits

MATRIX TECHNICAL NOTES

The Calculation of G rms

Implementation of the LMS Algorithm for Noise Cancellation on Speech Using the ARM LPC2378 Processor.

The Effective Number of Bits (ENOB) of my R&S Digital Oscilloscope Technical Paper

PIEZO FILTERS INTRODUCTION

Controller Design in Frequency Domain

TESTS OF 1 MHZ SIGNAL SOURCE FOR SPECTRUM ANALYZER CALIBRATION 7/8/08 Sam Wetterlin

Digital Signal Controller Based Automatic Transfer Switch

CTCSS REJECT HIGH PASS FILTERS IN FM RADIO COMMUNICATIONS AN EVALUATION. Virgil Leenerts WØINK 8 June 2008

Lock - in Amplifier and Applications

Clutter Filter Design for Ultrasound Color Flow Imaging

UNIVERSITY OF CALIFORNIA AT BERKELEY College of Engineering Department of Electrical Engineering and Computer Sciences. EE105 Lab Experiments

Digital Signal Processing Complete Bandpass Filter Design Example

Fast Logarithms on a Floating-Point Device

Automatic Detection of Emergency Vehicles for Hearing Impaired Drivers

Design of IIR Digital Filters. Ch. 5 - Lecture 18 DSP ECE 623 IIR DIGITAL FILTERS. Andreas Spanias. Chapter 5 IIR Filter Design. spanias@asu.

isim ACTIVE FILTER DESIGNER NEW, VERY CAPABLE, MULTI-STAGE ACTIVE FILTER DESIGN TOOL

24 Butterworth Filters

SWISS ARMY KNIFE INDICATOR John F. Ehlers

Laboratory #5: RF Filter Design

Introduction to IQ-demodulation of RF-data

AN-691 APPLICATION NOTE One Technology Way P.O. Box 9106 Norwood, MA Tel: 781/ Fax: 781/

Simple SDR Receiver. Looking for some hardware to learn about SDR? This project may be just what you need to explore this hot topic!

Wireless Communication and RF System Design Using MATLAB and Simulink Giorgia Zucchelli Technical Marketing RF & Mixed-Signal

1995 Mixed-Signal Products SLAA013

DIGITAL-TO-ANALOGUE AND ANALOGUE-TO-DIGITAL CONVERSION

Digital to Analog Converter. Raghu Tumati

AVR223: Digital Filters with AVR. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

QUICK START GUIDE FOR DEMONSTRATION CIRCUIT BIT DIFFERENTIAL ADC WITH I2C LTC2485 DESCRIPTION

The front end of the receiver performs the frequency translation, channel selection and amplification of the signal.

Current-Transformer Phase-Shift Compensation and Calibration

Lab #9: AC Steady State Analysis

Section 5.0 : Horn Physics. By Martin J. King, 6/29/08 Copyright 2008 by Martin J. King. All Rights Reserved.

Homework Assignment 03

Lecture 5: Variants of the LMS algorithm

TTT4110 Information and Signal Theory Solution to exam

USB 3.0 CDR Model White Paper Revision 0.5

AN1991. Audio decibel level detector with meter driver

FFT Algorithms. Chapter 6. Contents 6.1

An Adjustable Audio Filter System for the Receiver - Part 1

Chebyshev Filter at MHz Frequency for Radar System

A DA Serial Multiplier Technique based on 32- Tap FIR Filter for Audio Application

An Efficient RNS to Binary Converter Using the Moduli Set {2n + 1, 2n, 2n 1}

Bode Diagrams of Transfer Functions and Impedances ECEN 2260 Supplementary Notes R. W. Erickson

Title : Analog Circuit for Sound Localization Applications

SIGNAL PROCESSING & SIMULATION NEWSLETTER

Active Noise Cancellation Project

11: AUDIO AMPLIFIER I. INTRODUCTION

Transcription:

IIR Half-band Filter Design with TMS320VC33 DSP Ottó Nyári, Tibor Szakáll, Péter Odry Polytechnical Engineering College, Marka Oreskovica 16, Subotica, Serbia and Montenegro nyario@vts.su.ac.yu, tibi@vts.su.ac.yu, odry@vts.su.ac.yu Abstract: A half-band IIR filter can have fewer multipliers than the FIR filter for the same sharp cut-off specification. Elliptic IIR filters are the most efficient. To overcome phase nonlinearity one can use optimization to design an IIR filter with an approximately linear phase response [1] or apply the double filtering technique with the Powell and Chau modification for real-time processing [2], [3] and [4]. 1 Definition of Half-band Filter A half-band filter is usually specified by the normalized passband edge frequency f p, the stopband edge frequency f s, the maximum passband magnitude ripple δ 1 and the maximum stopband magnitude ripple δ 2, as shown on figure 1. figure 1. Magnitude response of FIR filter figure 2. Magnitude response of half-band IIR filter Alternatively, the filter can be specified by the passband magnitude tolerance δ p and the stopband magnitude tolerance δ s (figure 2) or by the maximum passband attenuation a p in db and the minimum stopband attenuation a s in db. A half-band filter must fulfil three conditions: the frequency symmetry condition, the magnitude condition,

the filter order condition. An elliptic half-band IIR filter is usually specified by the normalized passband edge frequency f p, the stopband edge frequency f s, the maximum passband magnitude tolerance δ p and the maximum stopband magnitude tolerance δ s, as shown on figure 2. We can choose arbitrarily n n min and only one filter parameter; say f p, from the design space, that is, from the range f p,min f p f p,max [2]. We compute the other three parameters from the above three conditions for the elliptic half-band IIR filter. Figure 3 displays the minimum stopband attenuation versus stopband edge frequency for FIR and IIR half-band filters. The transfer function poles of a halfband IIR filter are placed on the imaginary axis of the z plane. If the filter order n is an odd number, the halfband filter can be implemented as a parallel connection of two allpass networks thus coinciding with the lattice wave digital filters [2], [3] and [4]. The allpass structure leads to the most efficient implementations that are possible. Figure 3 Design curves for IIR and FIR half-band filters

2 Half-band IIR Filter Design Using MATLAB The application of MATLAB in IIR filter design requires four filter parameters to be specified. The design procedure which, starting from the specifications provides the exact adjustment of all half-band IIR filter parameters: f shb =min(f s, 1/2-f p ) (1) f phb =1/2- f shb (2) a /10 a shb =max (-10 log 10 (1-10 p, a s ) (3) 1 a phb =10 log 10 (1+ ) (4) a shb /10 10 1 For the given filter order n and one of the parameters, the remaining parameters are computed using explicit expressions. The design starts from a specification S = {f p, f s, a p, a s }. We can find the corresponding half-band filter specification satisfying the first two conditions, S HB = {f phb, f shb, a phb, a shb }. We can use MATLAB for determining the minimal filter order: n=ellipord (2*f phb, 2*f shb, a phb, a shb ), but we have to use a half-band filter specification. The filter parameters (f p, f s, a p, a s ) no longer meet exactly the calculated specification for the halfband IIR filter (f phb, f shb, a phb, a shb ). One of the filter parameters (f p, f s, a p, a s ) needs to be chosen, and the remaining three parameters are computed from the three conditions for half-band IIR filters. Next, we can use the function ellipin MATLAB to determine the transfer function of the n-th-order half-band IIR filter. We can determine the minimum and the maximum passband edge frequencies and the range of all other three parameters for three chosen passband edge frequencies: f p = f p, min ; f p = f phb ; f p = f p,max (5) Using the function ellip in MATLAB we can compute poles p k of the filter transfer function H(z). Notice that poles are placed on the imaginary axis of the z plane. The most efficient realization of H(z) is a parallel connection of two allpass branches. Thus we present H(z) as a sum of two allpass functions: 2 β2 + z β4 + z β H(z)= +z 1 3 + z β 5 + z (6) 1+ β z 1+ β z 1+ β z 1+ β z 2 Where the β i are the squared pole magnitudes. 4 We can use f p to optimize some filter property, for example, to minimize error due to the coefficient quantization. If we choose f p = f p,min, we reach the widest permitted transition band and get the smallest pass-band ripple and the highest stopband attenuation that is possible. For the choice f p = f p,max, we get the 3 5

narrowest possible transition band, and we reach the highest pass-band ripple and the smallest stopband attenuation. Illustrated on figure 5. We use the function ellipj in MATLAB to determine the Jacobi s elliptic s n function: x i =ellipj (((2*i-1)/n+1)*ellipke (1/ε^2), 1/ε^2), and we use the function ellipke to determine the complete elliptic integral. Figure 6 presents the frequency response of the half-band FIR and IIR filter. The half-band IIR filter has fewer multipliers than the FIR filter and the half-band IIR filter also has a better magnitude characteristic. Figure 5 Plot of number of multiplications as a function of normalized stopband edge frequency and minimum stopband attenuation Figure 6 Attenuation of the example filters: 9th-order half-band IIR filter, sold line, and 62nd-order half-band FIR filters, dashed line

3 IIR Filter Realization with TMS320VC33 DSP The TMS320VC33-150 is a high-performance floating-point digital signal processor (DSP), with 13-ns instruction cycle time, 150 million floating-point operations per second (MFLOPS) and 75 million instructions per second (MIPS). General-purpose applications are greatly enhanced by the large address space, multiprocessor interface, internally and externally generated wait states, one external interface port, two timers, one serial port, and multiple-interrupt structure. The TMS320C3x supports a wide variety of system applications from host processor to dedicated coprocessor. High-level-language support is easily implemented through a register-based architecture, large address space, powerful addressing modes, flexible instruction set, and well-supported floating-point arithmetic. In the more general case, the IIR filter contains N>1 biquads, as well IIR halfband filters. The equations for its implementation are given by the following pseudo-c language code: y [0,n] = x [n] for (i = 0; i < N; i ++){ d [i,n]=a2 [i] d [i, n 2] + a1 [i] d [i,n 1] + y [i 1,n] y [i,n]=b2[i] d [i 2] + b1 [i] d [i,n 1] + b0 [i] d [i,n] } y [n] = y [N 1,n] First - in MATLAB we have calculated the IIR half-band filter : [b,a] = halfbandiir ('minorder',f p,dev) designs the minimum order IIR filter, [b,a] = halfbandiir (N, F p ) designs a lowpass N-th order halfband IIR filter, [b,a] = halfbandiir (N, F p, high ) designs a highpass N-th order halfband IIR filter. Then we have generated biquad coefficients with MATLAB command tf2sos. After then we can use one or more include commands in the assembly-language code for embedding the section of IIR half-band coefficients. It is also possible to use multiple input channels (e.g. left, right) in the TMS320VC33 DSK. Each cannel we can separate to two output channels using a lowpass and a highpass filter for each channel.

3.1 Fragments of C3x Assembly-language Code * TITLE IIR FILTERS (N > 1 BIQUADS) * ARGUMENT ASSIGNMENT: * R2 INPUT SAMPLE x(n) * AR0 ADDRESS OF FILTER COEFFICIENTS (a2(0)) * AR1 ADDRESS OF DELAY NODE VALUES (d(0,n+-2)) * RC NUMBER OF BIQUADS (N) +-2 * REGISTERS CONTAINING RESULT: R0....include "half band iir biquads coefficients.asm"... NOP *--AR0(1) ; prepare for looping NOP *--AR1(IR0) ; predecrement by ovks RPTB LOOP ; Loop for 1 <= i < n MPYF3 *++AR0(1),*++AR1(IR0), R0 ; a2(0) * d(0,n 2) > R0 MPYF3 *++AR0(1), *AR1--(1)%, R1 ; b2(0) * d(0,n 2) > R1 MPYF3 *++AR0(1),*AR1,R0 ; a1(0) * d(0,n 1) > R0 ADDF3 R0, R2, R2 ; First sum term of d(0,n) MPYF3 *++AR0(1),*AR1--(1)%,R0 ; b1(0) * d(0,n 1) > R0 ADDF3 R0, R2, R2 ; Second sum term of d(0,n) MPYF3 *++AR0(1),R2,R2 ; b0(0) * d(0,n) > R2 STF R2, *AR1--(1)% ; store d(0,n) ADDF R0,R2 ; First sum term of y(n 1,n) LOOP ADDF3 R1,R2,R2 ; Second sum term, y(0) -> R2 LDF R2,R0 ; R2 == Y -> R0 NOP *AR1--(IR1) ; Return to first biquad NOP *AR1--(1)% ; Point to d(0,n 1) STI AR1,@IIR_RDELAY FIX R0,R0 ; float -> int STI R0,@ADCo_R ; store to memory, D/A... 3.2 Demonstration of Practical Results First example (figure 7) is for 7 th order half-band IIR filter. Figure 7 left: lowpass filter frequency response; right: highpass filter frequency response for 7 th order IIR

When the filter order had raised from 7 th order into 23 rd order, the frequency response has become far better. Second example: figure 8. Figure 8 left: lowpass filter frequency response; right: highpass filter frequency response for 23 rd order IIR Conclusions Multirate techniques are used to improve a digital filter design and implementation. The multirate approach increases the computation speed, decreases the overall filter order, and decreases power consumption. Various multirate techniques can be used to reach the filter requirements regarding the magnitude and phase responses, sensitivity to coefficient accuracy, robustness, noise and overflow, computation speed, miniaturization and modularity of the realization structure or power consumption. Half-band filters are basic building blocks in multirate systems. References [1] Surma-aho, K. and Saramäki, T. (1999, July). A systematic technique for designing approximately linear phase recursive digital filters. IEEE Transactions on Circuits and Systems II, 46, 956-63 [2] Lutovac, M. D. and Milic, L. D. (2000, March). Approximate linear-phase multiplierless IIR halfband filter. IEEE Signal Processing Letters, 7, 52-3 [3] Lutovac, M. D. and Milic, L. D. (2000, November). Half-band IIR filter design using MATLAB. Conference TELFOR, Yugoslavia, 329-32 [4] Powell, S. and Chau, M. (1991, November). A technique for realizing linear phase IIR filters. IEEE Trans. Signal Process., 39, 2425-35 [5] TI-Books for TMS320C3x DSP