 ## FIR Filter Implementation Using Octave GNU Tool and C Language

### 3. FIR Filter in recursive Form

##### Figure 3-1: FIR Filter in recursive Form

### 4. FIR Filter in direct Form

##### The variant is used mainly in practical applications. This form is described in (1) and the implementation is showed in Figure 4-1: Figure 4-1: FIR Filter in direct Form

### 5. FIR Filter in cascade Form

##### To preserve the linearity of the phase characteristic of the filter, the inverse nulls (5) should be combined together. In this case, we get a 4-order block: ##### For real inverse nulls, we get a 2-order block: ##### For nulls on the unit circle, two options are possible. This is a 2-order block for complex nulls and a first-order block for real null 1 or -1: ##### Thus, the FIR filter can be implemented in a cascade form, using the 1, 2, 4 – order blocks. Figure 5-1: FIR Filter in cascade Form

### 6. FIR Filter using Convolution with the Overlap-Add Method

##### Let the input x (n) sequence have length M (x (0), x (1),…, x (M-1)) and the impulse response of the filter h(n) has length N (h (0), h (1),…, h(N-1)), then the convolution of these two sequences will have length M+N-1, and the result can be calculated by the formula: ##### To calculate the output long data sequence, we divide the input data into blocks of length M. We will calculate the convolution for each individual block. To combine the results of these calculations, there are two methods: overlap-add method and overlap-save method (see , ). I will focus here only on the overlap-add method. In this case, the filter response to individual blocks is calculated, and the overlap between these reactions is summed up. See the Figure 6-1.  Figure 6-1: FIR Filter. Convolution with the Overlap-Add Method

### 7. M-Source Code FIR_Filter.m for “Octave“ Gnu Tool

• ##### Generate the help files with data arrays for the C-Code using my functions IntegerTestSignals2file(…), IntegerParamVector2file(…), FloatParamVector2file(…). The data can be copied to C-Code: FIR filters coefficients, test signals and so on;  Figure 7-1: Low Pass FIR Filter. Magnitude and Phase Responses

#####   Figure 7-2: FIR Filter. Signal Responses for Low Pass Filter.
The blue signal is filter input and the red signal is filter output.