# Which method to choose to get linear phase response zero group delay low-pass filter?

Background: I do time-dependent simulations of physical systems. Like this: http://journals.aps.org/prb/abstract/10.1103/PhysRevB.91.115431 During the simulation, observables are recorded and later Fourier (usually sin-transformed) transformed to analyse things like absortion of a nanoparticle. The problem is that the system is huge in and all time steps cannot be stored to hard disk. But maybe I could save every 10th or 20th iteration to hard disk. This quantity is the density matrix. But for this questions purpose, each element of this matrix are to be filtered independently.

To prevent folding, one needs to low-pass filter the signal. Our analysis methods are extremely sensitive to phase, if the signal is sin, it needs to remain that way. Phase deviation (mixing of cos) will ruin the analysis. Then the filter has to have a zero delay (but it can access future data to some extent). Then it has to filter sharply before Nyquist frequency to prevent folding.

I played with matlab a year ago a bit, but was unable to produce such a filter. I have very litle experience with DSP, so I am therefore asking for suggestions. Is such a filter possible, what I require? To what extent one has to give up on the requirements? IIR or FIR? How to generate the filter coefficients? How long does the filter have to be?

Lets say the data is 10Hz, can I get a linear phase response with no delay up to 0.4Hz, if I resample a low-pass filtered signal at 1Hz.

I was also thinking that if this is not possible, perhaps one could send the preliminary filtered and presampled data through a "correction" filter to reconstruct the data at 10Hz.

(In reality, the signal is $10^{15}$ Hz)

Update: I tried to create symmetric FIR low-pass filter.

%symmetric FIR low-pass filter
N=200
M = N/2;
n=0:N;
wc=0.02 * 2 * pi;
h = sin(wc*(n-M)) ./ (pi*(n-M));
h(M+1) = wc/pi;
new_signal = conv(signal, h,'full');
plot(signal,'b-');
hold on
plot(new_signal,'r-');
% Resample
time=(0:(prod(size(new_signal))-1))*dt - M*dt;
time=time(1:10:end)';
new_signal = new_signal(1:10:end);


In the figure below with bold red, is a quantity calculated from the original signal. It has a frequency content till about 80 (eV, but unit is irrelevant). It has a characteristic feature that it is always positive. If I just resample the signal 10:1 without any filtering, I get the green curve. It has terrible folding effects, but it is actually not that bad. With blue is my first attempt of a symmetric filter, but I used conv(...,'same') so I basically tossed away the beginning of the signal. This resulted into some unwanted phase effects (negative values close to zero frequency). In purple curve, I keep the acausal part of the signal, and this resolves that issue (the conv(...,'full', and -M*dt parts of my script). One has also clearly a low-pass filter effect near frequency 10. Cyan curve the same thing, but only with 20 coefficient FIR filter, and that does not seem to work at all.

In the second figure one sees that basically all the filters cause unwanted negative signals close to zero frequency. So I have not yet found the filter I am looking for.

Also, none of the filters produce well the amplitude of the 'plasmon' peak at 4eV.

Any ideas?

• There is some confusion in your question: linear phase does not imply zero delay. Since the group delay is the negative derivative of the phase, a linear phase system has constant group delay. Zero group delay would mean that the phase is constant (usually zero), not linear. However, I guess a linear phase system would be sufficient because it does not distort the phase, it just delays the signal, and the delay is known. – Matt L. Feb 9 '16 at 7:42
• Yes, correct. So I actually I want a zero group delay on the pass band. Basically I can just create a linear phase filter, and then shift the signal accordingly. This is why I implied that I have the knowledge of future signals, so that one can put the correcting delay back to the filter. – Mikael Kuisma Feb 9 '16 at 9:50
• Maybe I should upload a demo signal, and my attempt for the filter? – Mikael Kuisma Feb 9 '16 at 9:52
• If you want a zero group delay low pass filter you need an impulse response that is symmetrical with respect to time index $n=0$, i.e. it is non-causal. – Matt L. Feb 9 '16 at 9:53
• Thanks, I think that is what I need! Which filter type would you recommend? Signal will be about a gigabyte per "sample", so preferrably the filter should have as little coefficients as possible. Multistage filter to reduce sample rate by factor of two each is a possibility too? – Mikael Kuisma Feb 9 '16 at 10:08