Synthesis of the integer FIR filters with short coefficient word length

— The integer simulation and development finite impulse response (FIR) filters taking into account the possibilities of their realization on digital integer platforms are considered. The problem statement and solution of multifunctional synthesis of digital FIR filters such a problem on the basis of the numerical methods of inte-ger nonlinear mathematical programming are given. As an several examples, the problem solution of synthesis FIR-filters with short coefficient word length has been given. The analysis of their characteristics is resulted. The paper discusses issues of modeling and synthesis of digital FIR filters with provision for the possibilities of their implementation on digital platforms with integer computation arithmetic. The formulation of the problem of multifunctional synthesis of cascade FIR filters using the methods of integer nonlinear mathematical programming is given. The efficiency of this approach is illustrated by examples of solving the problems of synthesizing integer FIR filters with a minimum coefficient word length. The analysis of the synthesized filter characteristics is made.


INTRODUCTION
A digital FIR filter in its canonical presentation is, as is known, a discrete system, for which the ratio between the input and output time sequences xn and yn is determined by a linear discrete convolution equation.
where the constant coefficients hk are counts of the filter impulse response.The input filter window includes N+1 samples, and the value of N determines the order of the FIR filter.Its transfer function is , will hold, where the complex variable z when turning to the complex representation of the frequency response is the normalized angular frequency, and fs is the signal sampling rate.The main advantage of a FIR filter is the capability of implementing a linear phase frequency response (PFR) under the condition of symmetry (antisymmetry) of the impulse response, and also that FIR filters implemented non-recursively, that is, using direct convolution (1), are always stable.The total quality of a FIR filter is determined both by its selectivity and running speed, that is, the minimum response time for implementation on a given digital platform.Selectivity is usually understood as the ability to satisfy a set of required filter characteristics in the frequency domain.FIR filters, as is well known, have a relatively low selectivity when impulse response with a large number of samples is required to realize the frequency response of a complex shape with sharp cut-offs, which requires a large amount of digital calculations to calculate the filter response.In this case, the main factors determining the computational costs, as well as running speed, are also the calculation arithmetic and the word length of the coefficients (bitness) of the digital FIR filter [46].A review of publications on classical FIR filter design methods shows that they are currently dominated by analytical calculation using window weighting methods, frequency sampling methods, methods for calculating optimal (Chebyshev) filter [1], and some other approaches to the synthesis of FIR filters with finite word length coefficients [2]when real arithmetic of calculations is used in digital filtering algorithms.The real format of data representation requires quantization of their values, which, at low small word length of data presentation, leads to a significant distortion of frequency responses and the appearance of quantization noise.In addition, a real solution can be implemented only on a specialized signal processors.The quantization issues in analytic calculation of the FIR filter have been well studied, but in general it can be noted that with a high filter order (N> 100), significant difficulties in meeting the specified specifications arise already when quantizing real data up to 7-8 bits.However, the possibility of direct synthesis of digital integer FIR filters directly in the integer state space can be provided by the integer nonlinear programming (INP) technique, a general description of which is given in [3].In this case, the state space is understood primarily as the multidimensional space of integer parameters (coefficients) of FIR filters, input and output signals, i.e. integer time sequences, as well as basic integer operations on data in the digital filtering algorithm.Naturally, integer operations on any digital platform are performed much faster than real calculation operations.The number of cycles of the central processor unit required for the implementation of basic integer operations is substantially less.For example, for the C8051F120 microcontroller processor, which can operate with both integer and real data representation formats, basic addition operations are seven times faster, and multiplication operations are more than four times faster for integer arithmetic in comparison with real calculations.The INP method allows you to design effectively integer filters with a given data representation word length and maximum fulfillment of the requirements for the set of frequency characteristics of the filter with an arbitrary form of their specification.
Currently, 8-bit digital platforms with integer calculation arithmetic is an integral part of available commercial digital platforms.When implementing high-speed integer digital filters (IDF) on specialized platforms or on a chip, the word length of data presentation can be even lower (down to 4 or even 3 bits).And as rightly shown in [4], a reduction in data width even by 1 bit can save up to 50% of RAM, with a significant reduction in the calculation time of the filter response.Therefore, for high-speed chip based filters, the word length of the data representation is largely a determining factor.The issues of design of recursive IDF with minimum word length by the integer nonlinear programming (INP) technique was discussed in detail in [5], and ensuring the phase linearity of integer FIR filters in [6].This paper discusses the possibility of solving the issues of synthesis and cascade integer FIR filters with the minimum word length of data representation by the by the INP software (release 3.1), i.e. the examples illustrating the fundamental capabilities of this approach to multifunctional design of digital systems.

