Peak "detector" to detect TIMING of peaks - Page 1
Forum section: electronics / beginners

author: Infraviolet
author_rank: Super Contributor
timestamp: May 25, 2023, 07:31:11 pm
content: I've been wondering what sort of circuits would be used for this application, but can't find them by searching because the obvious name "peak detector" is ofcourse already applied to circuits which hold the level of a peak.I'm looking to produce a sharp rising edge (dropping back down after some chosen short* interval) when an incoming analogue signal goes through a (local) maximum**, something which will trigger this pulse just as a rising signal starts to become a falling signal again (I can low-pass filter this incoming signal enough to avoid noise peaks giving false triggers).*exact time to be decided, but somewhere < 20% of the typical time usually expected as the shortest plausible between peaks**any event where a rising signal has a change in dV/dt switches sign such as to have the signal start fallig againI'm looking to do this with generic ICs mostly, op amps and that sort of thing, not specialised single purpose chips and not building up from individual transistors either.Can anyone suggest good search terms to find this sot of circuit, given that the word "detector" is pretty much reserved for level holding circuits rather than ones which make a logic level transition at the time of the peak.ThanksEDIT: I've just realised I could probably do this with a differentiator circuit feeing in to a zero crossing detector, but is there a better way?

author: David Hess
author_rank: Super Contributor
timestamp: May 26, 2023, 06:48:32 am
content: A differentiator can be used to reveal the peak of a pulse when its output crosses zero, however differentiators are prone to noise.

author: artag
author_rank: Super Contributor
timestamp: May 26, 2023, 09:07:38 am
content: A differentiator is pretty much the definition of this circuit. What you're trying to detect is the slope of zero, either by measuring the slope directly or by some indirect technique such as a peak-hold circuit followed by a comparator to detect when the present value is less than the peak.It's problematic, as David says. You can help, bu first low-pass filtering and then differentiating. But that introduces delay. Such are the compromises you have to make when designing real-world circuits.

author: Infraviolet
author_rank: Super Contributor
timestamp: June 04, 2023, 08:56:20 pm
content: Is there a nice way to make a zero crossing detector which only triggers on a rising edge? So one can check the differentiator's output to detect only maximums of the original signal, not minimums? Would one have to feed in to another differentiator to take 2nd derivatives, or is there a more straightforward way? What do microcontrollers actually have inside where they've got pins which can give an interrupt specifically on a rising/falling (delete as apropriate) edge but not a falling/rising (vice-versa) edge?

author: dobsonr741
author_rank: Frequent Contributor
timestamp: June 04, 2023, 10:35:08 pm
content: MCU interrupt can be triggered by only one specific edge.

author: Infraviolet
author_rank: Super Contributor
timestamp: June 05, 2023, 01:15:35 am
content: That's what I meant, in an MCU how does it know whether the edge it is seeing incoming is an edge in the direction you told it to watch for. If you have programmed it to act on a rising edge interrupt how does it know the diference between a rising and falling edge, the same method might be applicable to my situtaion.

author: dobsonr741
author_rank: Frequent Contributor
timestamp: June 05, 2023, 02:58:36 am
content: Create a simple analog comparator for zero crossing. I assume your signal is bipolar. Use the output as the IRQ. Enable whichever direction of the transient you are interested.If the signal is noisy add hysteresis larger than the pp noise.

author: EPAIII
author_rank: Super Contributor
timestamp: June 05, 2023, 08:55:18 am
content: A-D converter into a u-processor and detect the direction of change in software. Output a high pulse when that occurs. Some processors even have A-Ds built in.

author: EPAIII
author_rank: Super Contributor
timestamp: June 05, 2023, 09:04:51 am
content: How to tell up from down with analog detector? Diodes, of course. Capacitor passes HF component of an edge. You get pulses in both directions and a relatively low value resistor can bias them at ground. Then a diode to ground will short one polarity while leaving the other polarity alone. Easy-peasy!But that assumes the transition is rapid and therefore has a HF component. If a slow change must be detected, then my answer above would be a lot better. Software can easily and reliably detect a one count downward change every single time it happens.Quote from: Infraviolet on June 05, 2023, 01:15:35 am

author: jpanhalt
author_rank: Super Contributor
timestamp: June 05, 2023, 09:14:16 am
content: Quote from: Infraviolet on June 05, 2023, 01:15:35 amMicrochip explains its method for edge and related tools here:https://onlinedocs.microchip.com/pr/GUID-C866D457-41E2-43C7-8442-2F1193FAAD9F-en-US-4/index.html?GUID-0F89E4C8-20A1-4788-8448-C67FB3569C68EDIT: This has a little more explanation:https://electronics.stackexchange.com/questions/95504/how-does-this-synchronizing-edge-detector-logical-diagram-work

author: nfmax
author_rank: Super Contributor
timestamp: June 05, 2023, 11:14:25 am
content: To find a peak, differentiate the input signal using a high-pass analogue filter. Then zero-crossings of this filter output correspond to local extrema of the signal. A + to - crossing corresponds to a positive peak. Remember to allow for the delay through the high pass filter, and remember also the delay will vary with frequency.You will need to apply some low pass filtering as well, to reduce the effect of noise, but this will not be enough by itself. The best way is to ‘mute’ the comparator digital output when the input signal is low. You can do this with another comparator, comparing the input signal with an adjustable threshold. You need some digital logic to allow an output (e.g. to trigger a monostable) only when the signal is ‘high’ and the zero crossing is in the ’right’ direction. This depends on your needs, but mostly you might want to detect maxima of a positive signal and/or minima of a negative signal. Note that if you need both, you will need two level comparators, with two different thresholds (positive & negative)The logic can take the form of chips or of software, whichever you choose, as can the monostable.

author: Siwastaja
author_rank: Super Contributor
timestamp: June 05, 2023, 02:02:50 pm
content: Is digital domain, e.g. a microcontroller, out of question? That would enable experimenting with different algorithms, filtration options etc.. In analog domain, you are pretty much limited to simple LPF followed by differentiator followed by comparator with hysteresis. Even just making them all adjustable is already quite some many components and trimpots.What sort of times are we talking about? Millisecond, microsecond, nanosecond accuracy? How about rise/fall times of your signal?