Can anyone point me towards a formula for a good (for any values of "good") no-lag causal bandpass filter?
I am doing sound processing and I need to identify starting points of certain sounds (target precision <10 ms.) I've been using a Lanczos filter followed by convolution with a sine wave to do spectral analysis, but that gives me skewed results because amplitudes at any given time are being affected by stuff that's happening at later times (the filter is non-causal).
Simply cutting off the right half of the Lanczos filter resolves that particular problem, but the resulting spectrum is badly messed up (I get heavy sideband spillover). All other simple filters I tried are even worse.
Half an hour of googling turned up several mentions of Butterworth filters, lots of transfer functions (which I could not care less about), but no formulas of actual kernels.
EDIT: Let me try to be more specific. I start with a narrow-band filter with impulse response:
$$ h(t) = \begin{cases} C \, e^{i 2 \pi t/T} \operatorname{sinc}^2\left(\tfrac{t}{NT}\right) \qquad & |t| \le NT \\ 0 & |t| > NT \\ \end{cases} $$
where $\operatorname{sinc}(u) \triangleq \frac{\sin(\pi u)}{\pi u}.$
With $T=$2 ms and $N=$10, that gives me 0 dB at 500 Hz and <-40 dB below 440 or above 560 Hz. The support is $2NT$=40 ms. If I use it on an input that goes from zero to a pure 500 Hz sine wave at time $t_0$, response goes from exactly zero to just over zero at $t_0$, to half the maximum level at $t_0+NT$, and stabilizes when the entire area under the filter is a sine wave. The "effective" lag (time to 50% level) is 20 ms.
What I'd like to do is to bring this "effective" lag as close to zero as possible, while maintaining the overall discrimination ability (being able to distinguish between a 440 Hz sine wave and a 500 Hz sine wave.)