EducationWhat is peak detector - Peak detector circuit and types

What is peak detector – Peak detector circuit and types

Category articles

What is peak detector

Peak detectors are electronic circuits designed to capture and hold the maximum voltage level of an input signal. They are fundamental components in various signal processing applications, including audio processing, RF communication, and data analysis. The basic elements of a peak detector circuit include a diode, a resistor, and a capacitor. The diode directs the current flow, the resistor allows the capacitor to discharge, and the capacitor stores the voltage.

There are different types of peak detectors:

  1. Positive Peak Detector: Captures the positive peak of the input signal.
  2. Negative Peak Detector: Captures the negative peak of the input signal.
  3. Peak-to-Peak Detector: Captures both the positive and negative peaks of the input signal.

Peak detectors can operate in two modes:

  • Real-time Peak Detection: Processes the input signal continuously, suitable for applications needing immediate response.
  • Sampled Peak Detection: Samples the input signal at intervals, reducing complexity and power consumption.

Some peak detectors include a reset function to restart the peak detection process, which is vital in varying signal scenarios or frequent peak refreshes.

Peak detectors are used in various fields:

  • Audio Processing: For volume normalization or dynamic range compression.
  • RF Communication: To measure signal power levels.
  • Data Analysis: For identifying maximum values in data streams.

Designing a peak detector involves balancing response time and hold time, determined by the circuit’s resistance and capacitance. A smaller time constant provides quicker response but shorter hold time, and vice versa. Challenges in peak detector design include diode forward voltage drop, which can introduce errors, and capacitor leakage current, which can decrease the stored peak value. Modern designs address these issues with operational amplifiers and high-quality capacitor

peak detector

How peak detector works

A peak detector works by continuously monitoring an input signal and storing its maximum value, or peak. The circuit typically consists of a comparator, a diode, and a storage capacitor. The comparator compares the input signal to a reference voltage, and whenever the input signal exceeds the reference voltage, the comparator outputs a high voltage to the diode. The diode allows the high voltage to pass through to the storage capacitor, which charges to the peak value of the input signal. The storage capacitor holds this value until the input signal drops below the reference voltage, at which point the comparator outputs a low voltage and the diode blocks any further charging of the storage capacitor. The output of the peak detector is therefore a voltage that represents the peak value of the input signal. The response time, accuracy, and stability of the peak detector depend on the design of the circuit and the choice of components.

The output voltage of a peak detector can be described mathematically as follows:

V_out = V_peak(t) * e^(-t/τ)

where:

V_out = output voltage of the peak detector

V_peak(t) = peak value of the input signal at time t

τ = time constant of the peak detector, which is determined by the values of the storage capacitor and the load resistor

t = time elapsed since the peak was detected

The time constant τ can be calculated as follows:

τ = RC

where:

R = load resistor C = storage capacitor

The time constant determines the speed at which the output voltage decays after the peak has been detected. A smaller time constant means that the output voltage decays more quickly, while a larger time constant means that the output voltage decays more slowly. The choice of time constant will depend on the specific requirements of the application and the desired performance of the peak detector.

Designing Effective Peak Detector Circuits: Best Practices and Tips

A peak detector typically comprises a diode, a capacitor, and sometimes a resistor. The diode directs the flow of current, charging the capacitor to the peak voltage level of the input signal. Once the peak is reached, the diode prevents the capacitor from discharging, thus holding the peak voltage.

Key Design Considerations

  1. Choice of Diode: The diode is central to the peak detector. Low forward voltage drop and fast response are desirable traits. Schottky diodes are often preferred due to their low forward voltage and quick switching capabilities.
  2. Capacitor Selection: The capacitor’s value dictates how long the peak voltage can be held. Larger capacitors hold the charge longer but may slow the circuit’s response to rapid signal changes. The type of capacitor used (e.g., ceramic, tantalum, or electrolytic) also affects the circuit’s performance, especially in terms of leakage current and response time.
  3. Resistor Role: In circuits where a resistor is used, it provides a path for the capacitor to discharge, resetting the circuit. The resistor value impacts the discharge time and needs to be optimized based on the application’s requirements.
  4. Operational Amplifiers: For more precision, operational amplifiers (op-amps) can be incorporated to buffer the output and improve the detection accuracy. This is particularly useful in applications requiring detection of low amplitude signals.

