FIR filter Gain of 0dB at Passband Frequency
FIR coefficients are $h[n]$, the same as the impulse response.  there are $N$ non-zero taps.

$$ h[n] = 0 \qquad \text{for } n&lt;0, n \ge N $$

frequency response is

$$\begin{align}
H(e^{j \omega}) &amp;= \sum\limits_{n=-\infty}^{+\infty} h[n] e^{-j \omega n} \\
                &amp;= \sum\limits_{n=0}^{N-1} h[n] e^{-j \omega n} \\
                &amp;= \sum\limits_{n=0}^{N-1} h[n] \big( \cos(\omega n) - j \sin(\omega n) \big) \\
\end{align}$$

the magnitude-squared is

$$\begin{align}
\Big| H(e^{j \omega}) \Big|^2 &amp;= \left| \sum\limits_{n=0}^{N-1} h[n] e^{-j \omega n} \right|^2 \\
                &amp;= \left| \sum\limits_{n=0}^{N-1} h[n] \big( \cos(\omega n) - j \sin(\omega n) \big) \right|^2 \\
                &amp;= \left| \sum\limits_{n=0}^{N-1} h[n] \cos(\omega n) - j \sum\limits_{n=0}^{N-1} h[n] \sin(\omega n) \right|^2 \\
                &amp;= \left( \sum\limits_{n=0}^{N-1} h[n] \cos(\omega n)  \right)^2 + \left( \sum\limits_{n=0}^{N-1} h[n] \sin(\omega n) \right)^2 \\
\end{align}$$

you must square root that expression to get magnitude of gain

$$ \Big| H(e^{j \omega}) \Big| = \sqrt{\left( \sum\limits_{n=0}^{N-1} h[n] \cos(\omega n)  \right)^2 + \left( \sum\limits_{n=0}^{N-1} h[n] \sin(\omega n) \right)^2 }  $$

evaluate at at your known PassbandFreq $\omega_0$ (normalized angular frequency) and divide each $h[n]$ by that gain magnitude:

$$ h[n] \leftarrow \frac{h[n]}{\ \big| H(e^{j \omega_0}) \big| \ } $$