Find signal power in a band by integrating the PSD in a frequency band (and zeroing the out-of-band DFT bins)
For a DFT that was computed with only a rectangular window (no further windowing beyond the selection), the power in the &quot;out of band&quot; bins contains signal energy from &quot;in-band&quot;, so by zeroing those out, you are not including the power that should be in the computation. The challenge however is that if there is energy out of band, it will similarly have components within your band of interest! Here we see that the real flaw is trying to comput the power within a bandwidth without windowing the signal in the time domain first to reduce the effects of sidelobes in the DFT.
More details on doing this accurately, and specifically accounting for the power loss due to the windowing, and the change in the equivalent noise bandwidth of each bin, please see this post here:
How can I get the power of a specific frequency band after FFT?
and
How to calculate resolution of DFT with Hamming/Hann window?