Upload
rox-alfaro
View
13
Download
2
Embed Size (px)
Citation preview
3-1
TM
AN9603.2
1-888-INTERSIL or 321-724-7143 | Intersil and Design is a trademark of Intersil Corporation. | Copyright Intersil Corporation 2000
An Introduction to Digital Filters
IntroductionDigital Signal Processing (DSP) affords greater flexibility, higherperformance (in terms of attenuation and selectivity), bettertime and environment stability and lower equipment productioncosts than traditional analog techniques. Additionally, more andmore microprocessor circuitry is being displaced with cost-effective DSP techniques and products; an example of this isthe emergence of DSP in cellular base stations. Componentsavailable today let DSP extend from baseband to intermediatefrequencies (IFs). This makes DSP useful for tuning and signalselectivity, and frequency up and down conversion.
These new DSP applications result from advances in digitalfiltering. This Application Note will overview digital filtering byaddressing concepts which can be extended to basebandprocessing on programmable digital signal processors.
Essentials of Digital FilteringA digital filter is simply a discrete-time, discrete-amplitudeconvolver. An example is shown in Figure 1 for three-bitamplitude quantization. Basic Fourier transform theory statesthat the linear convolution of two sequences in the timedomain is the same as multiplication of two correspondingspectral sequences in the frequency domain. Filtering is inessence the multiplication of the signal spectrum by thefrequency domain impulse response of the filter. For an ideallowpass filter the pass band part of the signal spectrum ismultiplied by one and the stopband part of the signal by zero.
Analog Filters, Software-Based andHard-wired Digital FiltersOwing to the way that analog and digital filters are physicallyimplemented, an analog filter is inherently more size-andpower-efficient, although more component-sensitive, than itsdigital counterpart - if it can be implemented in astraightforward manner. In general, as signal frequencyincreases, the disparity in efficiency increases.
Characteristics of applications where digital filters are moresize and power efficient than analog filters are: linear phase,very high stop band attenuation, very low pass band ripple;the filters response must be programmable or adaptive; thefilter must manipulate phase and, very low shape factors (adigital filters shape factor is the ratio of the filters pass bandwidth plus the filters transition band width to the filters passband width).
General-purpose digital signal microprocessors, nowcommodity devices, are used in a broad range ofapplications and can implement moderately complex digitalfilters in the audio frequency range. Many standard signalprocessing algorithms, including digital filters, are availablein software packages from digital signal processor and thirdparty vendors. As a result, software development costs aretrivial when amortized over production quantities.
The architectures of digital signal microprocessors areusually optimized to perform a sum-of-products calculationwith data from RAM or ROM. They are not optimized for anyspecific DSP function. However, to get extended samplingrate performance from a digital filter requires hardwaredesigned to perform the intended filter function at thedesired sampling frequencies.
For example, Intersil Corporation offers a family of standarddigital filter products with several others in development.Some hardware-specific digital filters can now sample atrates approaching 75 Megasamples Per Second (MSPS).Higher performance is possible for high volume applicationsby limiting the range of parameters. Standard filter productsstrike a balance between optimized filter architectures andprogrammability by offering a line of configurable filters. Thatis, these products are function-specific, with optimizedarchitectures and programmable parameters.
Conceptual DifferencesFrequency-Domain Versus Time Domain ThinkingThinking about analog filters, most engineers arecomfortable in the time domain. For example, the operationof an RC lowpass filter can easily be envisioned as acapacitor charging and discharging through a resistor.Likewise, it is easy to envision how a negative-feedbackactive filter uses phase shift as a function of frequency,which is a time domain operation.
A digital filter is better conceptualized in the frequencydomain. The filter implementation simply performs aconvolution of the time domain impulse response and thesampled signal. A filter is designed with a frequency domainimpulse response which is as close to the desired idealresponse as can be generated given the constraints of theimplementation. The frequency domain impulse response isthen transformed into a time domain impulse responsewhich is converted to the coefficients of the filter.
Application Note January 1999
3-2
Mathematics Versus PhysicsThe characteristics of an analog filter are directly attributableto the physics of the device that implements it. In contrast,the characteristics of a digital filter are only indirectlyattributable to the physics of the device that implements it.
A digital filters passband ripple, shape factor, stopbandattenuation, and phase characteristics are all functions ofthe order and type of polynomial used to approximate theideal impulse response, the number of bits used inperforming the arithmetic, and the type of architecture usedto implement the arithmetic. Actual frequencies have no
FIGURE 1A. x(n) (SIGNAL SAMPLES
FIGURE 1B. h(n) (FILTER IMPULSE RESPONSE SAMPLES)
FIGURE 1. THE DISCRETE TIME AND DISCRETE AMPLITUDE CONVOLUTION OF h(n) WITH x(n)
0.5
0.75
0.25
0.0
-0.25
-0.5
-0.75
-1.0
n 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
(nT)
(nT)
0.5
0.25
0.0
n 0 1 2
(nT)
0.5
0.75
0.25
0.0
-0.25
-0.5
-0.75
-1.0
n 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
y(n) = h(n)
TRANSIENTRESPONSE
x(n) (OUTPUT SAMPLES) =+ h m( ) n m( )m 0=
2
FIGURE 1C.
(nT)
Application Note 9603
3-3
meaning in a digital filter except in their relation to thesampling frequency. This is because the impulse response isgenerated as a function of z-1, the sample interval (the timebetween samples). For a smaller shape factor, the order ofthe filter and the number of bits in the arithmetic can beincreased. The only physical limitation is the amount ofarithmetic processing that can be integrated on a device ordevices given the filter order and the input sampling rate.
Digital Filter TypesThere are two basic types of digital filters, Finite ImpulseResponse (FIR) and Infinite Impulse Response (IIR) filters.The general form of the digital filter difference equation is:
where y(n) is the current filter output, the y(n-i)s are previousfilter outputs, the x(n-i)s are current or previous filter inputs,the ais are the filters feed forward coefficientscorresponding to the zeros of the filter, the bis are the filtersfeedback coefficients corresponding to the poles of the filter,and N is the filters order. IIR filters have one or more non-zero feedback coefficients. That is, as a result of thefeedback term, if the filter has one or more poles, once thefilter has been excited with an impulse there is always anoutput. FIR filters have no non-zero feedback coefficient.That is, the filter has only zeros, and once it has beenexcited with an impulse, the output is present for only a finite(N) number of computational cycles.Figures 2 and 3 show common IIR architectures. Figures 4through 6 show common FIR architectures.
Strengths and WeaknessesBecause an IIR filter uses both a feed-forward polynomial(zeros as the roots) and a feedback polynomial (poles as theroots), it has a much sharper transition characteristic for agiven filter order. Like analog filters with poles, an IIR filterusually has nonlinear phase characteristics. Also, thefeedback loop makes IIR filters difficult to use in adaptivefilter applications.
Due to its all zero structure, the FIR filter has a linear phaseresponse when the filters coefficients are symmetric, as isthe case in most standard filtering applications. A FIRsimplementation noise characteristics are easy to model,especially if no intermediate truncation is used. In thiscommon implementation, the noise floor is at - 6.02 B + 6.02log2NdB where B is the number of actual bits used in thefilters coefficient quantization and N is again the filter order.This is why most Intersil filter ICs have more coefficient bitsthan data bits.
An IIR filters poles may be close to or outside the unit circlein the Z plane. This means an IIR filter may have stabilityproblems, especially after quantization is applied. An FIRfilter is always stable. FIR filters also allow development ofcomputationally efficient architectures in decimating orinterpolating applications, which will be described in moredetail later.
Filter Response Design MethodsThe total specification of the ideal filter includes the locationof passbands and stopbands, the minimum stopbandattenuation, the maximum passband ripple, the filter order,and perhaps the shape of the response in some of thespecified bands.
Typically, there are three stages to the design of digital filterresponses for passband filters. First, the ideal filter responseis specified. Next, a floating point response is designed.Finally, the floating point coefficients are quantized to yield afixed point response.
Creating a floating-point IIR filter response starts with aprototype analog filter. Then an s-domain to z-domaintransformation is used to generate a set of digital filtercoefficients. Common methods of designing floating-pointFIR filter responses are windowing, frequency sampling, andoptimal. All are described in general digital signal processingtexts and are standard in most commercially available digitalfilter design software packages.
Converting floating-point coefficients into fixed-pointcoefficients requires quantizing the coefficients andcalculating the frequency domain impulse response of thefilter or filter model to verify that the filter meets the requiredspecification. If it does not, either the number of coefficientbits can be increased, the filter response can be redefinedand step two repeated, or the filter arithmetic can beredesigned, or a combination of these procedures can beperformed. When filter hardware is at a premium,sophisticated simulated annealing techniques can be usedfor both fixed-point FIR and IIR filters to produce the best setof filter coefficients, given a fixed filter order and coefficientwidth.
Decimation and InterpolationDecimation (Figure 7) is reducing the output sampling rateby ignoring all but every Mth sample. When a digital filterreduces the bandwidth of a signal of interest so the filteroutput is over-sampled if the input sample rate is preserved,it is inefficient to compute outputs that will be ignored in thedecimation process. Thus, there is a one-to-onecorrespondence between decimation rate and gain incomputational efficiency. However, this computationalefficiency can not be fully realized in an IIR filter because thefeedback path must be computed for every input cycle.
y n( ) aix n i( ) biy n i( )i 1=
N
i 0=
N
=
Application Note 9603
3-4
FIGURE 2. IIR FILTER DIRECT FORM 1
FIGURE 3. IIR FILTER DIRECT FORM 2
FIGURE 4. TRANSVERSAL IMPLEMENTATION OF AN FIR FILTER
a1 aNa0
-b1-bN-1-b N
x y
Z -1
Z -1 Z -1 Z-1
Z -1
a2
Z -1
aN-bN
a3-b3
a2-b2
a1-b1
a0
x y
Z -1
Z -1
Z -1
Z -1
y
x Z -1Z -1Z -1Z -1
a0 a1 a2 a3 aN
Application Note 9603
3-5
Interpolation (Figure 8) means increasing the sampling rate. Itis most often used when a narrowband signal will be combinedwith a signal that requires a higher sampling rate. Conceptually,the first step in interpolation is to stuff L-1 zero-valued samplesbetween each valid input sample, expanding the sampling rateby L, and causing the original signal spectrum to be repeated L-
1 times. To perform the actual interpolation, the zero-valuedinput samples must be converted to approximations of signalsamples. This is equivalent to preserving the original signalspectrum. Effectively, the zero-stuffed input stream is filtered bya lowpass filter with a pass band at the original spectrumlocation. This filters out all of the repeated spectra.
FIGURE 5. PARALLEL MULTIPLIER/ACCUMULATOR CELL FIR FILTER IMPLEMENTATION
FIGURE 6. TRANSPOSED FIR FILTER IMPLEMENTATION
FIGURE 7. BLOCK DIAGRAM AND SPECTRAL REPRESENTATION OF THE DECIMATION PROCESS
Z -1
x
ACC. ACC. ACC. ACC.
COEFF.STORE
DUMP
PULSE
y
Z -1 Z -1
Z -1 Z -1 Z -1 Z -1
AND CLEAR
y
x
aN aN-1 aN-2 a0
Z -1 Z -1 Z -1
LPF M
fS/2 fS/2 fS/2M
Application Note 9603
3-6
In FIR filters, interpolation computational efficiency ispossible because only every Lth data value is non zero andthus requires an actual multiply-add operation.Consequently, there is a one-to-one correspondencebetween interpolation rate and gain in computationalefficiency. The efficient interpolation structure is calledpolyphase. Again, because of the feedback loop in an IIRfilter, this computational efficiency can not be realized.
Hardware Versus SoftwareThere is no difference between the mathematics and filterresponse design of a hardware versus a softwareimplementation of a digital filter. The only differences lie inthe implementation architectures.
Optimal ArchitecturesA digital filter implemented in software is typically run on aprocessor with a single computational element. This forcesthe filter to be implemented in a serial sum-of-products. AFIR is implemented as a single sum-of-products and an IIRis typically a sum of products for the feed-forward sectionand another sum-of-products for the feedback section.
Hardware can be optimized for each application. Low speedand low power can be achieved using a bit-serialimplementation. Moderate speed and power may call for asingle parallel multiplier-accumulator. High speedapplications can utilize multiple multiplier-accumulator
structures with specialized memory address schemes.Decimating or interpolating filters can use optimizedpolyphase structures, multiple stages and specializedmemory addressing schemes. Coefficient memory can bedesigned to take advantage of coefficient characteristics andaccumulators can be custom-designed to take advantage ofunity gain properties.
Speed/Flexibility TradeoffsWhen a digital filter is hard-wired for one specific task, itsperformance can be optimized because there is no controloverhead associated with reconfiguring the IC.
Even with a hard-wired filter, however, some degree offlexibility can be achieved without sacrificing muchcomputational efficiency. For example, a FIR filter withprogrammable coefficients and filter order and a limitedselectable decimation rate requires only a modified memoryand memory addresser added to a fixed FIR filter.
Intersil Corporations line of standard digital filtering devicesfocuses on reconfigurable function-specific devices. Thestandard products are specialized FIR filters; IIR filterimplementations are limited to application-specific designs.Most of the Intersil standard filters have programmabledecimation rates. Some can interpolate. Most haveprogrammable coefficients and filter orders and some provideup/or down-conversion.
L y(mT)LPF
FIGURE 8. BLOCK DIAGRAM AND SPECTRAL REPRESENTATION OF THE INTERPOLATION PROCESS
N(nT)
X (n
T)
n = 1n = 2
nT
INPUT SIGNAL
X (f)
0 fS 2fS 3fS 4fS 5fS 6fS 7fS 8fSf
nT
L = 4
Y (m
T)
n = 1m = 8
nT
FILTER
0 fS 4fS 6fS 8fSf
Y (f)
0 LfS 2LfSf
L = 4IN
CREA
SE G
AIN
BY L
(INSERT L-1ZEROES)
m = 1
n = 2
INCREASE GAIN BY L
Application Note 9603
3-7
General ApplicationsTraditionally, most digital filter applications have been limitedto audio and high-end image processing. With advances inprocess technologies and digital signal processingmethodologies, digital filters are now cost-effective in the IFrange and in almost all video markets.
Digital filters are commonly used for audio frequencies fortwo reasons. First, digital filters for audio are superior inprice and performance to the analog alternative. Second,audio Analog-to-Digital Converters (A/Ds) and Digital-to-Analog Converters (DACs) can be manufactured with highaccuracy and are available at low cost. Thus, the combinedcost of filtering and conversion (if necessary) is low. The costtrades are much more difficult in the 1MHz to 100MHz signalrange, such as the IF ranges of many radio receivers.
While digital signal processing technology can now producecost effective digital filters for IF, the cost or even theavailability of data conversion products are limiting factors.Many IF digital filtering applications are band-limiting anddecimating. In these cases the design engineer must notonly know digital filters, but also understand the effects ofnarrow-band-filtering processing-gain on A/D requirements.Additionally, power dissipation must be considered.Currently, digital IF filter solutions are excluded from lowpower applications such as personal communicationdevices. In contrast, audio frequency digital filters areessential.
IF ProcessingIntersils HSP43216 Halfband Filter IC (Figure 9) canperform a quadrature split on a real signal. In this example,the input signal undergoes anti-alias filtering and is digitizedand passed to the Halfband Filter IC. The quadrature fS/4local oscillator (LO) and mixer circuits on the IC center theupper sideband of the real signal spectrum at DC. TheHalfband Filter itself operates on the resultant complexsignal to filter out the lower sideband, forming a quadraturesignal (a characteristic of which is a single-sided spectrum).Other circuits in the IC then decimate the real and imaginaryoutput by two to eliminate the unused spectral region.
To cite a more specific application, IF processing can beimplemented in a cellular base station using the HSP50016Digital Down Converter (DDC) and two HSP43124 Serial I/OFilters (Figure 10). In this example a 4MHz band of the GSMspectrum has already been mixed to a near baseband IF, hasbeen appropriately anti-alias filtered, and digitized by an A/D.The spectral plot makes the point that aliasing may take placeas long as it does not encroach on the band of interest.
Because this is a channelizing application, there is a Signal-to-Noise Ratio (SNR) processing gain of 3dB for every factorof 2 that the noise bandwidth is reduced. In this example, theprocessing gain is approximately 17dB. As a result, the SNRof the A/D can be 17dB lower than the desired output SNR.The A/Ds Spurious Free Dynamic Range (SFDR), however,must be equal to the desired output SFDR since there is nogain effect on in-band frequency spurs.
FIGURE 9. REAL TO QUADRATURE CONVERSION USING THE HSP43216 HALFBAND FILTER
fS = INPUT SAMPLE RATE, fs = DECIMATED SAMPLE RATE = fS/2
c30 c32 c34 c66
..., x4, x2, x0
c31 c33 c35
REG
ODD TAP FILTER
EVEN TAP FILTER
1, -1, 1, -1, ...COS LO
..., x5, x3, x1
..., R1, R0
..., I1, I0
A/D
...
... ...
...
2
2
FILTER PASSBAND
0 fS/2-fS/2 0 fS/2-fS/2 0 fS/2-fS/2 0
-1, 1,-1, 1, ...SIN LO
-fS/2 fS/2
HSP43216 HALFBAND FILTER
Application Note 9603
3-8
The DDC is a single-chip quadrature down-converter and twostage filter. It is used to tune the channel of interest tobaseband, and to perform narrow-band filtering anddecimation. The Serial I/O Filters are used to apply the GSMfilter shape to the output quadrature data stream. Thisprocess includes decimation by two to modify the outputsampling rate to that required by the GSM Specification. Thisrequirement forces the DDC to decimate at a rate below itsminimum of 64 in quadrature-output mode. This is dealt withby placing a three-times sample rate expander in front of theDDC. The HSP50016 and HSP43216 Data Sheets providegreater detail.
Application-Specific ArchitecturesAs can be seen in the example above, while reconfigurablefunction-specific digital filters provide viable solutions tospecific applications, they may not be cost-effective in highvolumes (annual quantities in the 10 to 100 thousand range).This is where application-specific architectures play a role. Inhigh volume applications, reconfigurable function-specificdigital filters can be used initially for prototyping and refiningan efficient architecture. Then, that architecture can beimplemented in an application-specific device. In mostcases, because of the sophisticated nature of digital filters,efficient architectures are likely to require semicustom orcustom designs.
Imaging/Video Systems With SeparableDimensionsMost digital signal processing applications involving filteroperations on two-dimensional data assume that thehorizontal and vertical filtering operations can be separated.That is, (Figure 11) the image data can be filtered in one
dimension (for example, the horizontal or row dimension)followed by filtering in the other dimension (the vertical orcolumn dimension). This separability greatly simplifies thefilter design compared to a two-dimensional filter.
One and Two-Dimensional FiltersOne-dimensional DSP operations are widely used inimaging or video systems to perform down-conversion orfiltering. In video, purely one-dimensional operations arealmost always in the horizontal dimension because this isthe dimension in which video is sampled in real time.
Two-dimensional operations are used primarily to alter thesize and shape of the image or to filter in two dimensions.The latter operations include highpass filters, to sharpenedges in all directions, or lowpass filters, to limit high-frequency noise or to deliberately soften edges. Animportant case is image resizing, where the input image isresampled to a different sized output image. In reducing theimage size, filtering is needed because simply down-sampling (throwing away pixels) vertically and horizontallyproduces unacceptable aliasing. A two-dimensional filter canbe made from one-dimensional filters (Figure 12). Here, anHSP43168 Dual FIR Filter provides horizontal band-limitingprior to horizontal down-sampling. Its multi-rate capabilitiesallow it to perform the entire decimation operation. Then aHSP48908 Two-Dimensional Convolver is used as a three-coefficient vertical filter to reduce vertical bandwidth prior tovertical down-sampling.
Row and Column FiltersIn terms of algorithms, there is no basic difference betweenrow and column digital filters. The implementation differenceis that horizontal filters have delay elements of z-1 and
FIGURE 10. GSM BASE STATION EXAMPLE
0dB KNEE
PROCESSINGTO BASEBAND
SERIALI/O
2
SERIALI/O
2
A/D
135.281kHz13.0 MSPS
DDC3 72
HSP50016
HSP43124
CONTROL
0 135.417kHz
0dB
-80dB
0 270.833kHz
0dB
-80dB
6.5MHz0
-80dB
0dB
Application Note 9603
3-9
vertical filters, while they have the same structure, areimplemented with delay elements of z-L, where L is the linelength in pixels. The importance of this is that vertical linedelays (z-L) are more costly than horizontal sample delays,because lines are hundreds of pixels long. The result is thatin low cost implementations, vertical filter functions tend tobe very rudimentary (three coefficients or less) ornonexistent. Note that although vertical filters operate onpixels widely separated in time, they are still required toproduce a new output at the horizontal pixel rate becausenew sets of inputs are presented at the horizontal rate.
Video ApplicationsA video A/D, for example the Intersil HI5702, may sample thesignal at twice the required sampling rate to ease analoganti-aliasing filter requirements. This would be followed by ahalfband filter similar to the HSP43216 for decimation by two(Figure 13). To understand the usefulness of this operation,assume the required output rate is 13.5 MSPS (a CCIR 601standard rate). With 4.5MHz input video bandwidth, therequired anti-aliasing filter cutoff with a 13.5 MSPS samplingrate is 6.75MHz. This requires a filter shape factor of6.75/4.5 = 1.5. If 2:1 oversampling is followed by a digitalhalfband filter with a decimation rate of 2, the required shape
factor of the anti-aliasing filter is 13.5/4.5 = 3.0. Given thegenerally stringent passband requirements on video filters,this is a much more cost-effective solution than the moresevere analog anti-aliasing filter. It allows the analog filterdesign to concentrate on passband performance rather thana sharp transition.
Another area that relies extensively on one-dimensionaldigital filtering techniques is NTSC or PAL decoding, whichrequire operations like chroma/luma separation filters,quadrature down-conversion of the chroma information andchroma decimation by two filtering.
ConclusionThis Application Note has presented a brief overview ofdigital filtering and has highlighted the similarities anddifferences of filters implemented in software on generalpurpose digital microprocessors, in function-specifichardware, and in application specific hardware. Digital filtercharacteristics and performance have been compared toanalog filters. Applications of high performance Intersilfunction-specific digital filters in IF and Video signalprocessing were illustrated as examples of cost effectiveuses of digital filters with high throughput rates.
FIGURE 11. GENERAL SEPARABLE FILTER BLOCK DIAGRAM
FIGURE 12. TOP LEVEL BLOCK DIAGRAM OF A RESIZER
INPUTHORIZONTAL
FILTERVERTICAL
FILTER OUTPUT
INPUT OUTPUTJ K
HSP43168 HSP48908
HORIZONTALFILTER
VERTICALFILTER
ANALOGANTI-ALIASING
FILTERHALFBAND
FILTER OUTPUTA/DINPUT
HI5702
27MHz
10 BITS
13.5MHz
10 BITS
HSP43216
FIGURE 13. TOP LEVEL BLOCK DIAGRAM OF AN OVERSAMPLER TO REDUCE ANTI-ALIASING FILTER REQUIREMENTS
Application Note 9603
3-10
All Intersil semiconductor products are manufactured, assembled and tested under ISO9000 quality systems certification.Intersil semiconductor products are sold by description only. Intersil Corporation reserves the right to make changes in circuit design and/or specifications at any time with-out notice. Accordingly, the reader is cautioned to verify that data sheets are current before placing orders. Information furnished by Intersil is believed to be accurate andreliable. However, no responsibility is assumed by Intersil or its subsidiaries for its use; nor for any infringements of patents or other rights of third parties which may resultfrom its use. No license is granted by implication or otherwise under any patent or patent rights of Intersil or its subsidiaries.
For information regarding Intersil Corporation and its products, see web site www.intersil.com
Sales Office HeadquartersNORTH AMERICAIntersil CorporationP. O. Box 883, Mail Stop 53-204Melbourne, FL 32902TEL: (321) 724-7000FAX: (321) 724-7240
EUROPEIntersil SAMercure Center100, Rue de la Fusee1130 Brussels, BelgiumTEL: (32) 2.724.2111FAX: (32) 2.724.22.05
ASIAIntersil (Taiwan) Ltd.7F-6, No. 101 Fu Hsing North RoadTaipei, TaiwanRepublic of ChinaTEL: (886) 2 2716 9310FAX: (886) 2 2715 3029
Application Note 9603