Dear Sean, At 23.44 2011.12.12, you wrote: >Hi Mario, > >It is not possible to perform filtering without delay - however, what >you CAN do is make the delay predictable and then compensate for it. Yup, that's my aim actually, as FIR filters don't exist into the [EE] world and I don't want to implement one on the PIC, as I need the CPU power for other tasks. >In a linear filter, the delay does not depend on the signal amplitude >(maybe you were referring to feeding the output of the filter into a >digital gate?). Yes the pulse is analog (of unpredictable amplitude and width, however I am interested only in the riding edge), converted to digital via a couple of NPN cascaded transistors (or a comparator, still haven't decided), and fed into the IC pin. >It DOES, in general, depend on the signal frequency. Which I could compensate for, though, as I know when the previous pulse has come, I can thus compute period and frequency, and correct the result accordingly. >However, there is a class of filters called "linear phase" which have >a constant delay over frequency and so they do not distort signals >within their passband. I took a look at this: http://en.wikipedia.org/wiki/Linear_filter They seem to introduce a little phase error though, which is not OK as I need to maintain the 30ns resolution and precision.. >FIR discrete-time filters can be designed to be exactly linear phase >(this includes the method of recording the signal, taking an FFT, >multiplying by the desired frequency response, and then inverting the >FFT). IIR discrete-time filters (performed in real-time) and >continuous time filters cannot be perfectly linear phase but there is >an approximate design method which produces a Bessel filter (as Russel >pointed out here). This is the continuous-time filter type which has >the least possible amount of variation in its delay over frequency, >but still accomplishes some required filtering. > >It would help greatly if you could more fully describe what you are doing. Measuring when (exactly) I receive those analog pulses, just that. What matters to me is the time resolution. In the end it appears that the best solution for my problem may be to capture the rising edge, then for, say, 1 uS, check that the input pin remains high (no glitches). Or simply, even better, shield the thing.. perhaps with LP filtering I'm looking at the problem from the wrong perspective. Cheers, Mario > >Sean > > > >On Mon, Dec 12, 2011 at 2:03 PM, Electron wrote: >> >> Hello, >> I have to get the *exact* timing (30ns resolution) of some low=20 >frequency (<250Hz) pulses >> via an input capture module, however I'd like to filter the signal=20 >coming in, as it will >> contain a lot of high frequency noise, but filtering via a capacitor=20 >introduces a phase >> delay, which I can't even compensate (by frequency) as the phase=20 >delay changes with input >> signal amplitude. >> >> What is the way You'd approach this problem? I thought about using a=20 >zener to clip the >> signal and thus work on a known amplitude, but I suspect it will=20 >introduce errors too. >> >> On the software side, I could make sure that the input stays high=20 >for enough time, but >> it's pretty overkill, and I'd like to keep it as last option. If it=20 >could be done [EE] >> then it would be better! >> >> With kind regards, >> Mario >> >> -- >> http://www.piclist.com PIC/SX FAQ & list archive >> View/change your membership options at >> http://mailman.mit.edu/mailman/listinfo/piclist >--=20 >http://www.piclist.com PIC/SX FAQ & list archive >View/change your membership options at >http://mailman.mit.edu/mailman/listinfo/piclist --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .