Enveloping a Signal

Thread Starter

Dritech

Joined Sep 21, 2011
907
Hi all,

I am using a Peak Detector circuit (circuit shown below, with a 2.2uF cap and a 500k resistor) to envelope a signal.
The output waveform which I am getting on simulation can be seen below (black plot).
Could anyone please suggest any changes which may be implemented to this circuit for me to optain a more enveloped output (i.e. less ripple and sharper falling edge)
Something similar to what I intend to get is also shown below.
Any suggestions would be highly appreciated.



upload_2018-4-17_19-52-55.png

upload_2018-4-17_19-59-38.png
 

Attachments

crutschow

Joined Mar 14, 2008
38,507
The modulation for that carrier seems to be rather a high frequency as compared to the carrier, making it difficult to demodulate without some ripples.
If the carrier and modulation are too close together, you may have to add a higher order filter to smooth the ripples.

What is the frequency of the modulation and the frequency of the carrier?
 

Thread Starter

Dritech

Joined Sep 21, 2011
907
Thanks for the replies.

@crutschow Please note that this is an EMG signal (muscle contraction signal), with a frequency of around 20-100Hz

@bertus , I tried experimenting with different values, but found no combination to decrease the ripple while keeping a sharp falling-edge
 

crutschow

Joined Mar 14, 2008
38,507
So what is the nominal width of the pulse envelope?
When you post signals without a time reference it makes it difficult to make good suggestions to solve your problem. :rolleyes:
 

kubeek

Joined Sep 20, 2005
5,796
@Dritech I think you should first notice how many peaks are above the envelope in the first picture, and how many are in the second picture. Notice the consistency in the second one? That is the main reason why the second envelope can be much closer to what you´d expect.
 

Thread Starter

Dritech

Joined Sep 21, 2011
907
I am attaching a screenshot of the scope.
The width of the pulse used for simulation is around 800ms, but this will eventually vary with the contraction time of the muscle.

upload_2018-4-17_21-41-56.png
 

Thread Starter

Dritech

Joined Sep 21, 2011
907
@crutschow , the less the better, but some small ripples won't harm :) At the same time, I want the "falling-edge" to be sharper

I would like to get something similar to what is shown below (green line), as @kubeek said, a more constant envelope output.

upload_2018-4-17_21-53-14.png
 

kubeek

Joined Sep 20, 2005
5,796
looks like slower attack and faster decay to me, in other words a resistor in series with the diode to slow down charging of the cap, and a lower value than you have now parallel to the capacitor for faster discharge (see the tail after the last pulse). Note that you might need some amplification as well to get the same amplitude as your green curve.
 

nsaspook

Joined Aug 27, 2009
16,323
https://www.dsprelated.com/showarticle/938.php

DETECTOR PERFORMANCE: THE GOOD, THE BAD, AND THE UGLY


For applications where high accuracy is not needed, such as automatic gain control (AGC) or amplitude-shift keying (ASK) demodulation, the Figure 1 detector is attractive because it's so easy to implement. Equally easy to implement, the Figure 2 detector has been used to process medical electromyogram (EMG) signals [8].
 

Thread Starter

Dritech

Joined Sep 21, 2011
907
@nsaspook , thanks for the reference. I will try to find a way to rectify the signal. That would definitely reduce the ripple.

@crutschow , originally it is a bipolar signal, but since the signal is being passed through a signal supply BPF, the negative part is being chopped out. I will try to find a way to rectify the signal prior passing it to the BPF.
 
Last edited:

WBahn

Joined Mar 31, 2012
32,840
Hi all,

I am using a Peak Detector circuit (circuit shown below, with a 2.2uF cap and a 500k resistor) to envelope a signal.
The output waveform which I am getting on simulation can be seen below (black plot).
Could anyone please suggest any changes which may be implemented to this circuit for me to optain a more enveloped output (i.e. less ripple and sharper falling edge)
I think you are asking for contradictory things. Lower ripple means that you want the filter to respond more slowly to changes -- i.e., you want it to fall LESS in the time after a peak before the next peak. But sharper falling edge means you want it to fall more quickly after a peak. Can't have it both ways.
 

crutschow

Joined Mar 14, 2008
38,507
originally it is a bipolar signal, but since the signal is being passed through a signal supply BPF, the negative part is being chopped out. I will try to find a way to rectify the signal prior passing it to the BPF.
I was asking because if you have the bipolar signal, then you can use a full-wave rectifier to detect the signal (as in the Figure 2 detector) which will double the frequency, and halve the ripple for a given detector output filter response.
For that you should use a BPF with a dual supply before the detector so it's not clipped.
 

danadak

Joined Mar 10, 2018
4,057
My first instincts would be to do this in a processor with A/D and
simply oversample the waveform and collect peak values. This
could eliminate the CM error as well choosing right part, like PSOC.
You would wind up with a more accurate representation because you
would not rely on passive component T and V drift.

In the PSOC 5LP family you can get 85 db CMRR out of the 20 bit DelSig
in differential mode.

https://www.researchgate.net/public...TH_APPLICATION_IN_MUSCULAR_FATIGUE_ASSESSMENT

This paper is older PSOC family, newer family does the filter with DFB (Digital Filter Block),
vs switch capacitor filter implementation in older family.

file:///C:/Users/MainDev/Downloads/7864-37124-1-PB.pdf

Example (this is single ended input application, diff is just a config setting) -



Board to start with ($10) -

http://www.cypress.com/documentatio...oc-5lp-prototyping-kit-onboard-programmer-and

Compiler and IDE free -

http://www.cypress.com/products/psoc-creator-integrated-design-environment-ide


Regards, Dana.
 

Thread Starter

Dritech

Joined Sep 21, 2011
907
Hi all,

Below is the circuit which I am using to achieve the enveloping of the original signal.
Stage 1 (U1;D and U2:A) are forming the Absolute Value circuit. This circuit is required to rectify the original signal over Vcc/2.
Stage 2 is the differential amplifier. This was required since the original signal has an offset of Vcc/2, so the differential amplifier was used to remove the offset.
Stage 3 is the Peak Detector circuit, followed by a non-inverting amplifier.

Could you please advise of any improvements which may be done to this circuit (both the selection of components and the values of the resistors / capacitors).
Also, why is the simulation working fine when the potentiometer (RV1) is either fully open or fully closed, but giving the error shown below when the pot is at some position in the middle?

upload_2018-5-10_21-52-36.png

upload_2018-5-10_21-41-38.png
 

Attachments

Top