# FIR-filter output gain

Lately, I've been doing some FIR-filter simulations as a part of a programmatic circuit design course. One task was to use different constants b_i for the multiplying stage of the filter and see how the response of the filter changes.

The filter was a 2nd order FIR-filter. First, we used the constants [1,1] for the multipliers. This created a low-pass filter. Then, we used the constant [1,-1]. This created a high-pass filter. After this, we had to show why this is the case for these constants. We were given the hint that we can divide the input signal into a sum of a low- and a high-frequency component: $$x(n)=x_{low}(n)+x_{high}(n)$$ We were also given the following assumptions:$$x_{low}(n)≈x_{low}(n-1)\\ x_{high}(n)≈-x_{high}(n-1)$$ By looking at the picture, I calculated the expressions for the signals after each flipflop. After the first flipflop, the signal is: $$x_{1} =x_{low}(n-1)+x_{high}(n-1) = x_{low}(n) - x_{high}(n)$$ After the second flipflop: $$x_{2} = x_{low}(n-1)-x_{high}(n-1) = x_{low}(n)+x_{high}(n)$$

For the low-pass filter we, therefore, get the output: $$y_{low-pass}=1*x_{1}+1*x_{2}=2x_{low}$$ And for the high-pass filter: $$y_{high-pass}=1*x_{1}+(-1)*x_{2}=-2x_{high}$$

Why does the filter multiply one of the signal components with 2? Shouldn't the filter only remove one of the components, without touching the other one?

Often when we create an FIR filter, we use an additional constraint that the sum of all the coefficients is 1. That's equivalent to saying your constants are [0.5, 0.5] for the lowpass filter.

The reason for this is so that the gain for low frequency (and specifically DC) signals, is unity.

This arbitrary choice doesn't affect the shape of the filter at all, only the overall gain to those components it lets through. We could just as easily put a gain block separately to the filter.

Presumably your course uses [1, 1] multipliers to make the sums easier. When implementing these filters in real hardware, like ASICs or FPGA, we rather like coefficients of unity where possible, as these can be implemented without an explicit multiplier, or coefficients of 2^N which can just use a shift.

The low pass filter [1,1] just adds two concecutive samples together.

If you feed that filter with DC signal of concecutive ones, you get concecutive twos out.

Same thing with the high pass filter of [1,-1] but assumption is the input signal is highest frequency AC of alternating +1 and -1 samples so output is alternating +2 -2 samples.

• Doesn't the high pass filter invert the input? Oct 5, 2022 at 20:40
• @user294957 For a positive step, you get a positive pulse out. Oct 6, 2022 at 4:41
• Then why is there a negative sign in y_high-pass? Oct 6, 2022 at 9:39
• @user294957 That's how high pass filters are made. They remove DC. If you feed two identical samples with any DC value in, then you will get zero out. Oct 6, 2022 at 9:44
• Ok, there is something I don't understand here. Why is there a negative sign for the output of the high-pass filter? As I've shown earlier, y = -2x. So shouldn't the output of the filter be inverted? Oct 9, 2022 at 18:40