# Filter filters out more than needed

I am currently coding a school assignment. I have a 1.5s recording of someone's speech that has 4 rogue cosines mixed in. With sampling rate 16000Hz, I divided the recording into frames of 1024 samples with an overlap of 512 samples.

I picked up a frame that has no speech mixed in so that the rogue cosines are not influenced by the the speaker's voice.

Here is the resulting plot of the magnitude of the discrete fourier transform (the phase part is not needed right now):

With a range from 0 to 8000Hz, with the frequency bins sized 16000/1024=15.625Hz, I was able to pinpoint the frequencies of these out. It's about 875, 1750, 2625, 3500, each in Hz.

My first question is this: what does the vertical axis reprezent on the DFT? Yes, it's the magnitude, but what does it really mean? Does it mean that the cosine wave with the frequency 875 Hz has an amplitude of 30? Or is it 60 as there is also the negative frequency?

Our next goal was to filter these out. Okay, so I constructed a filter that has zeroes at those frequencies (and their conjugated pairs for the negative frequencies). Here is what its transfer function looks like:

The coefficients of zeroes are:

$$1, -4.847, 12.176 , -20.048 ,23.521, -20.048, 12.176 ,-4.847 , 1$$

The coefficient of a singular pole is: $$1$$

I thought that would destroy these four frequencies, but it, however, destroyed all frequencies up to about 12000Hz.

Here is the frequency response graph:

To sum it up, there are two things I do not understand:

The meaning of the vertical axis in DFT and its relationship with the amplitudes of the cosines im looking for.

Why the filter filtered out almost everything in my signal.

1. The meaning of DFT coefficients is given directly by the definition of IDFT: $$x(n) = \frac{1}{N}\sum_{k=0}^{N-1} X(k)e^{j2\pi kn/N}$$ It means that a time sequence $$x(n)$$ can be represented by a weighted sum of complex sinusodial component $$e^{j2\pi kn/N}$$, and the weights are the DFT coefficients. It doesn't mean that $$x(n)$$ is composed of these frequency components. For example, the DFT of a sine wave with an irrational frequency, no matter how many sample DFT do you take, the coefficients always have two peaks (due to conjugate symmetry) but other frequencies remain non-zero, but we know that it is a single frequency signal!
2. You can't design a notch filter by just put some zeros at the target frequencies. A notch filter removes the undesired frequency components but remains a relatively flat response at other frequencies. To achieve this you want some poles. A biquad notch filter has a transfer function as $$H(z) = \frac{K(z-e^{j\omega_0})(z-e^{-j\omega_0})}{(z-re^{j\omega_0})(z-re^{-j\omega_0})}$$ where $$\omega_0$$ is the normalized frequency, $$K$$ is a constant and $$0\leq r<1$$ controls the bandwitdh of the notch filter. When $$r\rightarrow 1$$ the bandwitdh becomes more narrow, but it suffers more from the quantization error.