Enhancing Performance

  • Minimizing Leakage Current: To ensure the capacitor holds the peak value longer, selecting components with minimal leakage current is crucial. This is particularly important in applications where the peak value must be held for an extended period.
  • Noise Reduction: Implementing filter circuits can help mitigate the effect of noise, ensuring the peak detector only responds to legitimate signal peaks.
  • Speed vs. Accuracy: There is often a trade-off between the response speed of the detector and its accuracy. Fast-responding circuits might be less accurate, and vice versa. This balance should be tailored to the specific requirements of the application.

Testing and Optimization

  • Simulation Tools: Before physical implementation, using simulation tools can save time and resources. Simulations can help in fine-tuning component values and understanding the circuit’s behavior under different conditions.
  • Iterative Testing: Once a prototype is built, iterative testing and adjustments are essential. Real-world testing often reveals issues not apparent in theoretical analysis or simulations.

Peak detector circuit

A peak detector circuit is an electronic component designed to capture and hold the maximum (peak) voltage of an input signal. Its basic operation involves charging a capacitor to the peak value of the input signal and using a diode to prevent the capacitor from discharging, thus retaining the peak value. The peak detector can function in various configurations depending on the application requirements.

Key Characteristics and Types:

  • Functionality on AC Waveforms: For signals with both positive and negative half cycles, such as asymmetrical audio signals, a precision rectifier is often employed before the peak detector to ensure accurate peak detection.
  • Simplicity to Complexity: Peak detectors range from basic designs using minimal components to more complex circuits for specific applications. The complexity often depends on how long the peak value needs to be retained.
  • Peak Value Retention: In certain applications, the peak value must be retained for an extended period with minimal droop, necessitating a separate discharge circuit, such as an electronic switch or a manual push-button.

Design and Operation:

  • Basic Circuit: The most fundamental peak detector consists of a diode and a capacitor. The diode, placed in a forward-biased condition, allows current to pass and charge the capacitor to the signal’s peak value. In the negative half cycle, the diode becomes reverse-biased, and the capacitor holds the peak value from the previous cycle.
  • Output Voltage: The output voltage (VOUT) of a basic peak detector is defined as VOUT = VIN – VD, where VIN is the input signal voltage, and VD is the voltage drop across the diode.

Advanced Configurations and Components:

  • Comparator Addition: For more advanced functions, a comparator can be added to set a threshold for valid peak detection, enhancing the circuit’s precision.
  • Operational Amplifiers (Op-amps): In more sophisticated designs, op-amps are used to improve the circuit’s efficiency by eliminating the diode’s voltage drop.
  • Component Quality: High-quality, low-leakage components are essential for the circuit’s performance, especially in applications requiring long-term peak value retention.

Diode detector

Diode detectors are the most simple, yet extremely efficient kind of detector. Every crystal radio utilizes this kind of detector and the crystal that is used is simply a diode as well as an electronic diode. Because these kinds of receivers typically had just the detector, with no additional circuitry , they were usually known as “Detectors” (not Detephones, which was the name used to describe the type of receiver produced from PZT). Although it had its advantages for the first ten years or so of tube receivers, this kind of detection was rarely utilized. What was the reason? It’s because of economics. The diode detector didn’t offer any amplifying capabilities in the first place, and at a time where each tube was an expensive accessory to the receiver, such an expensive devices like a low-sensitivity detector was not feasible to afford.