Modeling and synthesis of low word length integer FIR filters
The direct integer FIR filter is defined as follows [11]: The principal feature of IDF is that its coefficients bk and ak belong to an alternating series of integers, which can be either natural or binomial (for the normalizing factor a0).The variation change of the coefficients is determined by the word length of the data in the digital platform used.At the same time, the complement is most widely used in computer systems for representing integers.In practice, as for IIR filters, a cascade (series) structure for constructing an FIR filter is often used, having certain advantages over the transversal filter.In this case, the structure of an integer FIR filter is given by the number of its sections in the cascade version, and the vector IX determines the variable parameters (coefficients) of the filter sections in the multidimensional integer parameter space In.The transfer function for a integer FIR filter, consisting of a cascade connection of m second order sections (m = N/2, N is the general order of the filter), has the following form: From (2) it is easy to obtain the difference equation for one integer section: ) where xn, yn are input and output integer time sequence, a0 is a normalization factor.
As can be seen from (1.3), when calculating the filter response, the division by the integer coefficient a0 should be performed, which can be implemented by the bit-shift operation provided that each i-th normalizing factor belongs to the integer binomial series (series of 2n): where Wk is the bit word length of integer coefficients, sign including.
Figure 1 shows the structure of an integer section corresponding to the equation (3).As is seen, besides conventional addition, multiplication and clock period delay operations, there is a shift by B=log2a0 bits, used to implement integer division by the normalizing factor a0. Thus, when calculating the FIR-filter response yn, the minimum number of basic operations is used, all of which are integer, which determines the essential higher performance of the filter for real-time operation.

