Logarithmic number system (LNS) is an attractive alternative to realize finitelength impulse response filters because of multiplication in the linear domain being only addition in the logarithmic domain. In the literature, linear coefficients are directly replaced by the logarithmic equivalent. In this paper, an approach to directly optimize the finite word length coefficients in the LNS domain is proposed. This branch and bound algorithm is implemented based on LNS integers and several different branching strategies are proposed and evaluated. Optimal coefficients in the minimax sense are obtained and compared with the traditional finite word length representation in the linear domain as well as using rounding. Results show that the proposed method naturally provides smaller approximation error compared to rounding. Furthermore, they provide insights into finite word length properties of FIR filters coefficients in the LNS domain and show that LNS FIR filters typically provide a better approximation error compared to a standard FIR filter.
Finitelength impulse response (FIR) filters constitute a class of digital filters commonly used for their stability properties and the ability to obtain a linear phase response. The transfer function of an
The filter order and, therefore, the number of multiplications and additions for a straightforward realization grows approximately inversely proportional to the transition bandwidth of the magnitude response [
Furthermore, the representation of data and coefficients affects both the switching activity and implementation complexity which, in turn, affects power consumption as well. Commonly, a fixedpoint two’s complement number representation is used to represent data in DSP systems, but other number representations have also been investigated as an efficient way of data representation for such systems [
With LNS reducing multiplication to an addition, it finds application in low power signal processing systems, including digital filters [
Most efforts towards utilizing LNS for digital have focused on either implementing the nonlinear conversion to and from LNS, selecting the logarithm basis, or implementing the LNS addition and subtraction efficiently [
In this work, an integer linear programming (ILP) approach to design optimal finite word length linearphase FIR filters in the LNS domain is proposed. Here, instead of optimizing filters in the linear domain and converting them into LNS with rounding in the LNS, we optimize the filter directly in the LNS domain with finite word length constraints in the LNS domain. By optimizing the filters directly in the LNS domain it is also possible to compare the required word lengths to obtain further insights regarding the efficiency of LNS.
The rest of the paper is outlined as follows. In the next section LNS numbers are reviewed. In Section
The LNS takes advantage of the fact that multiplications become additions, however, at the cost of increased complexity to implement addition. The LNS representation of a number
As stated before, the motivation behind using LNS is the simplicity of implementing the multiplication of
The addition and subtraction are more complex and are given by (
In case of FIR filters, the filter coefficients are typically between
Any number smaller than this is not representable. This phenomenon is shown on a linear scale in Figure
Distribution of smallest logarithmic values using base 2: (a) one integer bit and three fractional bits and (b) two integer bits and three fractional bits.
It is well established that coefficient quantization results in a static deviation of the transfer function, while data quantization results in roundoff noise [
Integer linear programming (ILP) is a class of linear programming where some or all the variables are restricted to have integer values [
However, some real world problems require the result to be integers. This requirement is incorporated into the programming model by having an additional constraint
In this work we use the branch and bound (BB) algorithm which is a general algorithm for finding optimal solutions to integer or combinatorial problems. It consists of enumerating all candidate solutions and discarding candidates by using upper and lower bounds of the quantity being optimized.
ILP problems are nondeterministic polynomial (NP) hard. In order to solve them the integer constraint is relaxed and the variables are allowed to take noninteger values. This, and subsequent, LPrelaxations provide a
The subproblem is infeasible, as any possible further branching will not change that.
The subproblem results in a solution where all coefficients are integers.
The solution of the subproblem is worse than the best obtained integer solution, and, hence, no further subproblems generated from that node can possibly have better values.
Example branch and bound tree for LNS FIR filter design.
In any of these cases the algorithm returns to the previous node and selects another subproblem to solve until all possibilities are exhausted and the optimal integer solution is obtained.
The nontrivial challenge in ILP is to know which variable to branch on and in which order. We will suggest and evaluate a number of branching schemes in later sections.
Linearphase FIR filters can be designed to be linear and are a good candidate for linear programming optimization. The work by Rabiner [
In ILP, the FIR optimization problem is the same as in the linear programming case. A general FIR optimization problem can be stated as the following minimization problem [
The weighting function
The magnitude response of
The linear relaxation obtained without integer constraints will be the same minimax solution obtained using other FIR filter design techniques, such as the Remez exchange algorithm. Therefore, in later results the linear relaxation is used as a lower bound. Introducing integer constraints will constrain the solution space and increase the approximation error. Furthermore, the resulting filters may no longer be equiripple.
In the LNS domain, our proposed design method focuses on finding the LNS equivalent of the coefficient values and implementing a branch and bound tree based on LNS integer values. In the branch and bound tree, the coefficients are, when picked as the branching variable, constrained to be LNS integers.
The solution space for an LNS ILP problem is different from that of an ILP problem using linear representation. An example of this is shown in Figure
Example solution space for ILP with LNS (
In the LNS branch and bound tree, after solving a node, some of the coefficients will be LNS integers and some not. The linear relaxation of a noninteger coefficient, if selected, would be rounded up and down.
The first proposed branch variable selection scheme, named as Scheme 1, is to scan all the noninteger coefficients and pick the noninteger variable which has the largest absolute value. This may be efficient since this will introduce the largest quantization error in the linear domain, and, hence, possibly reduce the convergence time. Another scheme, denoted as Scheme 2, instead selects the coefficient, after scanning all noninteger coefficients, which is farthest from being an integer in the LNS domain. This is again based on the idea of introducing large quantization errors early.
For both schemes described above, both combinations of branching direction are evaluated. This means that for both schemes, the difference is calculated between the linear relaxation of the selected variable and its upper and lower bounds. In one implementation, the branching variable is constrained to the bound which gives the least difference first and then upon returning to that node constraining it to the other bound. In the other implementation, this selection is reversed.
A third scheme is proposed, denoted as Scheme 3, where the branching direction was limited to the bound with the least difference. In this scheme, all noninteger coefficients are scanned and the minimum distance to each of its bounds for each variable is calculated. The coefficient having the maximum of these minimum distances is selected as the branching variable.
All the above schemes either picked up the floor or ceiling value of the linear relaxation for the next branch without actually knowing whether that would produce a lower approximation error. The final proposed approach, Scheme 4, uses the same variable selection scheme as Scheme 3 but both subproblems are evaluated before the selection is done on which path to continue along. The decision is based on the most promising path, that is, the one with the smallest approximation error.
All these branch variable selection schemes are for locating the best variable to branch on. Apart from these schemes, the rest of the algorithm is the same for all cases. However, an error threshold is allowed while testing each coefficient for being an LNS integer, which means that the coefficient need not be exactly an LNS integer. Any number within a defined threshold of the corresponding LNS integer is taken as an LNS integer. This is a standard procedure in ILP solving as numerical errors in the computations may lead to noninteger values in the optimal solution, even though they in practice should be considered integers [
For the results a number of lowpass filter specifications were devised arbitrarily to cover both narrowband and wideband filters. The passband and stopband edges are shown in Table
Filter specifications considered.
Filter spec.  Spec. 1  Spec. 2  Spec. 3  Spec. 4  Spec. 5  Spec. 6 


0.2 
0.2 
0.2 
0.2 
0.1 
0.75 

0.3 
0.35 
0.4 
0.5 
0.25 
0.9 
A number of optimization runs were carried out with different alternatives. The purpose was to see the efficiency of each scheme and see the impact of word length on different filters.
Table
Comparison of first two variable selection schemes.
Scheme  Branching direction  Number of nodes  

Spec. 1 
Spec. 2 
Spec. 3 

1  L  30704  1410  948 
H  11113942  238320  20494  
2  L  82336  5990  1088 
H  3887918  458974  12342 
Scheme  Branching direction  Number of nodes  

Spec. 4 
Spec. 5 
Spec. 6 

1  L  378  1334  210 
H  4256  38650  13352  
2  L  365  1940  356 
H  3710  37248  17190 
Scheme 1 is further compared with Schemes 3 and 4 and the results are shown in Table
Comparison of variable selection schemes 1, 3, and 4 with
Scheme  Number of nodes  

Spec. 1  Spec. 2  Spec. 3  




1  30704  1410  948 
3  8986  4814  1010 
4  10240  1618  1092 
Scheme  Number of nodes  

Spec. 4  Spec. 5  Spec. 6  




1  378  1334  210 
3  366  1800  290 
4  164  3312  258 
The effect of word length is further studied and results are shown in Figure
Comparison of variable selection schemes 1, 3, and 4.
Spec.  Filter length 

Scheme  Nodes 

4  20 

1  250 
3  178  
4  96  


4  20 

1  4056864 
3  1150  
4  84  


6  20 

1  1948 
3  2128  
4  1982  


6  20 

1  1948 
3  2128  
4  1982  


3  34 

1  690 
3  962  
4  1442  


3  34 

1  305490 
3  4880  
4  4694  


1  64 

1  30704 
3  8986  
4  10240 
Number of visited nodes (solved subproblems) for specification 6: (a)
The figures and tables clearly show that if either (a) the transition bandwidth is increased or (b) the filter length is increased, Scheme 1 converges very slowly. This effect is magnified when the integer word length is decreased. This can be seen in the table in the case of spec.
Next, the effect of changing the integer and fractional word length on the magnitude response and approximation error was studied. Optimization runs were carried out for a number of specifications given in Table
Magnitude responses for different fractional word length of spec.
To study the effect of changing integer and fractional word length on the approximation error in more detail for specification
Effect of changing integer and fractional word length on approximation error: (a) spec.
As shown in Figure
Results on comparing against plainly rounding the coefficients are shown in Figure
Approximation error as a function of coefficient word length for proposed method and direct rounding of the linear relaxation: (a) spec.
To further compare the performance of LNS against linear integers, approximation error as a function of filter length is plotted in Figure
Approximation error as a function of filter length: (a) spec.
Approximation error as a function of filter length for proposed method and direct rounding of the linear relaxation: (a) spec.
Finally, a comparison of the magnitude response of specification three for a filter length of
Magnitude response of finite word length LNS and linear coefficients for spec.
Earlier works have indicated that the selection of logarithm base has an impact on the roundoff noise performance. Hence, several filters are designed with varying bases. In addition, it was earlier shown that the number of integer bits is limiting the obtainable approximation error in some cases and changing the base can be seen to give a similar effect as having a noninteger number of integer bits. For example, using three integer bits and using a base larger than two will reduce the amplitude of the smallest representable number (compare to Figure
In Figure
Approximation error as a function of logarithm base. ((a), (b)) Spec.
To further illustrate the effect of selecting base the same filters were redesigned with a total word length of seven bits, that is,
Approximation error as a function of logarithmic base with different word length. ((a), (b)) Spec.
In this paper, a method for designing finite word length linearphase FIR filters in the LNS domain was presented. Several branch variable selection and branching direction schemes were suggested and evaluated. The scheme where the branching variable was selected based on finding the largest minimum distance from the closest integer variable and branching in that direction was found to be the best on average among those suggested. The resulting filters are optimal in the minimax sense under finite word length conditions.
It was illustrated by examples that three or four integer bits were the best selection, with three being applicable for larger approximation errors. As opposed to finite word length coefficients in the linear domain, the number of integer bits in the LNS domain determines the smallest nonzero coefficient that can be represented. Using a different and larger logarithm base than two can reduce the amplitude of the smallest representable number and slightly improve the results, especially when using three integer bits.
An interesting topic for further studies is the relation between coefficient word length (determining the magnitude response) and the data word length (determining the roundoff noise). While these are completely disconnected in the linear scenario as well [
The authors declare that there is no conflict of interests regarding the publication of this paper.