# FFT Background subtraction in MATLAB

Using MATLAB I need to subtract the background files from the real signal I am trying to measure. We took data of just the background noise prior to driving the system with some voltage, so we do not have to estimate the background, I need to know if i can subtract the two phase wise or how I can do this with the real and imaginary parts.

Thank you!!

## 1 Answer

I'm assuming since you didn't say that you're working with audio. But my answer generally applies if you're working with images/video as well. Unless the background you're trying to subtract is exactly the same, I doubt subtracting a phase-inverted version of the signal will work. It sounds like what you're trying to perform is spectral subtraction. This is a common technique where you simply subtract the average FFT magnitude spectrum from your signal. See this paper on spectral subtraction. If working with images/video, I assume that you could do this in 2 dimensions as well and the math would be similar.