Fig. 1. The Structure FIR section
An important advantage of integer filters is the absence of a data quantization procedure (both for filter coefficients and intermediate integer calculations) in the course of calculating the filter response in real time, and, therefore, the absence of negative data quantization effects listed above.That is, quantization is replaced by integer discretization of the multidimensional space of coefficients before synthesizing a filter with obtaining an integer solution (vector of integer coefficients IX0) with zero implementation error on a digital platform or chip with a given length Wk of the word of integer coefficients.
As for the results of the intermediate calculations, all of them are also integer.And the result of multiplying integers (for example, the current digital sample and the FIR filter coefficient) will be completely in full determinate, not requiring quantization for implementation on the digital platform with a given word length Wk at data representation.For a given bit ness of quantization of the input signal Wx, it is sufficient to select an internal storage register with a bitt ness of Wak= Wx+ Wk bits to store the result of integer accumulative multiplication (MAC), performed according to the algorithm (3).Overflow fluctuations, that is, the occurrence of large limit cycles caused by the word size overflow of the storage register, with such a calculation of its bit ness almost never occurs, especially considering that the accumulation of the result of integer accumulative multiplication in (3) is carried out as algebraic addition, taking into account the sign of the terms, what significantly reduces the bit ness of the result.In the algorithm for calculating the response of an integer FIR section, the only random process (that is, the source of noise) is the normalization operation, dividing by the normalizing binomial factor a0, which, as shown above, is implemented by register right shift by B=log2a0 bits with data loss in the least-significant bits.Note that in the integer filter there is one source of noise for each section, the origin of which is a required shift operation [5] In digital platforms with real arithmetic of calculations, the representation of the result of multiplying real numbers with a finite number of digits is stochastic in nature and, naturally, requires a quantization procedure, the result of which is stochastic quantization noise.
As is well known, in cascade forms for constructing digital filters, a gain scaling procedure is required, that is, a uniform gain distribution over stages.This allows to operate the filter in a wide dynamic range of input signals.However, for cascade IDFs it is much easier to calculate such gain restriction of an integer section not by using the Lp-norm, but by directly requiring a small spread of the transfer ratio of individual sections [7]As experience shows, no significant dynamic range reduction of a FIR filter will occur if the maximum transfer coefficients of the cascades differ by no more than 5-7 times.With a more coarse amplification scaling, the filter dynamic range reduction becomes noticeable.The requirements of signal gain scaling are formulated by bilateral functional constraints [ [5]] for the synthesis extreme problem of the INP synthesis.
In general, the problem of integer nonlinear programming for computer synthesis of a non-recursive IDF with a given word length of data representation can be written as: where m is the number of sections of the second order, d is the index of the coefficient of the section transfer function (1.1), IX is the vector of the multidimensional integer parameter space, F(IX) is the objective function, Kimin , Kimax are the acceptable limits of the gain change of the i-th section.The synthesis extreme problem ( 5) is written for the integer space I4m of parameters (filter coefficients) of dimension 4m.Constraints (6) set the limits for the variation of integer coefficients, and relation (7) determines the belonging of the a0i coefficients to the binomial series.The constraints (8) scale the transfer coefficients of the sections at a given interval and are implemented in the minimization algorithm using the penalty function.
The multi criteria objective function is most often formed as weighted sum (10) of single objective functions fi(IX), which determine fulfilling functional requirements for a particular kind of frequency response of the filter Factor i sets the significance (weight) of the characteristic (i-th frequency window).The single objective functions fi(IX) are formed in the graphics editor of the synthesis package, usually by the criterion of the mean-square error ,  5) in a given space of integer is performed using the software-based algorithmic complex [8]with the search for a global extreme on a discrete grid of the Gray code.This complex is adapted to finding solutions in the discrete integer mode of a multidimensional region of parameters (filter coefficients).The vector IXО, minimizing the scalar objective function F(IX) on the set of admissible integer solutions (6), is an effective, solution of the IDF multifunction synthesis problem.It should be noted that, in contrast to the classical analytical calculation, a search design is, of course, an intellectual process, intellectual design.Many scenarios for solving a complex project problem can be proposed, many specific techniques and skills can be applied by an experienced search designer to successfully solve a complex design problem.A typical scenario for the search design of cascade IDFs is a dynamic programming script, as a sequence of search tasks with a phased increase in the order of the designed filter.At the first, start-up stage, a low-order structure is used (max. of 6th or 8th order).Naturally, the level of fulfillment of combined requirements by such a filter will be low.At the second stage, already this solution is used as a source.At the same time, the order of the filter is increased by duplication of the section previously found coefficients of one of the section (which can be done automatically within the synthesis package).After several such iterations, the final order of the designed filter is determined, in which the error of complex aggregate requirements is within the specified tolerance.The possibility of synthesizing integer recursive FIR filters with the minimum word length data representation using the INP method is shown below.The multifunctional synthesis in this case is carried out according to both the criterion of the required frequency selectivity and the criterion of the possible phase linearity in the filter pass band.Thus, the objective function in the design specifications below is formed as a weighted sum of two single objective functions fAFR(IX) and fAFR(IX), which respectively signify the requirements of the filter frequency selectivity and its phase linearity where the singular objective functions are formed with the additive quadratic criterion (10).The weight coefficients of the objective functions were determined practically during the step solution of external problems of integer programming.

