# Correcting large variable dc bias in signal FFT

I am somewhat new to signal processing, but i'm hoping I can provide enough information in order to be pointed in the right direction.

I am working on analyzing the frequency spectrum of audio signal impulse response. A few of the impulses seem to have what looks like a large variable dc bias, and when performing a FFT they come back with very large DC values.

subtracting the mean did not help much in ways of correction. I think there may be other issues besides what appears to be DC but I am stuck.

The graphs below are plots of the FFT results from two signals - one with the warped dc bias, and one without. Hopefully this demonstrates better what may be happening to cause this. Any help is greatly appreciated.

both Signals are of the same sample length and FFT size

1st Image - FFT of good Signal, small-no DC value

2nd Image - FFT of problem Signal Large DC value

• Can you confirm that you are applying a window function to the signal prior to the FFT ? If not then any DC component will tend to smear across the low frequency bins. Commented Sep 26, 2012 at 9:01
• How are you getting these plots? It looks like you're trying to plot a complex signal on a plane and getting strange plots. You should be plotting the absolute value. Commented Sep 26, 2012 at 13:37
• Thats correct, the above are the complex values. I thought this may provide some insight into what would cause what i'm seeing. The frequencies of interest can be seen here. Frequency Phase Graphs The above shows the problem in the lower frequency and the below is an estimate of what is expected.
– Kero
Commented Sep 26, 2012 at 20:55

Based on the plots shown in the OP, it doesn't appear that the signal you've noted as "bad" just has a DC bias. If there was a DC bias, then it would be expressed graphically as a bulk shift by some amount in the complex plane. Compared to the "good" example, it appears that the "bad" one has some time-varying amplitude modulation, which, when viewed as applied to a phasor in the complex plane, could trace out the loopy patterns shown in the plot.

This supports your claim that you tried just subtracting the mean of the signal and saw little improvement; while there does appear to be a nonzero DC value in the "bad" example, the differences aren't isolated to just the mean value, as I said above. The apparent amplitude modulation will add spectral content over some swath of bandwidth of the signal, which could overlap with the region that you want to analyze.

• your suggestion of amplitude modulation describes very much what I am seeing. Is it possible that a phase issue, perhaps wrapped phase, could be causing this. Here is a frequency with phase plot of the lower frequencies. The top image is the problem result, the bottom is a good result Freqency Phase Plots. The problem result the phase starts at +180, while the good result the phase starts at 0.
– Kero
Commented Sep 26, 2012 at 20:42
• I misread your original message. Like the others, I would like some detail on how you created those plots. How did you get the source data? What operations yielded that plot? I had thought it was some kind of time-domain signal plotted in the complex plane. Commented Sep 26, 2012 at 22:58

Which analysis do you want to perform and why is the DC bias a problem? It is absolutely normal for an impulse response to have a DC offset.

The DC component of an impulse response indicates how the corresponding filter will respond to a DC signal. A high-pass filter has a null response at DC, and thus its impulse response will not have a DC component. But a low-pass filter, or a delay, or a reverb, etc. pass DC signals, and thus their impulse response will have a DC component.

The most common way of plotting a FFT is by having frequency (optionally on a log scale) on the X axis and the magnitude or squared magnitude of the FFT (optionally on a log scale) on the Y axis. The kind of plot you use does not show the frequency information, it's hard to see if there is or not a DC offset (coefficient 0).

• I need to compare specific frequencies from each impulse response. The problem seems to be that the ones with high DC components have their lower frequencies much higher and way off from the other impulses. These are all similar IRs so this boost in low frequencies should not appear.
– Kero
Commented Sep 26, 2012 at 7:09
• Here are the requested plots (1024 FFT) - Good Example, Bad Example
– Kero
Commented Sep 26, 2012 at 7:17
• The first coefficient in the FFT is the DC component. It looks like it is the only coefficient affected. Depending on what you want to do you might simply discard it. Commented Sep 26, 2012 at 7:39
• @Kero: how did you make those plots? generally you want to look at 20*log10(abs(fft(signal))) Commented Sep 26, 2012 at 14:00