JJ,
If f(t) is even, then there will be no phase shift, so we can simply apply the filter twice. Problem solved.
Wrong. An even filter that is not symmetric will have phase shift, and a delay component of N/2-.5 samples.
I see you are using a slightly different definition of "even" than I am. I have always understood the term even to mean that f(t) = f(-t), for all t, which implies that it is symmetric about t = 0.
Are you sure you don't have the terms "symmetric" and "even" mixed up? For example, a function for which f(t-a) = f(a-t) would be symmetric about t = a, but would not be even.
In both cases, it's the symmetry about the center that is the key to a constant-delay filter, notice.
Then we are in agreement. That is what I meant by even.
If we can somehow apply the filter backwards in time, then the function response function will be f(-t). The Fourier transform of f(-t) is the complex conjugate of the Fourier transform of f(t). This means that applying the filter, followed by the time-reversal of the filter, should give the proper frequency response function, and no phase-shift.
The only problem is how to apply the filter in reverse. I would think that the implementation would depend on the circumstances. For example, if the filtering is being done digitally on a computer, it is trivial.
Dr. Stupid
--------------------------------------------------------------------------------
Since I specified the filter as FIR, you can simply convolve it with itself, reversing axis for one (i.e. time reversal of one copy of the FIR). This will force the filter to be odd length (if original filter is 'n' long, for even or odd 'n', the final one will be 2n-1, always odd),and symmetric, ergo no phase shift and an integer sample delay.
Yes, that is clear. Likewise if the filtering is done in the frequency domain, you can simply take the norm of the complex transfer function, where the norm of a complex number is defined to be the product of itself and its complex conjugate. Like I said, if it is being done digitally on a computer, then it is trivial. I just wasn't sure you were not referring to some general condition, for example, a hardware filter. Although I guess, in principle, any hardware filter would have to be an IIR filter.
(NB. Any time delay is in fact a phase shift of t*f, but that is equal to a pure delay. Phase shift in this case refers to the non-pure-delay component.)
I see, once again the terminology screwed me up. My knowledge of these things comes from a purely mathematical approach, rather than an applied one. I have always referred to a time-delay as simply being a special case of a frequency dependant phase-shift.
Since this thread has already derailed from its original, somewhat pointless topic, perhaps I can derail it further with some practical questions which have real relevance to my own work. Maybe you can help me out.
I have recently had to rewrite all the filtering software we use here in our lab, because the software we were using is not only buggy, but poorly documented, so that we don't know exactly what it is doing. All of our filters are frequency domain, zero phase-shift, zero time-delay, Butterworth filters. There are two issues which have somewhat puzzled me.
1) Zero padding: Since the signals being filtered are not periodic, some wrap-around effects will be present. This problem is usually resolved by padding the end of the filtered signal with zeroes. For time domain filtering with an FIR filter, this is simple. The amount of padding needed is just 1/2 the total length of the FIR filter.
Any idea how to estimate the appropriate padding length for a frequency domain filter, other than the brute-force method of inverse Fourier transforming the frequency response function, and seeing how long it takes it to go to (effectively) zero?
2) Notches. We need to apply band-stop notches to our filters, in order to block artifacts at certain frequencies. Specifically, we need to remove the 50 Hz signal which corresponds to the power lines. This shows up as very strong delta-like peaks at 50Hz, 100Hz, and so on. We started off by combining Butterworth band-stop filters with our other filters, but we find that the signal is so singular, than we must make our band-stop much wider than the actual peak, in order to completely eliminate it.
I have constructed a new type of notch, which essentially takes the form f(w) = 1 - exp[-(1/x)^2], where x = 0 is the location of the notch. This seems to give a nice smooth notch, which can destroy any singular peak without being much wider than the peak. The question is, can you think of any potential problems using such a notch could present?
Thanks,
Dr. Stupid