FOUR BIT LOW PASS FIR FILTER
The initial specification for the synthesis of the low-pass filter with the required phase linearity in the integer space of 4-bit coefficients was as follows: 1. Bandwidth of the filter 0 -0.225 (hereinafter on the scale of relative frequencies f/fs, where fs is the sampling frequency of the signal) 2. The transmission ratio in the pass band 0dB to a tolerance of ± 1.0dB 3. Phase nonlinearity in the band not above 10º 4. Transition band 0.225 -0.32 5.The suppression level at frequencies below 0.32 not less than 40dB 6. Bit ness (coefficient word length Wk) 4 bits, sign including 7. The FIR filter order is 56 9. Transfer ratios of the sections are in the interval {1.0 -2.0} Figure 2a shows the required amplitude-frequency response of the filter (dashed line).When synthesizing a low-pass filter, taking into account the phase linearity, the objective function was formed by (12), and the particular functions were formed using the additive criterion (10).The problem of integer programming for multifunction synthesizing with 28 cascade second-order sections is formulated as follows: Thus, the final minimization of the objective functional was carried out on the 84dimensional integer space of 4-bit parameters in the allowable domain (14) while scaling (16) the gains of the sections in a given interval.The normalizing factors (15) of all the filter sections were equal.To input the structure of the low-pass filter, the built-in topological editor of the INP-package (10) was use, which allows to create a source data file for solving a specific synthesis task indicating the number of variable coefficients, their initial values and limits of variation, as well as their possible duplication.

Tables
Table 1 shows the optimum integer 3-bit coefficients of the low-pass filter transfer function with the same significance (1=2) requirements for frequency and phase response, as well as the achieved values of the gains of its sections.Its frequency responses are shown in Fig. 2 The task time for solving this problem on a standard personal computer under the scenario of dynamic programming and the objective function (12) did not exceed 15 minutes.
Table 2. shows the optimum 4-bit coefficients of the high-pass filter.
Section b0 b1 b2 Кmax 1 0 0 -7 0.9  As for the assessment of phase nonlinearity in the pass band of the synthesized FIR filter, then the application the root-mean-square error (RMS) of phase distortions by the criterion of the influence on the output waveform can be correctly applied, not their estimates by the maximum error criterion where φn(IX) is the current value of the phase response at the nth discrete frequency of the evaluation range, and is the desired value of the linear phase response.This follows directly from the Fourier transform, which determines precisely the additive influence of the phase and amplitude spectrum of all harmonics of the processed signal on the distortion of its shape.Therefore, further to assess the phase nonlinearity, as well as the non-uniformity of the frequency response in the pass band of the filter, criterion (17) will be used.In this case the rms non-uniformity of the amplitude-frequency response and the nonlinearity of the phase-frequency response in the pass band of 4-bit HPF were equal, respectively, to ∆Кско=0,8 dB and ∆φско=6,7º.
The practical implementation of the low-pass filter was carried out on the MSP430F1611 multifunction microcontroller with a RISC-core [20].The frequency response of the filter was measured using a real signal with an automated panoramic measuring system developed in the Lab VIEW virtual instrument environment.The experimental results of the frequency response measuring of the synthesized LF filter over the entire NY Quist interval for the sampling frequency fs = 1 kHz.are shown in

