# Band pass filter = Band stop filter if you switch the cutoff frequencies?

The normalized frequency response of a N points bandpass digital filter is:

$$\frac{sin(\omega_{c2}(n-M))}{\pi(n-M)}-\frac{sin(\omega_{c1}(n-M))}{\pi(n-M)}$$ where $$\omega_{c1}$$ is the normalized lower cutoff angular frequency , where $$\omega_{c2}$$ is the normalized upper cutoff angular frequency and $$M = floor(N/2)$$.

However the normalized frequency response of a N points bandstop digital filter is:

$$\frac{sin(\omega_{c1}(n-M))}{\pi(n-M)}-\frac{sin(\omega_{c2}(n-M))}{\pi(n-M)}$$ where $$\omega_{c1}$$ is the normalized lower cutoff angular frequency and where $$\omega_{c2}$$ is the normalized upper cutoff angular frequency .

But obviously $$H_{bp}(e^{j\omega}) =-H_{bs}(e^{j\omega})$$ Does this mean that a band pass filter has the same frequency response to a band stop filter if you switch the angular cutoff frequencies?

And what implications does this have in digital filter design?

• Please fix your formulas (the '=' signs between the sincs don't make sense). Second, where did you get that impulse response for the bandstop filter? It's clearly wrong, because inverting a bandpass filter won't result in a bandstop filter. Feb 5 at 17:22
• @MattL. from my university notes. Feb 5 at 17:28
• If that's the case then the notes are wrong. Feb 5 at 17:29

The impulse response of the ideal bandstop filter given in your question isn't correct. Think about it: inverting the sign of the impulse response of a bandpass filter is just another bandpass filter with an extra phase shift of $$\pi$$.

In the frequency domain it's easy to see that the ideal response of a (zero phase) bandstop filter is just $$1$$ minus the ideal response of a (zero phase) bandpass filter (assuming unity gain of both filters in their passbands):

$$H_{BS}(e^{j\omega})=1-H_{BP}(e^{j\omega})$$

In the time domain this is equivalent to

$$h_{BS}[n]=\delta[n]-h_{BP}[n]$$

The impulse at the origin makes an important difference: it switches passbands and stopbands, which is exactly what we need when transforming a bandpass filter to a bandstop filter.

Note that all these filters are zero phase filters. You can simply shift them by an integer $$M$$ (as in the formulas in your question), but don't forget to also shift the impulse.

• That "zero phase" constraint is pretty important, and fixing $H_{bs} = 1 - H_{bp}$ in your mind is a dangerous thing to do without remembering the zero phase constraint. $\left | H_{bs} \right | = 1 - \left | H_{bp} \right |$ is probably much more routinely useful. Feb 5 at 17:42
• @TimWescott: Not necessarily. Note that the (non-zero phase) second order transfer functions also satisfy that equation (without the magnitudes). Feb 5 at 17:47
• It holds for 2nd-order IIR filters, yes. But not, in general, for higher-order IIR filters. Feb 5 at 20:50

But obviously $$H_{bp}(e^{j\omega}) =-H_{bs}(e^{j\omega})$$.

Nope. What gives a bandpass or bandstop filter its name is the amplitude response. Changing the phase by 180$$^\circ$$ doesn't change the amplitude response by one whit.

You need to look at some transfer functions of bandpass and bandstop filters. They're quite different from each other. Using the $$z$$ domain really obfuscates this, so I'm going to demonstrate this in the Laplace domain. Consider two filters, of the same bandwidth:

\begin{align} H_{bp}(s) &= \frac{\frac{\omega_0}{Q}s}{s^2 + \frac{\omega_0}{Q}s + \omega_0^2} \\ H_{bs}(s) &= \frac{s^2 + \omega_0^2}{s^2 + \frac{\omega_0}{Q}s + \omega_0^2} \end{align}

$$H_{bs} \ne -H_{bp}$$ here, and that is never the case. Bandpass and bandstop filters are different, but related beasts.

It happens in this case that $$H_{bs} = 1 - H_{bp}$$ -- that's not the case in general, but it's far more evocative of the fundamental relationship between the two. $$\left | H_{bs} \right | = 1 - \left | H_{bp} \right |$$ is, possibly, a more useful generalization to think about bandpass and bandstop filters, but won't help you much in constructing them.