Design and Improvement of Flattop Windows with Semi-Infinite Optimization To Tran, Ingvar Claesson, Mattias Dahl Blekinge Institute of Technology Department of Telecommunications and Signal Processing Box 520, SE-372 25 Ronneby, Sweden [email protected] [email protected] [email protected] ABSTRACT Digital and analog window optimization problems are often characterized by a few number of variables with many constraints. In some cases the optimization problem becomes semi-infinite, i.e. a finite number of variables with an infinite set of constraints. This paper presents a method for flattop window design and enhancement using the Dual Nested Complex Approximation (DNCA) algorithm. Flattop windows can be used for accurate amplitude measurements in spectral analysis and can also be used to design FIR filters with very high stopband attenuation. This paper proposes using the DNCA scheme to solve the optimization problem, due to its low computational complexity and memory consumption. It can be run on any desktop computer. The framework of the DNCA scheme is presented together with two examples; one concerning the design of an enhanced version of the ISO 18431-2 flattop window and the other concerns the design of a flattop window which is comparable with the commercial P-401. 1. INTRODUCTION Spectral leakage is a contributing factor to errors in spectral analysis. For this cause, a window is normally applied to reduce the effect of leakage. A window can be seen as a function which balances between amplitude accuracy and frequency resolution. In cases where the frequency resolution is of importance, the classical windows described in [1] are normally preferred. For accurate amplitude measurements or instrument calibration, flattop windows are often used. A flattop window is characterized by high sidelobe attenuation with a wide and flat mainlobe, thereof the name ”flattop”. Classical windows in turn are characterized by a narrow mainlobe and relatively low sidelobe attenuation compared with the flattop windows. For many problems of engineering interest, the class of signals being sought are periodic, which leads quite naturally to the use of periodic windows [1]. Beside spectral analysis, windows are commonly used for FIR filter design through the ”window method”. In short, the window method truncates an ideal impulse response of a filter with infinite duration by multiplying it with a window function to obtain a realizable, finite and linear phase FIR filter. From filter design, it is known that there are four types of linear phase FIR filter; symmetric or anti-symmetric filters with even or odd length [2]. The use of symmetric windows in filter design is therefore a necessity to obtain linear phase characteristic. The main difference between windows for spectral analysis and windows for FIR filter design, is that spectral analysis requires a periodic window while filter design requires a symmetric window. A symmetric window is as its name indicate, symmetric around its midpoint, while a periodic window have a missing endpoint. The missing endpoint can be considered to be the beginning of the next period if the window is periodically extended according to the periodic extension property of the DFT [3]. A common way to construct windows, symmetric or periodic, is by using the summation of shifted Dirichlet kernels. This construction method is convenient because the window shape in the time and fre- quency domain are mainly characterized by a few number of window coefficients. Given a set of window coefficients, one can generate a symmetric or periodic window of any length. The task of window design, is the task of obtaining a set of window coefficients which fulfills a given specification. In most window design cases, only the magnitude response is specified. Since no information about the phase is given, it is convenient to assume that the phase is linear, which naturally leads to the design of symmetric windows where the phase is given a priori [2]. The design of symmetric windows will in turn lead to a real valued optimization problem with a finite number of constraints. Optimization of symmetric windows is characterized by a few number of variables and a huge number of constraints. In contrast, the task of window enhancement assumes that a set of window coefficients is given, which is the target to the enhancement. In such cases, the design might be based on a periodic window since the frequency response of the periodic window can be computed given the window coefficients, which yield amplitude and phase information. The related optimization problem for periodic window enhancement will be of semi-infinite nature, i.e. the number of variables is finite, but the number of constraints is infinite, due to the complex valued constraints. This paper presents a method which can be used to design new flattop windows or enhance existing flattop windows. The design is based on the minimax criterion (L∞ -norm), which is related to magnitude response specification. As mentioned previously, the optimization procedure is either semi-infinite or has a huge number of constraints, depending on whether the optimization is based on a symmetric window or a periodic window. This paper uses the Dual Nested Complex Approximation scheme for both design and enhancement, since it is very efficient in solving conventional and semi-infinite optimization problems. In Section 4, the framework of the DNCA scheme is presented, which works for finite and semi-infinite, linear and quadratic optimization problems. Two examples are included and discussed in Section 5. The first example considers the design of an enhanced version of the upcoming international standard flattop window, the ISO 18431-2 flattop window. The design procedure is in this example based on a periodic window, since the ISO flattop window coefficients are public. The second example considers the design of a flattop window which is comparable with the P-401 flattop window, based on a symmetric window, since the window coefficients for the Hewlett Packard flattop window P-401 are commercially protected. Note that even though the design is based on a symmetric window, the obtained window coefficients can be used to generate a periodic window and vice versa. 2. PROBLEM FORMULATION A common way to construct windows is by using the summation of shifted Dirichlet kernels. A discrete time window which is constructed using the summation of shifted Dirichlet kernels is given by µ ¶ K−1 X 2πkn k w(n) = (−1) ak cos , n = 0, . . . , N − 1 (1) Nx k=0 where K denotes the number of window coefficients ak , N denotes the length of the window and Nx determines if the window w(n) is symmetric or periodic. If w(n) is symmetric, then Nx = N − 1 and if w(n) is periodic, then Nx = N . The Fourier transform of Eq. (1) is given by à ¶! µ N −1 K−1 X X 2πkn k W (ω) = e−jωn (−1) ak cos N x n=0 (2) k=0 By changing the summation order and rearranging the variables, we obtain ¶ µ K−1 N −1 X X 2πkn −jωn e W (ω) = (−1)k ak cos Nx n=0 k=0 (3) Eq. (3) can be written as ´ 2πkn 1 ³ j 2πkn e Nx + e−j Nx e−jωn 2 n=0 k=0 ¶ µ ¶¶ µ µ K−1 X 2πk ak 2πk (−1)k +D ω+ = D ω− 2 Nx Nx W (ω) = K−1 X (−1)k ak N −1 X (4) (5) k=0 where D(ω) is known as the Dirichlet kernel [4] presented as D(ω) = e−jω( N −1 2 ¡ N¢ ) sin ¡ω 2 ¢ sin ω 12 (6) Equation (5) clearly shows that any window constructed using Eq. (1) has a Fourier Transform which consist of a summation of shifted Dirichlet kernels. Some of the most well known classic windows which are constructed using Eq.(1) are for example the Hanning, Hamming and the Blackman window. 2.1. Vector Notation Introducing vector notation, Eq.(3) can be written as W (ω) = φT (ω)a where φ(ω) = PN −1 e³−jωn ´ PN −1 2π1n e−jωn n=0 (−1) cos ³ Nx ´ PN −1 2π2n 2 e−jωn n=0 (−1) cos Nx .. . ³ ´ PN −1 2π(K−1)n (K−1) (−1) cos e−jωn n=0 Nx n=0 1 (7) , a= a0 a1 a2 ... (8) aK−1 where φ(ω) is a response vector and a the window coefficient vector. For a periodic window, i.e. Nx = N , φ(ω) in Eq.(8) becomes a complex valued vector. In contrast, if Nx = N −1, corresponding to a symmetric window, φ(ω) can be made real valued. This is achieved by using the a priori information of the phase for a length N symmetric window. The phase ϕ(ω) for a length N symmetric window is given a priori by µ ¶ N −1 ϕ(ω) = − ω (9) 2 By removing the phase from from the response vector, φ(ω) can be made real valued. This is achieved by multiplying the the response vector with e−jϕ(ω) . 3. THE WINDOW DESIGN SPECIFICATION Consider the following window design specification ½ min ||φT (ω)a − Wd (ω)||∞ , ω ∈ Ωs |φT (ω)a − Wd (ω)| ≤ σp (ω) ω ∈ Ωp (10) where Wd (ω) is the desired window specification, Ωp and Ωs denotes the passband and the stopband, respectively and σp denotes the tolerance in the passband. The objective of Eq. (10) is to minimize the max-norm error in the stopband, subject to the constraints given in the passband. A max-norm minimization in the stopband corresponds to minimizing the peak sidelobe level. The minimization of the peak sidelobe contributes to reduce the spectral leakage effect and reduces the amplitude error. By introducing a new variable δ = max |φT (ω)a − Wd (ω)| = ||φT (ω)a − Wd (ω)||∞ , ω ∈ Ωs , Eq. ω∈Ωs (10) can be rewritten as min δ |φT (ω)a − Wd (ω)| ≤ δ ω ∈ Ωs T |φ (ω)a − Wd (ω)| ≤ σp (ω) ω ∈ Ωp (11) Note that the extra independent variable δ is active only in the stopband and the amplitude tolerance σp (ω) is only active in the passband. The non-linear constraints in Eq. (11) makes the problem difficult to solve as it stands. Depending on whether the design is based on a symmetric or periodic window, Eq.(11) can reformulated. 3.1. Periodic window, a semi-infinite formulation In periodic window design, both φ(ω)a and Wd (ω) are complex valued in Eq.(11). The problem formulation in Eq. (11) corresponds to a non-linear optimization problem, which is difficult to solve as it stands. According to the real rotation theorem [2], a magnitude inequality in the complex plane can be expressed in the equivalent form © ª |z| ≤ γ ⇐⇒ < zejθ ≤ γ , ∀θ ∈ [0, 2π] (12) where <{·} denotes the real part of {·} and the phase θ belongs to the infinite set Θ = [0, 2π]. By making use of equation (12), the design problem can be formulated as min ©¡δ , subject to ¢ ª < ©¡φT (ω)a − Wd (ω)¢ ejθ ª ≤ δ ω ∈ Ωs , ∀θ ∈ Θ (13) < φT (ω)a − Wd (ω) ejθ ≤ σp (ω) ω ∈ Ωp , ∀θ ∈ Θ The linear program in equation (13) is categorized semi-infinite since the number of unknown variables are finite but the constraint set is infinite due to the continuous phase θ ∈ [0, 2π]. For practical implementation issues, Ωp and Ωs are assumed to be a finite subsets of Ω = [0, π], i.e. ωi = [ω1 , ω2 , . . . , ωI ], i = 1, . . . , I. In the discrete frequency domain the design problem can be formulated as min ©¡δ , subject to ¢ ª < ©¡φT (ωi )a − Wd (ωi )¢ ejθ ª ≤ δ ωi ∈ Ωs , i = {1, . . . , I} , ∀θ ∈ Θ (14) < φT (ωi )a − Wd (ωi ) ejθ ≤ σp (ωi ) ωi ∈ Ωp , i = {1, . . . , I}, ∀θ ∈ Θ Observe that the the approximation problem in equation (14) is with respect to the complex valued formulation due to the continuous phase θ ∈ [0, 2π] and is not affected by the discretization of the frequency domain. 3.2. Symmetric window, a finite-dimensional formulation In symmetric window design, both φT (ω)a and Wd (ω) are real valued, after removing the constant phase ϕ(ω), which is determined by the length of the window. By using the fact that an absolute magnitude inequality constraint can be written as ½ x≤b |x| ≤ b ⇔ , (15) −x ≤ b eq. (11) becomes min δ (φT (ω)a − Wd (ω)) −(φT (ω)a − Wd (ω)) (φT (ω)a − Wd (ω)) −(φT (ω)a − Wd (ω)) ≤ ≤ ≤ ≤ δ δ σp (ω) σp (ω) ω ω ω ω ∈ Ωs ∈ Ωs ∈ Ωp ∈ Ωp (16) For practical purpose of the implementation of the algorithm, Ωp and Ωs are assumed to be finite subsets of the continuous frequency domain Ω = [0, π]. In the discrete frequency domain ωi , where i = 1, . . . , I, the design problem can be formulated as min δ ≤ δ ωi ∈ Ωs (φT (ωi )a − Wd (ωi )) −(φT (ωi )a − Wd (ωi )) ≤ δ ωi ∈ Ωs (17) T (φ (ω )a − W (ω )) ≤ σ (ω ) ω ∈ Ω i d i p i i p −(φT (ωi )a − Wd (ωi )) ≤ σp (ωi ) ωi ∈ Ωp Equation (17) can now be formulated as a minimax optimization program in standard form, which can be solved using conventional available linear programming software, such as simplex and interior-point methods. However, due to the huge number of constraints, conventional linear programming software might be both time consuming and memory extensive. 4. DUAL NESTED COMPLEX APPROXIMATION ALGORITHM The Dual Nested Complex Approximation (DNCA) algorithm has shown to be very efficient in solving semi-infinite linear and quadratic programs [5, 6], i.e. optimization problem with a finite number of variables (unknowns) and infinite number of constraints. Even though the optimization problem as formulated in Sec.3.2 is not semi-infinite, the DNCA algorithm is still a competitive choice since it is capable to reduce the computation time significantly and is less memory consuming compared to conventional optimization software. This section presents the general framework of the DNCA scheme, which yields for finite and semiinfinite, linear or quadratic optimization problems. 4.1. The Approximation Problem A general optimization problem can be formulated as f (x), min x (P ) gα (x) ≤ 0, n x∈X ⊂R α ∈ A ⊂ Rk (18) where x is an N × 1 variable vector, f (x) a convex continuous function, X a convex restriction set, A an infinite or large index set as a compact subset of Euclidean k-space, and gα (x) a continuous constraint function which is convex for any fixed index α. 4.2. The DNCA-LP Optimization Algorithm The Dual Nested Complex Approximation Linear Programming algorithm to solve Eq. (18) is outlined below. Let A(k) denote a sequence of subsets of the index set A and initialize the algorithm with the subset A(0) . 1. Given A(k) ⊂ A, solve the subproblem ( ´ ³ min f (x), x ∈ X (k) x P gαk (x) ≤ 0, αk ∈ A(k) (19) yielding the solution vector xk and the Lagrange multiplier vector λk . 2. Reduce the subset by the inactive constraints n o (k) AR = A(k) \ αk ∈ A(k) |(λk ) = 0 (20) where the Lagrange multipliers λk = 0 indicates the inactive constraints in the reference set. 3. Define the entering index α̂k and add it to the subset α̂k = arg max gα (xk ), α∈A [ (k) (k+1) A = AR {α̂k } (21) (22) and return to Step 1. A practical stopping criteria is when |gα̂k (xk )| ≤ ε(xk ), where ε(xk ) > 0 is a tolerance parameter which may depend on the current solution xk . If the tolerance is pre-defined, then ε(xk ) may be substituted with the scalar ε. The convergence of the algorithm to the optimal solution is non-trivial to show. A theoretical framework to prove the global convergence of the DNCA algorithm is outlined in [7]. 5. EXAMPLES In this section, the flexibility of the presented design method using the DNCA algorithm is illustrated by numerical examples. The first example considers the enhancement of the upcoming international standard flattop window, the ISO 18431-2 flattop window.The second example considers the design of a flattop window which is comparable with the P-401 flattop window, which can be found in Hewlett Packard’s frequency analyzers. 5.1. Enhanced ISO Flattop Window In year 2000, the International Organization for Standardization (ISO) initiated the work of ISO 18431-2, Mechanical Vibration and Shock - Signal Processing Part 2 - Rectangular, Hanning, and Flattop Windows for Fourier Transform Analysis [8]. The goal of the project is to standardize the three most commonly used window functions for frequency analysis. One of the windows to be standardized is a flattop window, denoted ISO flattop window, for mechanical vibration and shock analysis. The coefficient set for the ISO flattop window is very similar to the Brüel and Kjær flattop window in the B & K Analyzers [9, 10]. The ISO flattop window is given by equation (1), where the coefficients are given by a0 1.0 a1 1.933 aISO = (23) a2 = 1.286 a3 0.388 a4 0.0322 This example aims to design an Enhanced ISO (E-ISO) flattop window, in terms of higher sidelobe attenuation without effecting the passband properties. Given the window coefficients, one can generate wISO (n) and WISO (ω) using Eq.(1) and Eq.(3). The time-domain window is a periodic window, i.e. N x = N since this window is used for sound and vibration measurements. This implies that the design procedure should be based on a periodic window. Given the ISO window coefficient in Eq.(23), the desired window specification for the enhancement is extracted in the following steps: 1. Insert the ISO window coefficients into Eq.(3), to generate a periodic window, i.e. Nx = N . 2. Select a passband edge as the angular frequency ωp as Wper (ωp ) = 2 − ||Wper (ω)||∞ ω ∈ [0, π] (24) 3. Select the stopband edge as the angular frequency ωs on the mainlobe where the amplitude is equal to the peak sidelobe level σs 4. Choose the tolerances in the passband and stopband as σp (0) = 0 σp (ω) = ||Wper (ω)||∞ − 1 σs (ω) = σs = ||Wper (ω)||∞ ω ∈]0, ωp ] ω ∈ Ωs (25) 5. Finally, the desired window response Wd (ω) is defined as 1 6 Wd (ω) = ej 0 Wper (ω) ω=0 ω ∈]0, ωp ] ω ∈ Ωs (26) Note that Wd (ω) is a complex function, representing a specification on both the amplitude and phase within the passband. Inserting the determined parameters into Eq. (14), and using the DNCA algorithm described in Section 4, the following set of enhanced window coefficients can be obtained, aE−ISO = 1.00000000000000 1.93293488969227 1.28349769674027 0.38130801681619 0.02929730258511 (27) Figure 1 shows the frequency response of the original ISO flattop window and the enhanced ISO flattop window. The E-ISO window is slightly (not observable) flatter in the passband compared to the ISO flattop window. The peak sidelobe level for the ISO window is approximately −84dB while the E-ISO window peak sidelobe is −89dB, which implies an improvement of ∼ 5dB, see Fig. 2. A more conventional performance measure of windows is the equivalent noise bandwidth, ENBW [1]. The ENBW for the original ISO and the E-ISO flattop window is 3.770 and 3.765 respectively. 5.2. Comparable P401 Flattop Window The HP proprietary P401 flattop window is considered to be an outstanding flattop window, due to its high sidelobe attenuation. The amplitude error for P-401 is around 0.01dB and its highest sidelobe is located around −94dB. Since the window coefficients for the P-401 flattop window is unknown, the design must be based on a symmetric window. ¡ ¢ Recall the phase for a symmetric window with length N is given a priori by ϕ(w) = − N 2−1 ω. Since no phase information for the periodic window is available, the most appropriate choice is to design the window coefficient set based on a symmetric window since the phase is given a priori. By using the window design specification: ½ Wd (ω) = and ½ σp (ω) = 1 0 ω ∈ [0, ωp ] ω ∈ [ωs , π] 0 100.01/20 ω=0 ω ∈]0, ωp ] (28) (29) 0 |W (ω)| ISO |W (ω)| E−ISO dB −50 −100 −150 0 0.1 0.2 0.3 0.4 0.5 ω/π 0.6 0.7 0.8 0.9 Fig. 1. Frequency domain representation of the original ISO and the enhanced ISO flattop window for length N = 256. −3 −70 x 10 |WISO(ω)| (ω)| |W 4 |WISO(ω)| (ω)| |W −75 E−ISO E−ISO −80 3 −85 2 dB dB −90 1 −95 −100 0 −105 −1 −110 −2 −115 −3 0 0.5 1 1.5 2 ω/π 2.5 3 −120 3.5 −3 x 10 0.05 ω/π 0.1 0.15 Fig. 2. Frequency domain representation of the ISO window |WISO (ω)| and the E-ISO window |WE−ISO (ω)| for length N = 256 in the passband (left) and at the stopband edge (right). 1 0 |W (ω)| Comp−P401 dB −50 −100 −150 0 0.1 0.2 0.3 0.4 0.5 ω/π 0.6 0.7 0.8 0.9 Fig. 3. Frequency domain representation of the Comp-P401 flattop window |WComp−P 401 (ω)| for length N = 256. −3 5 −90 x 10 |WComp−P401(ω)| |WComp−P401(ω)| −92 4 −94 3 −96 2 −98 dB dB 1 0 −100 −1 −102 −2 −104 −3 −106 −4 −108 −5 0 0.5 1 1.5 2 ω/π 2.5 3 3.5 4 −3 x 10 −110 0.05 0.1 0.15 ω/π 0.2 0.25 Fig. 4. Frequency domain representation of the Comp-P401 flattop window |WComp−P 401 (ω)| for length N = 256 in the passband (left) and at the stopband edge (right). 1 and by setting K = 6, ωp = 0.002π, ωs = 0.02π and N = 256 yields the window coefficient set 1.00000000000000 1.93774046310203 1.32530734987255 aComp−P401 = (30) 0.43206975880342 0.04359135851569 0.00015175580171 The coefficient set is obtained by inserting the above specification into Eq.(17) and using the DNCA algorithm described in Section 4. Given the coefficient set, the frequency response of a length N = 256 symmetric window can be obtained by using Eq. (4), with Nx = N − 1. Figure 3 shows the frequency response of a periodic P401 comparable flattop window. According to available figures of merits for the P-401 flattop window, the Comp-P401 flattop window have lower amplitude error (∼ 0.0023dB) and higher peak sidelobe attenuation. The peak sidelobe level for the Comp-P401 windows is approximately ∼ −97dB, as seen in figure 4. For the Comp-P401 flattop window, the ENBW is found to be ∼ 3.85 Note that even though the design is done on a symmetric window, the periodic window possesses almost the same characteristics, in both passband and stopband. Therefore, it is concluded that given an amplitude specification of a window, the engineered coefficients can be used to generate both a symmetric or periodic window with approximately the same frequency characteristics. 6. CONCLUSIONS This paper have presented a method for flattop window design and enhancement using the DNCA algorithm. Two examples are included in this paper. The first example shows that the ISO 18431-2 flattop window coefficient set is not optimal in the sense that the peak sidelobe can be further attenuated with ∼ 5dB, without affecting the passband properties. The second example shows that the presented method can be used to design new flattop windows, given an amplitude specification without explicit knowledge of the phase. In such case, the design must be based on a symmetric window since the phase information is absent. It can be shown that given a window coefficient set, the symmetric and periodic window possesses almost the same frequency characteristics. The choice of the DNCA optimization algorithm is twofold. Depending on whether the design is based on a periodic or symmetric window results in two different types of optimization problems, semi-infinite optimization or finite-dimensional optimization with a huge number of constraints. The DNCA algorithm is capable to solve both problems. The main reason for the choice of the DNCA algorithm is because it reduces the computational time significantly and is less memory consuming compared to other conventional available optimization algorithms. 7. REFERENCES [1] Harris, F.J. (1978), “On the use of windows for harmonic analysis with the discrete Fourier transform”, Proc. of the IEEE, Vol. 66, pp. 51-83. [2] Parks, T.W., Burrus, C.S. (1987), Digital Filter Design, Wiley-Interscience, ISBN 0-471-82896-3. [3] Oppenheim, A.V., Schafer, R.W. and Buck, J.R. (1998), Discrete-time signal processing, second edition, Prentice Hall, ISBN 0-13-754920-2. [4] Lanczos, C., (1966), Discourse on Fourier Series, Hafner Publishing Co. [5] Tran, T., Dahl, M., and Claesson, I. (2003), “A semi-infinite quadratic programming algorithm with applications to channel equalization”, Proc. of the 7th International Symposium on Signal Processing and its Applications, ISSPA2003, Paris France, July, Vol. 1, pp. 653-656. [6] Dahl, M., Claesson, I., and Nordebo, S. (2003), “Antenna array design using dual nested complex approximation”, Proc. of the 7th International Symposium on DSP for Communication Systems, DSPCS2003, Coolangatta, Australia, December. [7] Nordebo, S., Dahl, M., and Claesson, I. (2001), “Complex approximation with applications to antenna array pattern synthesis”, Proc. of Electromagnetic Computations EMB01, Uppsala, Sweden, November. [8] Draft International Standard (2003), “Mechanical vibration and shock Signal processing Part 2: Time domain windows for Fourier transform analysis”, International Organization for Standardization [9] Gade, S., Herlufsen, H. (1987), “Technical Review - Windows to FFT Analysis (Part I)”, Br ü el & Kjær Technical Review No.3 [10] Gade, S., Herlufsen, H. (1987), “Technical Review - Windows to FFT Analysis (Part II)”, Br ü el & Kjær Technical Review No.4
© Copyright 2026 Paperzz