# Notch filters: why is $H(e^{j0}) = H(e^{j\pi})$ required?

I'm studying for the final exams and many example exercises require to design fir notch filters of length 5, given some passband and some stopband frequencies. You've got to find 3 coefficients α0, α1, α2. You need 3 equations.

• R(passband ω) = 1
• R(stopband ω) = 0

I completely understand why these are here. The final degree of freedom is determined by the equation $$H(e^{j0}) = H(e^{j\pi})$$, because such thing is true for notch filters. I struggle to understand why this is true.

• Could you post the complete exercise? I'm a bit confused about the use of the term "passband frequencies", because for a notch filter any frequency is a passband frequency, except for the notch frequency. Also, if you have a length $5$ filter and just $3$ coefficients, I guess the FIR filter is required to have linear phase (but that's not explicitly stated in your question). – Matt L. Jun 23 at 20:37
• Yes @MattL. that's correct, it's required to have linear phase (they don't tell us that which is a bit weird). Your answer is sufficient. – Zarkopafilis Jun 23 at 21:00

## 1 Answer

In general, there is no such requirement for notch filters that $$H(e^{j0})=H(e^{j\pi})$$ must be satisfied. You could definitely have a notch filter with $$H(e^{j0})\neq H(e^{j\pi})$$. Having the same gain at DC and at Nyquist is just a practical definition, and if you have a sufficient number of degrees of freedom (i.e., filter coefficients) you might as well make it a requirement. Ideally you want $$|H(e^{j\omega})|=1$$ for all frequencies except for the notch frequency $$\omega_0$$, for which you require $$H(e^{j\omega_0})=0$$.

As a simple example, take the most primitive notch filter, namely a FIR filter of length $$3$$. Its frequency response must be

$$H(e^{j\omega})=c\cdot \left(1-2z^{-1}\cos(\omega_0)+z^{-2}\right)\tag{1}$$

where $$\omega_0$$ is the notch frequency, and $$c$$ is a scaling constant. All degrees of freedom are taken by the requirement of the notch at $$\omega_0$$, so you don't get equal gains at DC and at Nyquist. Yet, it is a notch filter.

• Is there any advantage of adding same gain at DC and at Nyquist? (Except of having linear-phase side-effects) – Zarkopafilis Jun 23 at 21:02
• @Zarkopafilis: It has nothing to do with linear phase. It's just that you want the same gain everywhere except for at the notch frequency. You don't want to change your signal other than suppressing that one frequency. – Matt L. Jun 24 at 7:59