FOUR BIT HIGH PASS FIR FILTER
The specification for the synthesis of the high-pass filter with the required phase linearity in the integer space of 4-bit coefficients was as follows: 1. Filter bandwidth 0.225 to 0.5 2. The transmission ratio in the pass band 0dB to a tolerance of ± 0.8dB 3. Phase nonlinearity in the band not above 10º 4. Transition band 0.08 -0.225 5.The suppression level at frequencies below 0.08 not less than 40dB 6.The word length of the coefficients Wx is 4 bits 7. The FIR filter order is 56 9. Transfer ratios of the sections are in the interval 0.8 -2.0 The required frequency response of the filter is shown in Fig. 4a (dotted line).When synthesizing a HPF with regard to phase linearity, the objective function was formed as a weighted sum of partial objective functions fAFR(IX) и fPFR(IX) by (12), particular functions were formed using the additive criterion (10).The weight coefficients of the window objective functions were determined practically during the phased solution of the following external problems of integer programming for the multifunctional HPF synthesis in the form of a cascade connection of 28 second-order sections: As can be seen, with full phase linearity, the root-mean-square band pass nonflatness of the MFR filter in the pass band was ∆Кrms= 2.2 dB for same order of the FIR filter.Thus, the condition of the impulse response symmetry is a very strict restriction to the parameters (filter coefficients), and, consequently, to the selectivity of the designed filter.In this example, the synthesis of the FIR high-pass filter shows that with symmetric coefficients its selectivity acc.criterion ( 17) is 4 times less compared to the solution with free coefficients.Obviously, this effect will be even stronger for narrow-band filters, where phase distortions are small by themselves and in a narrow bandwidth they are much easier to eliminate by direct INP synthesis with free coefficients, without losing the filter selectivity.Thus, with INP-synthesis of a cascade FIR filter with phase linearity only in a given band, the filter length can be significantly reduced if the functional requirements for the frequency and phase response of the filter are fully met.

Conclusion
Methods of integer nonlinear programming as applied to the problems of designing linear digital filters are a modern and alternative to traditional methods of designing digital FIR filters.The fundamental distinction of INPsynthesis is the use of modern numerical methods of machine design, allowing to work not with an analytical, but with a discrete representation of the characteristics of the designed filter, when both the initial required and current characteristics are tabulated with a given discreteness of their representation in the frequency domain and in the computing system represented by twodimensional arrays (vectors).This makes it possible, on the one hand, to calculate with a given accuracy all the required filter characteristics (including GDT and dispersion) using numerical methods.On the other hand, to apply effective search methods of discrete programming for the synthesis of a technical solution, allowing to design digital FIR filters directly in the integer parameter space.The search criterion for this is that the current functioning of the synthesized filter complies with the required functioning in terms of the set of frequency responses.Modern algorithmic complexes of integer minimization make it possible to solve such design problems reliably and efficiently while fulfilling all external requirements and constraints to the operation of a digital filter, which makes it possible to significantly improve the quality of designed filters and reduce the time to develop them.
From the above content it can be seen that, when compared with traditional approaches, the synthesis of FIR filters using integer nonlinear programming allows: 1.To carry out the filter synthesis according to the frequency characteristics specified in any form and at a given frequency scale (linear, logarithmic etc.); 2.Designing filters with a short data word length (down to 3 bits) directly in the FIR filter parameter (coefficient) space; where Yn(IX) is the current value of the filter frequency response on the n-th discrete frequency, and T Y n is the required value of the frequency response.is less effective and used much more rarely.The iterative search solution to the external INP problem (

Table 2 Fig. 2 .
Fig. 2. Responses of the synthesized LF filter a) frequency response

Fig. 3 .
Fig. 3. Experimental measurements of the amplitude-frequency response (a) and phase response (b) of a 3-bit low-pass filter

Fig. 4 .Fig. 5 .Fig. 6 .
Fig. 4. Responses of the synthesized HF filter a) frequency response, b) phase responseThe filter was also practically implemented on a MSP430F1611 microcontroller.The results of the frequency response automated measuring of the filter over the entire NY Quist interval for the sampling frequency fs = 1 kHz.are shown in Figure.5 Since, the output signal was taken directly from the DAC, there is also a noise level increase near the NY Quist frequency, where the effects of input signal quantization are most pronounced.As can be seen, the experimental characteristics of the low bit ness high-pass FIR filter quite correspond to the synthesis data.

Table 1 .
shows the optimum 4-bit coefficients of the low-pass filter