Whatever how complex the device (number of circuits, tubes and so on. ) The diode detector is able to be integrated into the circuit exactly the same way and in reality, based on the place where the diode will be connected, it can be done in two ways. Based on the way in which the diode detector is employed it is referred to as an analog or a series detector. As you can see in the diagrams that are later posted in the text the name of the detector is derived from the manner in which the detector is connected with the circuit. If it’s connected in parallel to the output and input of the detector, then we speak of a serial detector. However, when it is connected in parallel, we are talking about an asynchronous detector. A series detector could be discovered mostly in crystal receivers in which it was the basis for nearly 100 percent of all designs. It is also present in modern circuits made with semiconductor diodes. In tube receivers employing vacuum diodes for detection the majority of parallel circuits were employed. The choice of circuits was influenced by the design specifications, and for a parallel detector, it was simple to get an ARW voltage. In addition this detector permitted the cathode for the diode to be linked to the lamp to the cathodes of other systems within the same lamp as for the ABC1 lamp. This significantly streamlined the process of the production of lamps.

Series detector

It is well-known that any diode regardless of the kind (tube or silicon crystal) can only pass current one way. In a circuit for detecting series as the circuit’s schematic is illustrated in the opposite figure that, the diode D will only pass positive half that of the present. The current passes via into the receiver (indicated by the symbol of the resistor) R1. It’s still very high-frequency, but because of the truncation in its negative component this current has a non-zero average value. The value of the average will be proportional to width of the positive and negative halves of input signals. It corresponds to the low frequency signal that is modulating the radio signal. When the receiver is an earphone even though a high-frequency signal is also flowing across it, it is feasible to listen for the broadcast within it because an average of current will be similar to the modulating acoustic sound.

peak detector waveforms
Voltage and current waveforms in a diode detector

Blue color – current of input with high frequencies.

The color purple is a result of output voltage is too low a time steady

Color red – voltage output the too high rate of time continuous

The black color is output at the voltage at the optimal time at a constant rate

Green color is the mean value of the voltage output

The voltage and current waves of the diode detector are illustrated in the opposite figure. The blue line represents that the input frequency is high. The diode, as per its principle of operation, carries the current in one direction. When it is being turned on, as shown in the diagram above the upper or positive half of the output signal. Because the signal generated by the diode at the resistor R1 cannot be symmetrical regard towards zero (it will always be positive, or at least the same as zero) it is an un-zero average. As you can see from the image that the magnitude of this typical number (green lines in the image) is not significant in comparison to input signals that is one of the weaknesses of this detector that is the most simplified and the other is there is a huge high-frequency component that is at the output. However, despite its shortcomings due to its utmost efficiency, this circuit was widely used in the early days of radio technology as crystal detectors due to its other advantages . The detector’s crystal is extremely cheap and the circuit doesn’t require any additional power source to operate thus its operation will not incur any additional expenses.

As we have mentioned the diode operates solely in one direction, and it is produced by a voltage that’s always positive. That means that at the output there is, in addition to that alternating frequency, there’s an DC voltage, which is higher than the signal is present at the detector’s input. The voltage isn’t very useful as the sound wave is an alternating electric current, however, it does have one primary application in radios – ARW, also known as Automatic Gain Control. If the signal is high (e.g. when we’re receiving a powerful station) it may cause excessive power to the receiver, which can result in an unpleasant sound. In the event that the increase is minimal enough to ensure that the receiver will not be impacted by the overdrive which means that, when it is the reception of weak stations cannot be achieved – the receiver will suffer from a deficiency of gain. In addition to these extreme situations, ARW causes different stations with differing levels of receive HF signals and play at the same volume. Moreover, when the level of HF signal fluctuates (which is quite common, particularly for medium and short-waves) it will maintain a constant broadcast volume irrespective of variations. This is why the constant signal with an intensity proportional to strength of the signal is extremely useful because it will instantly alter the gain of the receiver to correspond to the intensity of the signal.

peak detector diode

A minor change can allow you to improve slightly the characteristics that the device. It involves including to the circuit an capacitor with adequate capacity. The diode current, in turn, positively charge the capacitor C2 with a voltage equivalent to the maximum volume of input signals. If there was no load R1 within this circuit (or the resistance of the load would be quite high) and the capacitor will be charged to the voltage at which it is and remain at this level for a long time, and at output, we’d see DC voltages equivalent to the input voltage at its maximum which is appropriate for an ARW detector however, not for a detector of audio signals. This is why the resistor R1 adds to the circuit to ensure that because it is the only way C2 the capacitor can discharge. The waveforms of the circuit that have capacitor C2 are represented by red, black as well as purple lines.

