# How does works a bandpass filter?

My question is about the action of a bandpass filter. First, I have a temporal signal. I convert it in a spectral signal via a FFT. Now, I want to apply a bandpass filter on that spectral signal. But my question is : how to do it ?

My temporal signal is a real signal so, I understand how to multiplicate by a coefficient. But my spectral signal is complex so, what do I have to do ? Multiplicate the real part and the imaginary part by the coefficient ?

Dr_Click

• You are really asking a question that can be answered better someplace else, like the online MIT courses that are free and open to everyone. If you can describe how you want to do your processing like in C or C++ on a laptop, or using tools like MATLAB or Octave, or R, or Python, someone can point you in the right direction where there are examples and tutorials. – Stanley Pawlukiewicz Jun 19 '18 at 16:08

You're wanting the magnitude of your spectrum to decrease in certain areas (since you're trying to filter out those frequencies). So, yes, you could just multiply your real and imaginary components but your coefficient. For example, if you have a number $5 -5i$, the magnitude is $\sqrt{5^2 + (-5)^2} = 5\sqrt{2}$ if you want to decrease this magnitude by 50% you would just multiple your real and imaginary numbers by .5. This can be seen by $\sqrt{(5*.5)^2 + (-5*.5)^2} = 2.5\sqrt{2}$

Note, that if your wanting to filter you signal in the frequency domain, and then transform it back to the time domain, you probably don't want to do a rectangular window, where you multiply the frequencies you want to filter out by 0, and everything else by 1. This would create some wide band noise in the time domain.