## 5.2. Synthesizing FIR filters using frequential specifications

Synthesizing finite impulse response filters is the main step that helps to fix coefficient values of the impulse response. These samples, called filter coefficients, are obtained by trying to approach as closely as possible an ideal frequency response. Many models exist and it is difficult to present an exhaustive list. However, several classes are notable for their simplicity or their performance in terms of approximating an ideal filter.

The first method presented here is the best known for its properties and for its simplicity. Commonly known as the windowing method, it corresponds to a weighting of the truncated impulse response of a filter following directly from specifications with ideal frequency. In the section that follows, we present many weightings allowing for a compromise between attenuation in the stop-band and the rapid decrease of the transition band. In the following sections we will also discuss this part of the influence of truncation on the impulse response of the ideal filter.

The second method, which entails more complex calculations, is an optimal approach in the sense of minimizing a “cost” function expressed by the gap between the impulse response of the ideal filter and that which we are trying to synthesize.

### 5.2.1. *Windows*

Usually, we cannot simultaneously process all the samples of a signal; we process them in reduced segments, chosen with an analysis window. By choosing a size of an adapted window, we can generally observe that the signal is stationary during the duration of the analysis period. Apodization windows are often used in signal processing.

The windowed signal *x _{w}*(

*k*) is thus represented as the product of the signal and of the weighting window:

where *x*(*k*) is the signal to be analyzed and *w*(*k*) the weighting or temporal window of null value outside the observation interval.

This temporal product is transformed in the frequential domain by a convolution product of the Fourier transforms of the sequence and window.

Even if a rectangular window seems the most obvious choice for this operation, it is not necessarily the one most widely used.

So we now calculate the Fourier transform of this rectangular and causal window *w*(*k*) on *N* points; its z-transform is easily expressed because we know the terms of a geometric sequence with multiplier *z*^{−1}. We obtain:

By taking *z* = exp (*j*2π*f _{r}*), we deduce from it the module of the Fourier transform of the rectangular window:

We see that this module cancels itself when the normalized frequencies are multiples of , with the exception of 0. For the continuous component, the module equals *N*. The width of the principle lobe is of , if we are considering a normalized module/frequency representation.

Using the information in Figure 5.9, we see that the secondary lobes are attenuated by at least 13 dB. This means that the ratio between the amplitudes of the principle lobe and the first secondary lobe equal −13 dB:

This result is explained by the rough sequence of the series values *w*(*k*) from 1 to 0.

To avoid this kind of variation, other windows have been proposed, especially triangular windows or, more often, Blackman, Kaiser and generalized Hanning and Hamming polynomial windows. These last two are the most widely used.

Notably, these different classes of windows are characterized by a progressive passage from 1 to 0. The global form of the module of the Fourier transform of temporal windows is still, however, composed of a central lobe and of secondary lobes. However, the values of the ratio λ between the amplitudes of the principle lobe and the first secondary lobe vary.

Looking at Figure 5.9, we see that the module, expressed in dB, of the rectangular window presents a main lobe of a width two times smaller than those of the modules of Hamming, Hanning and Bartlett windows. However, the attenuation of the secondary lobes is clearly lower: 13 dB for the rectangular window as against 25 dB for the triangular window, 41 dB for the Hamming window, 31 dB for the Hanning window, and 59 dB for the Blackman window.

We see in Figure 5.11 that the choice of the parameter α for the Kaiser window conditions its frequential behavior. A value of α equal to 4 helps us obtain an attenuation close to that of the Hamming window. To increase this attenuation still further, we can increase the value of α. In compensation, the width of the principle lobe is larger. The parameter α thus helps to bring about a compromise between the width of the principle lobe and the amplitude of the secondary lobes.

### 5.2.2. *Synthesizing FIR filters using the windowing method*

#### 5.2.2.1 *Low-pass filters*

Let us assume we want to synthesize an ideal digital filter whose frequency response, shown in Figure 5.12, is . The filter is of the low-pass type and of cut-off frequency *f _{c}*:

We see that this response is reproduced in all the *f _{s}*. By introducing

*H*(

_{ideal, cantinuaus}*f*) represented as follows:

The ideal digital filter satisfies:

Using the inverse Fourier transform in equation (5.44), we can link to these specifications the following impulse response:

Equation (5.45) leads to the following values of the discrete impulse response for all of *k* ≠ 0:

The impulse response of an ideal low-pass filter is then equal, for *k* = 0:

This kind of impulse response is, on the one hand, of infinite width and, on the other, non-causal. This means the filter cannot be produced. Taking into account the relatively rapid decrease of the ideal impulse response *h _{ideal}*(

*k*), we can approximate the filter using the following steps:

– we must consider only a part of the impulse response; that is, by multiplying the ideal impulse response *h _{ideal}*(

*k*) by a apodization window

*w*(

*k*) centered in 0. This choice makes

*h*(

*k*) become a truncated version of the ideal impulse response written

*h*(

_{win}*k*):

– we can carry out a temporal shift of the impulse response in order to make the filter causal. By introducing this shift, we do not change the amplitude of the filter specifications, but modify the phase. This means that if we look at an impulse response of odd width *N* = 2*L*+ 1, the impulse response will be written as follows:

The reasoning behind this windowing method consists of characterizing the effects of this truncation by using several types of windows.

Figures 5.13, 5.14, 5.15 and 5.16 present the impulse responses and the phase and frequency responses of the synthesized filter by using the windowing method.

Several windows are used for orders of 20, 50 and 100. The normalized cut-off frequency is here equal to 0.2.

#### 5.2.2.2 *High-pass filters*

Here we assume an ideal filter to be synthesized with a frequency response shown in Figure 5.17. This is a high-pass filter with a cut-off frequency *f _{c}*:

The frequency response of this high-pass filter is that of the filter presented in section 5.2.2.1.

From here, in the temporal domain, the corresponding impulse response satisfies the equation:

As in section 5.2.2.1, by considering a windowing operation and a shift to make the impulse response of width *N* = 2*L* + 1 causal, we obtain:

By taking into account the expression of the impulse response of the low-pass filter obtained by the method in equation (5.49), we get:

COMMENT 5.2.– even if the synthesized filter is obtained by truncation, we can demonstrate that the windowing method is an optimal method in the sense of the following error criterion:

Even though it is optimal, this method does not allow for the distribution of the approximation error in the passband, the attenuated band, or the transition band. In the present situation, it is basically concentrated in the transition band. In other words, this method does not help control approximation errors in the different bands.

In the next section, we will present other approximation techniques that allow for a better approximation control in all the frequency bands. This is especially the case with methods that operate by a frequential weighting of the error criteria.