The amount of resistance in this resistor or, more specifically the sum of the capacitance of the capacitor as well as that of its resistor, is vital – it can’t be too big or small as the capacitor will discharge quicklyor discharge in a slow manner. The RC circuit is a type of low-pass filter that must block the high-frequency resonance, but let the low-frequency waveform go. This is further complicated due to the fact that it’s a nonlinear circuit where there is a different current used for charging the capacitor, and another one is used that is used to drain it. The waveform that appears for various time constants in the R1C2 circuit can be seen in the image opposite. It is evident that if the time constant is too small, it’s signal (marked in the red line) disappears too quickly, and the waveform at output, rather than being an attractive and smooth low-frequency sine wave, is exactly as the circuit with no capacitor that is high-frequency single pulses, but slightly larger. When the frequency is too constant the voltage drop will be extremely small. If the next highest frequency of the input waveform is not high enough, it won’t be visible – the output waveform will be blurred – this is evident in the red lines.

The ideal waveform is represented through the line of black. When you first look at the graph, it doesn’t look great as it is evident that the ripples in the higher-frequency signal remain extremely large, but it’s still far superior to that blue-colored signal. However, in reality the frequency difference of the smaller (modulating audio signals) and the large (modulating transport signal) is significantly greater (it is reduced in the graph in order to make it more legible) and can range anywhere from a dozen to thousands of times, or on average, about 100 it is quite easy to satisfy this requirement in real life. The typical time-invariant is around 100ms. Also, the differences in the frequency of successive added portions of the waveform of the HF. (blue figure) image) is so small it is that “jaggedness” of the output waveform is virtually undetectable and can be easily removed by our ears and the other receiver stages. As you can see, the magnitude in the m.cz. signals (black stripe) in the circuit that has capacitors is higher than the value for the diode on its own which is why we saw an additional increase in sensitivities to the detection.

In the circuit the diode’s direction is able to be reversed. In this case, the circuit will operate the same with the only difference being that it is that the negative half of the high frequency current pass while the positive half are blocked. All of the characteristics in charging capacitors and charging capacitors, with time constants are exactly the same. The only difference is the changing of the polarity the voltages generated at the output changing from negative to positive and the drawing of the waves is identical but it will be drawn under the X-axis and not over it, as illustrated in the image opposite. In the explanation the scenario of passing the positive and negative halves the signal was discussed because that is the way serial detectors are typically constructed in real life.

Active peak detector

An active peak detector is a type of peak detector circuit that uses an active component, such as an operational amplifier (op-amp), to achieve its function. Unlike passive peak detectors, which rely on passive components such as resistors and capacitors to store and discharge energy, active peak detectors use the amplification capability of an op-amp to detect and hold the peak value of a signal. The active peak detector operates by continuously comparing the input signal to a reference voltage and storing the maximum value of the signal.

Active peak detectors have several advantages over passive peak detectors, including increased accuracy, faster response time, and better signal-to-noise ratio. They can be used in a wide range of applications, such as audio processing, power supply control, and instrumentation, to detect the peak value of a signal and hold it for a specified time period.

The design of an active peak detector circuit typically involves an op-amp configured in a comparator or a peak detector configuration, a diode to rectify the input signal, and a storage capacitor to hold the peak voltage. The output of the op-amp is connected to the storage capacitor through the diode, allowing the capacitor to charge to the peak voltage when the input signal is greater than the reference voltage. When the input signal drops below the reference voltage, the capacitor discharges through a discharge resistor, maintaining the peak voltage until the next peak is detected.

Op amp peak detector

An operational amplifier (op amp) peak detector is a type of peak detector circuit that uses an operational amplifier as the comparator. An operational amplifier is an integrated circuit that is designed to perform mathematical operations, such as amplification and comparison, on input signals. In a peak detector circuit, the operational amplifier is used to compare the input signal to a reference voltage and determine whether the input signal has exceeded the reference voltage.

op amp peak detector

