Electronic – How to high pass (DSP) filter a low frequency signal without introducing lag

dspfilterMATLABsoftware

I need to high pass filter a signal, and my design just isn't cutting it. The part that's making it tricky is that I can't tolerate lag. I am sampling at 20Hz, the signal I care about is 1/12 to 1/4Hz, and my system has to be as real time as possible (a lag of 2 seconds for signal processing is about all I can handle). The corner frequency is flexible, but has to be below 1/10Hz worst case.

I have been using an IIR-like lowpass filter like this:

signal_low_freq(n) = (signal_low_freq(n-1)*(filter_constant - 1) + (sensor_data(n))) /filter_constant;

signal_ac(n) = sensor_data(n) - signal_low_freq(n);

where filter_constant = 165.

It has low latency, but also introduces a large amount of phase related error (I measured it at about 100 samples of lag).

I have used Matlab's fdatool, and can get great results with a high order FIR filter, but that's obviously far too much lag.

Does anybody have a good solution to this DSP problem?

As a note: in the audio range, it's analogous to sampling at 48kHz and high-pass filtering with a corner frequency somewhere between 150Hz and 240Hz.

Best Answer

I'm afraid you're up against a fundamental limitation of real, causal physical systems. You're asking for a filter that can distinguish between signals that have periods of 12 to 16 seconds, but only allowing it to "look at" a 2-second segment (1/6 to 1/8 of the period) of the waveform in question. It simply isn't possible to get no phase shift and low delay under these circumstances.

Can you provide some more context for this problem? What is the nature of the signals, and why is such low processing latency required?