# How do I calculate the impulse response of an ideal band-pass filter?

I understand the FR of an ideal BPF is just 1 between the two cutoff frequencies and 0 everywhere else above and below them both. But with arbitrary cutoffs, how would one find the IR of this ideal basic filter type?

• is this a discrete-time filter or a continuous-time ideal BPF? Apr 20, 2018 at 19:49
• i guess it doesn't matter much. Apr 20, 2018 at 19:50
• I mean, wouldn't it be continous by default? Since any ideal filter only exists with infinite samples? I'm still super lost on how to approach calculating the impulse though, especially since I need to then take this Impulse Response function and turn that into different FIR filters for several sample lengths. Any ideas? Apr 20, 2018 at 20:05
• what is "default" is normally a choice. some people design digital filters directly in the discrete-time domain, or the $z$-plane. other people design digital filters first in the continuous-time domian, or the $s$-plane and covert $H(s)$ to $H(z)$ using something, either the impulse invariant method or the bilinear transform. Apr 20, 2018 at 23:46

Hint:

\begin{align} h(t) &= \int_{-\infty}^\infty H(f)\exp(j2\pi ft)\,\mathrm df\\ &= \int_{-f_2}^{-f_1} H(f)\exp(j2\pi ft)\,\mathrm df + \int_{f_1}^{f_2} H(f)\exp(j2\pi ft)\,\mathrm df\\ &= \int_{-f_2}^{-f_1} \exp(j2\pi ft)\,\mathrm df + \int_{f_1}^{f_2} \exp(j2\pi ft)\,\mathrm df \end{align} which you ought to be able to compute for yourself. A little algebra and trignometry might be needed to massage the answer into a nice formula involving the sinc function times a cosine.

• k so I understand why it's two integrals, to represent the space between 0 and nyquest frequency in both positive and negative sides. I understand that integrals are only targeting where H(f) is 1, so that can be factored out. But I don't understand how this turns into a sinc function... Apr 20, 2018 at 20:36
• Nothing is factored out, and if you will try to calculate the integrals (further hint: the antiderivative of $\exp(ax)$ is $\frac 1a\exp(ax)$), maybe you will get some idea of how a sinc might arise. Apr 20, 2018 at 21:03

Here's another way to look at Dilip's answer... just wanna get the definitions down.

continuous Fourier transform:

$$X(f) \triangleq \mathscr{F} \Big\{ x(t) \Big\} \triangleq \int\limits_{-\infty}^{+\infty} x(t) \, e^{-j 2 \pi f t} \ \mathrm{d}t$$

and inverse:

$$x(t) \triangleq \mathscr{F}^{-1} \Big\{ X(f) \Big\} = \int\limits_{-\infty}^{+\infty} X(f) \, e^{+j 2 \pi f t} \ \mathrm{d}f$$

It's not hard to show:

$$\mathscr{F} \Big\{ \operatorname{rect}(t) \Big\} = \operatorname{sinc}(f)$$

where

$$\operatorname{rect}(u) \triangleq \begin{cases} 1 \qquad & \mathrm{for} \ |u| < \tfrac12 \\ \tfrac12 \qquad & \mathrm{for} \ |u| = \tfrac12 \\ 0 \qquad & \mathrm{for} \ |u| > \tfrac12 \\ \end{cases}$$

and

$$\operatorname{sinc}(u) \triangleq \begin{cases} 1 \qquad & \mathrm{for} \ u = 0 \\ \frac{\sin(\pi u)}{\pi u} \qquad & \mathrm{for} \ u \ne 0 \\ \end{cases}$$

.

And duality tells us if $X(f) = \mathscr{F} \Big\{ x(t) \Big\}$, then $x(-f) = \mathscr{F} \Big\{ X(t) \Big\}$.

We know, for the ideal LPF

$$H_\mathrm{LP}(f) = \operatorname{rect}\left( \tfrac{f}{f_B} \right)$$

and impulse response

$$h_\mathrm{LP}(t) = f_B\operatorname{sinc}(f_B \, t)$$

Frequency translation tells us that

\begin{align} \mathscr{F} \Big\{ 2 \cos(2 \pi f_0 t ) \ h_\mathrm{LP}(t) \Big\} &= \mathscr{F} \Big\{ \big( e^{j 2 \pi f_0 t} + e^{-j 2 \pi f_0 t} \big) \ h_\mathrm{LP}(t) \Big\} \\ \\ &= H_\mathrm{LP}(f-f_0) + H_\mathrm{LP}(f+f_0) \\ \\ &= \operatorname{rect}\left( \tfrac{f-f_0}{f_B} \right) + \operatorname{rect}\left( \tfrac{f+f_0}{f_B} \right) \\ \end{align}

Now, with all of those explicit definitions above, can you tell us how $f_0$ and $f_B$ relate to Dilip's $f_1$ and $f_2$? And then how to specify your ideal BPF in terms of these frequencies?

• and, so far, there is no Nyquist frequency. we're in continuous-time mode for the time being. Apr 21, 2018 at 2:58