When the input signal exceeds the reference voltage, the operational amplifier outputs a high voltage, which is then passed through a diode to a storage capacitor. The storage capacitor charges to the peak value of the input signal, and the voltage across the storage capacitor represents the peak value. The storage capacitor is typically connected to a load resistor, which is used to discharge the storage capacitor when the input signal drops below the reference voltage.

The performance of an op amp peak detector can be optimized by selecting the appropriate values for the reference voltage, the load resistor, and the storage capacitor. The reference voltage determines the threshold at which the peak detector starts to detect the peak value, while the load resistor and the storage capacitor determine the speed and stability of the peak detector. A smaller load resistor and a larger storage capacitor will result in a slower, more stable peak detector, while a larger load resistor and a smaller storage capacitor will result in a faster, less stable peak detector.

Op amp peak detectors are widely used in a variety of applications, including audio processing, power supply monitoring, and radio communication systems. They are especially useful in applications where a fast and accurate measurement of the peak value of an input signal is required.

In conclusion, an op amp peak detector is a useful and versatile type of peak detector circuit that can be optimized for different applications by selecting the appropriate values for the reference voltage, the load resistor, and the storage capacitor. It is an essential component in many electronic systems, and its popularity is due to its accuracy, speed, and ease of use.

Digital peak detector

A digital peak detector is a type of peak detector circuit that uses digital signals and digital processing elements, such as microcontrollers or field-programmable gate arrays (FPGAs), to detect the peak value of an input signal. Unlike analog peak detectors, which use analog components such as operational amplifiers and capacitors to detect the peak value, digital peak detectors use digital signals and digital processing to perform the same function.

In a digital peak detector, the input signal is typically converted from an analog signal to a digital signal using an analog-to-digital converter (ADC). The digital signal is then processed by a microcontroller or FPGA to determine the peak value. The peak value is stored in a digital memory, such as a register or a memory array, and can be retrieved and processed as needed.

Digital peak detectors offer several advantages over analog peak detectors, including improved accuracy and greater flexibility. For example, digital peak detectors can be easily programmed and reconfigured to suit different applications and to perform different functions. They can also be used in conjunction with other digital processing elements, such as digital signal processors (DSPs) or microcontrollers, to perform more complex signal processing tasks.

Another advantage of digital peak detectors is their ability to perform real-time peak detection. Since digital processing elements can process digital signals much faster than analog circuits can process analog signals, digital peak detectors can perform real-time peak detection with very high accuracy.

Here is a sample code for a digital peak detector in the C programming language:

#define ADC_SAMPLES 1024

int adc_values[ADC_SAMPLES]; // array to store ADC values
int peak_value = 0; // variable to store peak value

void setup() {
  // initialize ADC and start conversion
  analogReadResolution(12);
  analogReadAveraging(32);
  analogRead(A0);
}

void loop() {
  // read ADC values and store them in the array
  for (int i = 0; i < ADC_SAMPLES; i++) {
    adc_values[i] = analogRead(A0);
  }

  // find the peak value in the ADC values array
  for (int i = 0; i < ADC_SAMPLES; i++) {
    if (adc_values[i] > peak_value) {
      peak_value = adc_values[i];
    }
  }

  // do something with the peak value
  // ...

  // reset peak value for next iteration
  peak_value = 0;
}

This code uses the ADC of an Arduino board to read the input signal and stores the ADC values in an array. The peak value is then found by iterating over the ADC values array and updating the peak_value variable whenever a new peak value is found. Finally, the peak value can be used for any desired purpose, such as displaying it on an LCD screen or transmitting it over a communication interface.

Analog peak detector

An analog peak detector is an electronic circuit used to detect and hold the peak value of an incoming analog signal. The circuit works by continuously monitoring the input signal and comparing it with a stored value (the current peak value). If the input signal exceeds the stored value, the circuit updates the stored value to the new peak value. This way, the circuit can continuously track and hold the highest amplitude of the input signal. Analog peak detectors are used in various applications such as radio communication systems, audio processing, and power supplies to detect and hold the maximum value of the input signal for further processing or analysis.

Advancements in Peak Detector Components: A Review of Modern Technologies

