DC gain from an impulse response I am studying for my exam in signal processing. For one of the old exam sets, a discrete impulse response of a filter is given as $h[n]$
\begin{bmatrix}
-3&amp;0&amp;-3&amp;0
\end{bmatrix}
With a frequency response $H[k]$. What is the easiest way of calculating the DC gain from this information? I have tried using a DFT but did not see any usable conclusion.
The DC gain is simply the sum of filter taps or coefficients. This is the value of the frequency response at DC (i.e. $0\ \rm Hz$), or equivalently
$$
H(0) = \sum_{n = 0}^{N - 1}h[n]\tag{1}
$$
Because, for a digital FIR filter of length $N$ with impulse response given by Equation $(2)$
$$
\big\{h[n]\big\}, \quad\text{with}\quad 0\le n\le N -1\tag{2}
$$
the frequency response is the $z$-transform at the unit circle (i.e. $z = e^{j2\pi f}$), or in this case, equivalently
$$
H(e^{j\omega}) \equiv H(\omega) = \mathcal F \left\{h[n]\right\} \triangleq \sum_{n = 0}^{N - 1}h[n]e^{-j\omega n } = \sum_{n = 0}^{N - 1}h[n]e^{-j2\pi n f}\tag{3}
$$
Then you can think at DC (i.e. at $0\ \rm Hz$ or $f = 0$ or $\omega = 0$) to see the why of Equation $(1)$.
From DTFT to DFT
The DFT is the one practically computed in place of the DTFT. For finite-length signals (as is the case here), it provides the frequency-domain samples of the DTFT. Then $H[k]$, which is the DFT of the $h[n]$,  is computed for $N$-point as shown in Equation $(4)$
$$
H[k] = H(e^{j\omega}) \bigg\vert_{\omega = 2\pi k/N}\quad\text{with}\quad 0\leq k \leq N -  1\tag{4}
$$
i.e. $H[k]$ consists of equally-spaced (by $2\pi/N$) samples of $H(e^{j\omega})$.
Noting that
$$\omega \equiv 2\pi f \quad\text{with}\quad -\pi \leq \omega \leq \pi\quad\text{and}\quad -\frac 12 \leq f \leq \frac 12$$
With $\omega$ in [radians/sample] and $f$ in [cycles/sample].
In MATLAB
This can be done using MATLAB's freqz function as follows:
&gt;&gt; [h, w] = freqz([-3 0 -3 0], 1, [0 , pi/4])

h =

 -6.000000000000000 + 0.000000000000000i -3.000000000000000 + 3.000000000000000i


w =

                   0   0.785398163397448

&gt;&gt; 

Giving you the flexibility to specify at whatever angular frequencies $\omega$  (in example above the evaluation is at two frequencies $0$ and $\pi/4$ rad/samples) you would want to evaluate the frequency response, (Here we're interested in the value at $\omega = 0$).  The magnitude response with these two points is shown below

Note that the two points in magenta correspond exactly to
&gt;&gt; 20*log10(abs(h))

ans =

  15.563025007672874  12.552725051033063

&gt;&gt; 

The values at $\omega = 0$ and $\omega = \pi/4$ respectively.