How to Remove DC Offset before Performing FFT

Performing FFT to a signal with a large DC offset would often result in a big impulse around frequency 0 Hz, thus masking out the signals of interests with relatively small amplitude.

Remove_DC_Offset_Blog_10

Origin provides two methods to remove DC offset from the original signal before performing FFT:

  • Using FFT High-Pass Filter
  • Subtracting the Mean of Original Signal

Note that these two methods can get the same result. You can also not filter the input, but set zero to the zero frequency point for FFT result.

Using FFT High-Pass Filter

Any DC bias on the signal will show up in the frequency domain as amplitude at zero Hz, by setting the cutoff frequency to be zero DC offset can be filtered. Steps are as following:

  1. Import the fftfilter2.dat under Origin exe\Samples\Signal Processing\ folder.

  2. Highlight the source signal column Amplitude, and select menu Analysis: Signal Processing: FFT Filters.

  3. In the pop-up dialog, choose High Pass for Filter Type, uncheck Auto checkbox to set Cutoff Frequency to zero and clear the Keep DC offset check-box.

Remove_DC_Offset_Blog_07

  1. Click OK button to get the result without DC offset.

Remove_DC_Offset_Blog_08

 

Subtracting the Mean of Original Signal

  1. Now we have the original signal stored in column B (Amplitude). Hold Ctrl + D to add a new column C for storing DC offset removed signal and input DC Offset Removed as Long Name.

  2. Highlight column C, and select Set Column Values from the context menu to bring up the Set Values dialog.

  3. In Before Formula Scripts panel of the Set Values dialog, put the script:

stats col(b);

Then in the column formula text box, fill column C using the formula:

col(b)-stats.mean

Remove_DC_Offset_Blog_03

  1. Column C is the result without DC offset.

Remove_DC_Offset_Blog_09

 

Tips: 

If you need to get the DC offset, open the dialog mentioned in method one, then use the low-pass filter, and set Cutoff Frequency to zero, or use the Mean function to calculate the mean of the signal:

DCOffset = Mean(col(B));

One Comment on “How to Remove DC Offset before Performing FFT”

Leave a Reply

Your email address will not be published. Required fields are marked *