“Fast and Sample Accurate R-Peak Detection for Noisy ECG Using Visibility Graphs”

The recent research titled “Fast and Sample Accurate R-Peak Detection for Noisy ECG Using Visibility Graphs” (July 2022) presents a significant advancement in electrocardiogram (ECG) signal processing. This research, developed over a century after Willem Einthoven laid the foundation for modern electrocardiography, addresses the growing importance of accurate R-peak detection in ECG signals, especially in the context of wearable and low-budget devices.

The novel approach introduced in this study utilizes the concept of visibility graph transformation. This method transforms a discrete time series into a graph format, where each data sample is represented as a node, and edges are assigned between samples that are intervisible. The key advantage of this method lies in its ability to amplify R-peaks by weighting the original signal, thereby enhancing large, isolated values while suppressing other signal components and noise. This enhancement of R-peaks is crucial for their accurate detection in noisy ECG signals.

A simple thresholding procedure, akin to the well-known Pan and Tompkins algorithm, is employed to detect the R-peaks effectively. The weights for the signal are computed across overlapping segments of equal size, with the time complexity of the method being linear with respect to the number of segments. This linear complexity is vital for the method’s efficiency and scalability.

The research team benchmarked this new method against existing R-peak detection techniques using the same thresholding approach on a database characterized by noisy and sample-accurate ECG signals. The results from this benchmarking highlighted the superior performance of the proposed method, which significantly outperformed common detectors.

In essence, this research offers a promising and efficient solution for R-peak detection in ECG signals, particularly in scenarios where noise and signal accuracy are critical factors. Its application in wearable and budget-friendly medical devices could enhance the accuracy and reliability of heart rate monitoring, paving the way for more advanced and accessible cardiac health monitoring technologies.

“Robust R-peak detection in an electrocardiogram with stationary wavelet transformation and separable convolution” (November 2022)

The research titled “Robust R-peak detection in an electrocardiogram with stationary wavelet transformation and separable convolution” (November 2022) represents a significant advancement in electrocardiogram (ECG) analysis. This study developed a novel deep learning model for R-peak detection, employing stationary wavelet transform (SWT) and separable convolution. The research aimed to overcome limitations in existing deep learning models, particularly in terms of performance across different databases.

Key Aspects of the Research:

  1. Cross-Database Validation: The study utilized multiple ECG databases, including MIT-BIH Arrhythmia, Institute of Cardiological Technics (INCART), and QT, for training and testing. Additional databases such as MIT-BIH ST Change, European ST-T, TELE, and MIT-BIH Noise Stress Test were also employed for testing​.
  2. Deep Learning Model and Techniques: The research explored deep learning methods, including convolutional neural networks (CNN) and long-short term memory of recurrent neural networks (RNN), for peak detection. The model incorporated layers that played roles in peak enhancement and adaptive thresholding during detection​.
  3. Stationary Wavelet Transform (SWT): SWT was adopted as the peak enhancement method, maintaining the original length of waveforms after transformation and showing stable performance across various databases with different adaptive thresholding methods​.
  4. Separable Convolution and Atrous Spatial Pyramid Pooling (ASPP): The model used separable convolution followed by ASPP, effectively extracting important features with fewer parameters than classic convolution. This approach provided an efficient encoder-decoder structure yielding high performance in cross-database validation​.
  5. Model Training and Testing: The study included noise augmentation in the model training and tested the model’s performance with various databases, demonstrating its robustness in different conditions​.
  6. Implications and Limitations: Despite impressive results, the research acknowledged limitations, including decreased performance in extremely noisy ECGs and a tradeoff when improving performance in noisy conditions. Further study is needed to establish a single model performing well in both clean and noisy ECGs​.
  7. Contribution to ECG Analysis: The research developed a pipeline that enhanced R-peak detection, showing superior performance in open-source ECG databases and successful cross-database validation. The findings could be beneficial in subsequent studies, particularly with a small number of patients​​.
Michal Pukala
Electronics and Telecommunications engineer with Electro-energetics Master degree graduation. Lightning designer experienced engineer. Currently working in IT industry.

News