MASSACHUSETTS INSTITUTE OF TECHNOLOGY LINCOLN LABORATORY INITIALIZATION FOR IMPROVED IIR FILTER PERFORMANCE E. S. CHORNOBOY TECHNICAL REPORT 828 31 DECEMBER 1990 LEXINGTON MASSACHUSETTS ABSTRACT A new method for initializing the memory registers of Infinite Impulse Response (IIR) filters is presented, This method is shown to significantly reduce the initial transients which accompany the tilteting of finite-length data sequences. Unlike previous methods, the proposed method makes no a priori assumptions regarding the input signal. Therefore, the method applies equally well to a variety of IIR designs and applications. The methad does require a leading segment of the input data for initialization computations before filtering can begin. For this reason, the method is best suited for signal-processing applications in which batch processing of the data is employed. In particular, the method could prove very useful in situations where data is at a premium and only shorr-length sequences are available, because almost sdl data is usable after filtering. Applications using sequerrtial-processing of data can be accommodated when delays at the beginning of a processing segment can be tolerated. ——...,- TABLE OF CONTENTS Abstract ii List of Illustrations iv 1. INTRODUCTION 1 2. IIR TRANSIENTS AND INITIALIZATION 3 2.1 State-Variable Description 3 2.2 Complex-Exponential Input 4 2.3 Vector-Space Setting 8 3. I 4. 2.4 Implementation 10 RESULTS 11 3.1 Initialization from Partial Observations 11 3.2 Average-Output-Magnitude Response 13 CONCLUSIONS 14 REFERENCES 15 ,. 111 LIST OF ILLUSTRATIONS Page Figure No 1 The average-output-magnitude frequency response of a four-pole elliptic fIR filter (after Fletcher and Burlage). 2 2 Conventional direct-form implementation of a second-order IIR digital filter. 3 3 Transfer-function magnitudes for a second-order (high-pass) IIR filter 5 4 Filtering a short-length data sequence—zero-initialized transient-response characterization. 6 F]ltering a short-length data sequence—step-initialized transient-response characterization. 7 5 6 7 8 Filtering a short-length data sequence—projection-iriitialized transient-response characterization. 11 Initialization using partial observations-spectral resonance vs. input frequency. 12 magnitude at system The average-output-magnitude frequency response of a four-pole elliptic IIR filter-projection-initialized results. ,. iv 13 1. INTRODUCTION Comparisons between Finite Impulse Response (FLR)and Infinite Impulse Response (IIR) filters are often based on the computational complexity 1required to achieve a given frequency response. For aPP]icatiOns requiring fikers with sftarp cutoffs (narrow transition regions), IIR filters are generally considered better because of the large filter length required in an FIR implementation. Thk d!stirrction also occurs with (or is compounded by) applications in which the unfiltered data sequence has a short ovemfl length or comprises shor-i-lengdrnon-contiguous segments.z In such cases, FfR tilters with sharp cutoffs can become impractical, requiring too great a proportion of the &ta for initialization of the filter taps. Because the all-zero portion of a comparable IIR filter is considerably shorter in length, an HR filter could conceivably be used in situations with small-sized data sets. Unfortunately, the transient response of an IIR filter dktorts the output of the filter on startup, rendering the situation similar to that of the FIR filter (i.e., an initial segment of data is consumed to initialize the filter in the case of IIR filtering, ontput sampling is delayed until transients are significantly reduced). For an FIR filter, the amount of data lost is equal to the filter length N, by one optimistic rule of thumb, a comparable IIR filter would require approximately the same N samples to significantly reduce its transients. To deal with this problem, it is often suggested that state initialization (i.e., initialization of the IIR memory registers) be used to reduce the HR startup transients. Tbe most common method, which is further described below, is based on approximating the unfiltered signal by a step input. This rcpon presents a new alternative initialization method derived from a state-variable description and vector-space view of the transient problem. In contrast to the step-input approximation, this new method is equally suited to all type IIR structures (i.e., low-pass, bandpass, or high-pass). , I i J Fletcher and Burlage, [2] and [3], working in tbe context of radar-clutter filtenng3 for Moving Target Indicator (MTI) radar, proposed a method for improving the performance (i.e., reducing the transients) of IIR implementations in sampling situations as described above. However, their method is specific for IIR filters designed to filter low-frequency ground-clutter targets; it assumes that chrtterretum signals can be modeled as step inputs with magnitude equal to that of the first recorded data sample (referred to as step initialization). Assuming that the ground-clutter step dominates the desired input signal, an appeal to the final-value theorem for Z-transfomrs can be used to calculate an approximation to the steady-state values of the filter memory registers. In the resulting procedure, filter memory registers are loaded with a scaled version of the leading data sample (the scaling factor is predetermined by the filter coefficients) prior to the normal filtering of the data. The method’s simplicity is clearly an advantage, but Figure 1 illustrates the limited extent to which the filter’s average-output-magnitude frequency response can be improved. As can be seen from the figure, the response obtained using the initialization method is still far from the desired steady-state response; in particulm, f-he inability to match the extent of the stop-band width is a significant deficiency. Note that neither delay sampling nor delay sampling after initialization offered a substantial improvement toward approximating steady-state performance. Development of the initialization method presented in tfrk report was motivated by Llncohr Laboratory’s work with high-pass filters and clutter removal for pulsed-Doppler radars. An initial objective was 1 ,! \ ,$,432., 0.31 ------ ZERO INITIAL12zTION — . STEP INITIALIZATION — MAGNITUDE RESPONSE i)’ I o n/4 Z/2 INPUT FREQUENCY Figure 1. The average. output. nurgnitude frequency response of a four-pole el[ipric IIR jilter (afrer Fletcher and BurlogeJ. The dotred lines ilhssmrre average-mognirude responsesfora zero-initialized flkr; responses were computed by summing the magnitudes of output samples 0-31 and32-63. Therefore, the lower of the WOP1O(S (from samples 3263) represents the average response profile obtained ofier delay-sampling 32 samples. Dashed lines represenr the Corresponding pro$ies for the srep-iniriolizarion fiher. The solid curve shows the steady-sraie magnitude response of the filter. Responses are ploued forpositi.e frequencies out to a frequency equal to one half the Nyguisr value. to improve upon the quantitative results obtainable by step initialization (F@re 1). However, this new method is considered to be of general interest because it makes no a priori assumptions regarding the content of the input signal or filtering application; the results apply equally well with any design IIR filter. However, the improvements realized with this new method are obtained at the cost of additional computati ens; in contrast to using only the first data point for initialization, the proposed method requires a leading segment of the input sequence for initialization computations.4 Hence, real-time applications with sequential processing must be amenable to delays at tbe start of a data block to acquire data for initialization. For real-time applications using batch processing, thk is not a problem. The required computations are straightforward--dot products with real-valued weighting vectors—and the additional computations are not viewed as a prohibitive handicap. I I 2 2. IIR TRANSIENTS AND INITIALIZATION Primary attention will be focused on the response of a general second-order filter, understanding that higher-order filters can be obtained by cascading. Extension of the solution to cascaded smuctures is outlined briefly at the section’s end. All filter coefficients are assumed to be real valued; a block diagram for the conventional direct-form implementation, which is assumed, is provided for reference in Figure 2. W,*.2 x(z) Figure 2. Con.en!ional direct$onn implemenrotion of a second.or’derIIR digimljlhcr: selecting starting values for the jilrer memory regisrers m,(n) {$ M)(z)] and nl, (n) (L M2 (z)), the object of IIR inirio/iza1i0)7. 2.1 STATE-VARIABLE DESCRIPTION For a general second-order filter, complex-valued input x = {X(n); n > – -) and output Y= {Y(n); are related by the defining equation n >- -] y (n)= a~ (n) + a, x (n-1)+ afl (n-2) – Ply (n-l) - /f2v (n-3 which correlates with the Z-transfer function definition A Y(z) H(z)=—= x (z) a. + a,:-’ + LZ2Z-2 1+p,z-1 +/32# The internal state of the filter section is specified by the vector ‘(”)=[%1 {LM(Z)’[231 (refer to Figure 2), and the following state-variable description of the filtering equations follows directly: A’f(rr) =BM(rl-l)+cx(n) (la) Y(n) =ArM (n-l)+ ad(n) (lb) and where With only a finite-windowed version of the data, {x (n); O < n < N) available, the state-transition equation is written M(n)= BnM_l + ~Bn-k C X (k), (2) k=l where M-l= [m,(-1 ) m2(-1)]r is the parameter describing the initial state of the filter section. As M_] is generally undefined in applications, the goal of IIR initialization is selection of a value fl_l that is appropriate for the filtering application, The simplest form of initialization is to take ~-1 = @ (the null vexxor),which will be referred to as zero initialization. In step initialization, fi-l = {1 + /31 + 921-’ [x (0) x (0)]r is chosen to eliminate transient response due to zero-frequency energy. 2.2 COMPLEX-EXPONENTIAL INPUT Working the problem for complex-exponential input allows solving directly for the transient contribution to the output response. A one-sided Z-rrarrsform analysis fora step-modulated’ complex-exponential input, x(rr) = e~%(n), yields the transient output response (assuming for now that M_l =0) y,r(n). –ffD(e@)AT 16(n)+r . I [ /321u (n-2) Sinrre Bu[n_~)_rn–2 sin O - — SW-1)9 sin 0 (3) ~(ej~), 1 where 1 HD(ej@) = (1-rej(9-@j)(f g..ejru ) -re-j(@+o))’ .[’1 = ‘-~m e-J2(0 ‘ and I is the identity matrix. Note that in Equation (3) f) and r follow from a polar representation for the filter poles (i.e., P = re*j~ and are related to the filter coefficients by ~1 = -2r COS6and ~2 = ? ([1]. PP. 150-162). The vector E (#”) can be viewed aa an extension of input samples to times –1 and -2. The gain HD (ef~ is from the magnitude response of the all-pole (or recursive) component Of the filter. Because HD (.$) is determined solely by the filter poles, signal transients can be disproportionately larger for input energy in the stop-band regions (see Figure 3). Assuming the processing of short-length data sequences, it is helpful to have an example/characterization Of the transient-response effect, both in the frequency and time domains, to help visualize the above complex exponential case as well as to provide, a basis for later comparisons. Thk effect is 4 25 -50 x x/2 0 INPUT FREQUENCY Figure 3. r’mnsfer-jlencrion ttugnitudes for a second-order (high-pass) IIRfMer: the freqMenc.v magnitude response, /H(W /,ondthedenominatorrespOnse, /h’.(da) /, are bothplorte-d. Thedenomimtovresponse the all-pole (recursive) portion of the filler. isrherespomedue to introduced in Figures 4 and 5, which were derived from the processing of 64-ssrnpIe complex-exponential sequences. Input signals were generated with frequencies spanning the range O – rr radians. Each sequence was processed by a second-order high-pass IIR filter, whose magnitude response is plotted in Figure 3. The responses in Figure 4 result from zero-initialized processing of the sequencex those of Figure 5 from step-initialized processing. Each figure contains time-domain plots of the trmrsient-component magnitude (left side) and penodogram spectral estimates of the entire output sequence (right side). In the time-domain plots, oscillation near the resonant frequency and a characteristic # decay sre both evident as functions of sample number. In the zero-initialized case, the magnitude of the transient response vs. input frequency (the axis going into the page) indicates modulation by IHJe!~ 1, The stepinitialized case has a similar characteristic, but shows a msrked improvement at zero frequency and a significant magnitude increase for frequencies in the filter’s passband. The perindogmms both indicate two primary spectral contribute@, one a positive frequency (sweeping the range O – rr and comesponding to the input-signal frequency) and the other a real sinusoidal component [energy at both + 9, see Equation (3)], attributable to the filter’s transient response. The characterization in tfds figure can be correlated witfr that presented in Figure 1, in which the averageoutput-magnitude frequency response measures the totul output energy correspondkrg to a given sinusoidal input. Each spectral analysis includes a projection (onto the Magnitude vs. Input-Frequency plane) of a component attributable to the transient response. In the case of zero initialization, the shape of thk component is due to weighting both by IHJd? I and the geometric decay of P; however, the irrftuence of Ifl~(d~ 1 is still apparent. For step initialization, this spectral component clearly illustrates improved performance at zero input frequency but illustrates an apparent compromise at higher passband frequencies. 5 ,,, SPECTRAL TRANSIENT RESPONSE MAGNITUDE ANALYSIS ,,,4s2.4 ,f-------------r /’ /, o 4------------- t .//l///{------------/ -------------- t 31 630 SPECTRAL SAMPLE NUMBER FREQUENCY Figure 4. Filtering a shorr-lengrh dam sequence—zero-initialized transienr.response characreri~ation: time-domain values of the transienr-componem magnitude (lefI side) and windowed-periodogram (Kaiser weighting) spectral estimares of the complete 64-poinr output signal (righr side) ore plotred, Input signals were sampled complex exponenrial$ having frequencies in rhe range O 10 n (plots are indexed with respect m input-signal frequency from foreground to background). Each input sequence wax processed by a second-order l[R (high-pass) jilter stage (see Figure 3). A[lfilrer memory registers were zeroed prior to fih@ring. Va[ues for the transient-response magnitude are represented on a linear-mugnirude scale: those for the specwal analysis, a log-magnitude scale (values are expressed in dB relative to a?z arbitrarily chosen level). The rransiem response introduces a signal combonenr with energy measurable near system resonance. A shaded plot of the spectral compon>nt near resonance is projec;ed onto the Magnitude vs. lnpui Frequency plane. 6 ) -.. . . .. .. . .. --------i NANSICN ----—- MAGNITUDE if --- ---------- ‘“+-------------t // ------------.//’/’/j / / .------------- I o 31 SAMPLE NUMSER . SPECTRAL I HtSFUNSt .. . ANALYSIS 1- r- ~30 Figure 5. Fihering a short-length data sequence—srep-initialized transienr-response characterization: the P1O(Sin this f7gure are companion plots to those of Figure4. The description of thisfigure is the same as in thepreviousfi@re, except that theseplots resuhfromprocessing the dam wi~h a srep-ini~ializedjilter. Note: in contrast to rhepreviou.sf?gure, there is no transient response corresponding to a zero-frequency input. However, this desired attenuation of the transient response is quickly lost as the inpur frequency increases, For input frequencies in thejilrer’s passband, the magnitude of the transient response is actually greater than in rhe zero-initialized case. Continuing the one-sided Z-transform analysis to compute the response to M_l (i.e., X = 0, which also provides dre homogeneous-equation solution), the same form as Equation (3) is obtained, as is the concision that M-l =HD(d”~ z (d”? yields y,, (n) = O for the case of complex-exponential input. As a special case, taking so= O results in M.l = { 1 + ~, + ~2]-1 [1 1]~ which is the step-initiahzed solution. The transient response to any step-modulated signal must have the form of Equation (3), because by direct analogy with the sohstion of second-order differential systems, the transient response must have the form of the homogeneous solution to the second-order difference equation. By viewing the transient component {y,,(n); Os n < N } as an element in an N-dimensional vector space, the conclusion is that the transient response (for a second-order system) is restricted to a two-dimensional subspace. TMs also can be seen in Equation (3) if E (~? is viewed as an arbitrary 2 x 1 weighting vector (representing the only degrees of freedom). Hence, for N sufficiently larger than 2, this constraint on the transient component may be used to advantage for initialization. Thk is the basis for the proposed initialization method, referred to as projection initialization. 2.3 VECTOR-SPACE SETTING Let input and output sequences be viewed as N x 1 vectors in a complex-valued vector space: X, Y ● C, with Y= ~ (0) y (1). y (N-1)]~ and X = [x (0)x (1) x (N-1)17.By componentwise application of Equations (1) and (2), linear operators F (C2 + d“) and G (C’’”+ ~) can be defined which describe the relationship between input, output, and initial conditions: (4) Y= FJ41+GX Specifically, F is the N x 2 matrix AT [1 *TB F . *TBN-l and G is the N x N lower triangular matrix ao ~T~ ATBC o 0 0.-00 a. o 000 ATC 0 000 @-o 000 a. ... G= AT~ ~TBN-2c { I ATBN-3C o 0 ATBC ATC a. O ATB2C ATBC ATC a , .. In the context of the initialization problem, the filter output can be viewed as bring decomposed into steady-state and transient components Y = Y,, + Y,, , where following from the previous section Y,, ~ R(F) (the range of F) can be declared. Ideally, the goal of initialization would be to obtain Y,r= 0; or, equivalently, to find an appropriate criterion for minimizing llY,jl. Neither problem can be formulated directly; it is necessary to work an approximate problem. In particular, the objective is to make the transient distortion small, or at least reasonable for a practicable filter. The projection operator [4] PF = F (FTF)-’FT can be used to provide a decomposition for d, and the output response can lx written as the sum of two orthogonal components: Y= (1 –PJY + PFY. The ortfrogorralityof the decomposition provides the relation WI? = ll(LPF)Yf12+ llPFYll* which, because PF is a projector for tbe transient-response subspace, can also be written IIY112 = 11(1-PF)Y,J12 + IIPFY,, + Y,J12 The first term on the right, II(J– PF )Y,, 11,does not depend o! M_l. If the treatment of llPrY,, + Y,rII could be rationalized as an approximation to IIY,,11,an initializing M_l could be selected as the solution to (5) Proposition 1. For the second-order IIR filtering problem described above, selecting ti_l = -( FrF)-’ FT GX (6) ensures that where II. IIrepresents the normal Euclidean norm. In the case of complex-exponential input, tbe transient-component magnitude will be proportional to the filter’s overall magnitude response I H (d? I instead of the denominator magnitude response Iff~ (#.I 1. The most significant consequence is that transients elicit~d by input-signal energy in the stop band are greatly attenuated, because the filter’s zeros now play a role in determining the transient response. The next section continues the previous numerical examples and illustrates the improved stopband performance. ‘. ,, Proof. Tbe solution to Equation (5) is obtained by solving PFY = O, which, after substituting Equation (4) and rearranging, becomes FM_l = -PFGX. Equation (6) follows, given the definition of Pr For thk choice of M_l we have Y,,= -P,J’~~; therefore, using Parseval’s relation, (PF Lr.4rrga projection operator and therefore idempotent, has a spectral norm of 1). 9 2.4 IMPLEMENTATION Implementation of Equation (6) is straightforward, as the matrix (FTF )-lF~G is completely predetermined by knowledge of the filter coefficients. The coefficients of the weighting matrix are all real valued, tfre inititi]zation computations only require real-valued dot products between input data and vectors of weighting coefficients. For a second-order filter, four srrch multiplications sre required one each forthereal andimaginary components of both memory registers. Once arrinitialization vector has been computed, the initialized IIR filter can be implemented using stmrdard methods. Alternatively, the output Ycan also be computed duectly by implementing the matrix multiplication Y = (1- PF )GX. Higher-Order Filters: Cascading. For a cascade of second-order sections, repeated application of ~~ation-(4) can derive a relationship between input and output that is analogous to Equation (4): Y = FM_l + GX, where n Fi3 (fiGi)F1 [ i=2 ~(~GiF2 j .“”[ GnFn_l i =3 ...MJ.ln T, [ ‘n 1 ‘ M-l 4 [M:l,, M!1,2 and Fi, Gr and M_l,i represent $e coefficient matrices and initialization vector for the i ‘h filter stage. Note that now~is Nx2qand M_1is~qx I, where rfisthe number ofsecond-order stages intbefdter. Correspondingly, rbedimensionoff?(n will be 2q (assuming no degenerate cases). The initialization solution here is wh~lly analogous torhe second-order case, and the solution [Equation (6)] applies,with the substitution of M_l, ~,, and ~ for M.l, F, and G. 1 10 1 I 3. RESULTS The previous numerical example is completed by including the case of a projection-initialized filter, i.e., a filter initialized by Equation (6). The characterization is presented in Figure 6. Referring to the time-domain plots, with projection initialization there is considerable improvement in the stop-band extent of transient reduction; there is also a reduction in transient magnitude for much of the passband region as well. Only for input-signal energy near the resonant frequency is there an obvious increase in transient magrrimde. Depending upon the application, this increase may not be significant, as the transient component is near the resonant frequency, giving rise to a spectrrd component corresponding to the input frequency. The accompanying periodogram plots clearly illustrate the motivation for Equation (6). Viewing the ma nitude of the transient-respnnse spectral conrnbution (vs. input frequency), a modtrlalion by IH (e?? “f is clearly evident. TRANSIENT RESPONSE MAGNITUDE --------------- SPECTRAL ANALYSIS ,6,,32< - “i------------~ /,;/;{_____________ I / / ;,_ ( -------------- 1 / g =~- 1 0 1 ~30 31 SAMPLE NUMBER SPECTRAL FREQUENCY Figure 6. Fihering a short-length data sequence—projection-initialized {mnsienr-resporrse characterization: the description of thisfigure is the same as that ofFigure 4, excepr durr the data wereprocessed with api-ojecrion-initio[ized filter. in comparison IOFigure 5, there is sign$cant attenuation of the transient-component magnitude throughout most of the stop band and for a large portion of the passband as well. The magnitude of the rmrrsienr. response spectral component indicares modulation by the fiher’s frequency. respon~e magnitude. 7?ris is in contrast to the two previous cases where the denominator response modulares the transient-response energy. 3.1 iNITIALIZATION FROM PARTIAL OBSERVATIONS To thk point it has been assumed that all data to be filtered are used for initialization; this need not be the case. For data processed sequentially (as opposed to batch) this usually cannot be achieved. 1 However, if the sequential processing can afford a delay of a number of data samples, initialization based on these data can be used. Figure 7 summarizes the effect of initialization sample size by plotting magnitudes of the transient-component spectral cOntibutions for partial observation sets of 64, 48, 32, and 16 samples. The top plot for 64 samples, the entire data set, corresponds to the shaded (oblique) plot in Figure 6. Each panel also contains a plot of the corresponding magnimde for the zero-initialized case (see Figure 4). These results show that the methnd is still exceptionally effective at reducing the transients in response to input energy near the filter zero. !,,.32., o -20 40 0 .20 a ~ .~o ti ~ $0 z! -20 -40 0 -20 -40 0 nlz z INPUT FREQUENCY Figure 7. Initialization using parrial observations-spectral magnitude at system resonance vs. input frequency: spectral magnizude at resonance is plotted vs. inputfrequency. The plots are derived, as in Figure 6, from projectioninitialized high-pass faltering of 64-point input sequences. Four panels are illusrmred corresponding to using the first 64,48,32, or 16 somples for initialization computations. The top panel, 64 samples, uses all available data and is the same as the obliqueprojection shown in Figure 6. For reference, eachpanel also contains oplot of the spectral magnitude corresponding to zero-initialized processing. Attenuation of the transient respOnse fOrfrequencies near thefll~er zerO is well preserued. 4. CONCLUSIONS The transient response that occurs at the start of an HR filtering pass usually results in the discardkig of usable data to aflow for fIR tmrrsient decay. in practical applications, much of the dlftlculty with transients stems from their dispmpordonately large magnitude in response to input energy in stop-band regions. This occurs because the trarrsient response magnitude is determined by the filter poles. Projection initiafizatiorr, which takes into account tfte location of the filter zeros, was shown to significantly reduce the transient-response magnitude in response to input energy near the filter wos. Hence, regarding the filtering of short-length data sequences, the method can improve tfte effective stop-band performance of an HR filter arrdsubstantially reduce the amount of data dkcarded. The derivations arrd comparisons presented are based on a starrdard second-order filter definition; extension to higher-order filters was demonstrated by cascading. Tfrk does not imply that the method only works for even-ordered filter structures. Odd-ordered filters can be dealt with by placing the odd stage in second-order form (with some degenerate coefficients). The solutions presented can apply if a generalized inverse interpretation is applied to the solution. Because the method requires an initial segment of data, it is ideally suited for applications where data is processed in batch mode. Sequential data processing can be accommodated only when delays at the beginning of a processing block can be tolerated. However, the method can improve performance, using only a small initial segment for the initialization computations. 14 REFERENCES 1. M. Bellanger, Digital Processing of 2. R.H. Fletcher and D.W. Burlage, “Ao irritialkation technique for improved MTI performance in phased array radars, ” in Proceedings of the IEEE 60, 1551-1552 (1972). 3. R.H. Fletcher arrd D.W. Burlage, “Improved moving-target-indicator filtering for phased array radars,” U.S. Army Missile Command, Redstone Arsenal, Alabama, TechnicaJ Report RE-73-17 (1973). 4. AS. Householder, The Theory of Matrices in Numerical Analysis, New York Inc. (1975). Signals: Theory and Practice, John W,ley and Sons ( 1984), 15 Dover Publications,