Low pass design process.

Welcome all. I am having trouble with designing low pass filter for my precision rectifier. So, in picture “1” I have my rectified waveform and envelope I am interested in. Frequency of rectified sine is about 40KHz. Currently my circuit has two low pass filters cascaded picture “2”. Result of smoothing of LPF is in picture “3” after first RC branch and picture “4” after second. I am happy with that result, but trouble is I guessed them and wondering how I could improve or choose them properly. I have been advised that I could use FFT to see spectrum of rectified signal and use it to determine where to put cut-off frequency. Result of FFT is in picture “5”. My trouble is that I potentially measured FFT incorrectly as in my LTSpice I get different result picture “6” and “7”. So my question is what are the rules to find reasonable cut off point in that case?

1.jpg

3.jpg

4.jpg

5.jpg

Hello Wintermuteldn,
The cut-off frequency is your operating frequency.
The capacitor should have reactance (Xc) equal to
the resistor value at that frequency. This forms
a low-pass filter with a 3 dB loss. The output
voltage will be 0.707 times the input voltage.
Herb

@herbschwarz. Yes, I agree. This is good method to consider when calculating response for sine wave (single harmonic). However, in my case I have complex wave form due to rectification and exponential rise and decay. FFT of this waveform contains many harmonics. Therefore, I need to make decision to where is my cut off point. Therefore, my approach is to try to find spectrum in which most of signals energy is contained to cut rest of spectrum in frequency domain. Therefore, I suspect convolve filter’s and signals response in time domain.

This is good method to consider when calculating response for sine wave (single harmonic). However, in my case I have complex wave form due to rectification and exponential rise and decay

It makes no odds as to what the waveform is, the filter is still designed in the same way. The RC will only give you a first order filter. If you want it to roll of quicker you need a higher order filter.

Ether way the waveform you want to filter consists of sin waves of different frequencies.

Hi.
This RC low pass filter is an integrator. It
has an attenuation of 6 dB per octave.
Higher frequencies are attenuated more
than low frequencies. Thus, it will tend
to remove any harmonics. (If you find that
you have a sub-harmonic, then a high pass
filter can be used to remove that since
it lies below the Fc of the low pass filter.)

wondering how I could improve or choose them properly

Please specify your criteria for proper operation.

Thank you all. 1st has to be passive no spare op-amps in circuit. Preferably 2nd order. Ripple of about 5mV. Last and very important constrain is time constant of a filter. Since my goal is to have steep slope as this reduces my error.

That is not much help. Here is some background reading on passive filters: https://www.electronics-tutorials.ws/filter/filter_2.html

One of several line filter calculators: RC Low-pass Filter Design Tool

Thank you for materials. Perhaps I didn’t word my enquiry right. I have done some filter design both analogue active passive and digital bot FIR and IIR. My worry here is backing my design process. As I achieved my goal of filtering very well by observing oscilloscope and matching R and C. However, I am not able to draw the line mathematically for my low pass filter at which point would my output be distorted. Hence my question about FFT spectrum (picture below) of my input as this was hinted to me. However I so far faild to find bond between two.

5.jpg

at which point would my output be distorted.

A precision rectifier is a profound distortion of an AC signal. What do you mean by "distortion"?

So, in picture "1" I have my rectified waveform and envelope I am interested in

You forgot to post picture "1".

I don't think any of us understand what you are actually trying to do.

1st has to be passive no spare op-amps in circuit. Preferably 2nd order.

So that will be an LC filter then.

Ripple of about 5mV

You don't get ripple from a 2nd order passive filter.

Last and very important constrain is time constant of a filter. Since my goal is to have steep slope as this reduces my error.

I don't think this has any bearing on the slope.

at which point would my output be distorted

If the input waveform has any harmonics in the roll of region then the output will be distorted, that is the job of a filter.

Sorry about confusion. So perhaps ill start from beginning I created circuit which I want to operate in similar fashion to envelope detector in AM radio. Picture 1 is my circuit. Picture 2 shows input and output of my precision rectifier. Now in order to process it further I need to have nice “envelope” of carrier signal. Here my trouble begins as I simulated such a circuit as RC ladder in picture 1 and it resulted in ok waveform on the output picture 3. However, it was pure guess and speculation rather than deduction. So, my question is what technique to analyse it should I use to get from picture 2 bottom waveform to picture 3 waveforms?
Reason for my question about ripple ect as it reminded me of calculation of ripple in rectifiers in respect to frequency and load.

1.jpg

2.jpg

3.jpg

Your low pass filter needs to have a cutoff near the modulation frequency, not the carrier frequency.

An AM demodulator also removes the DC component (a very low frequency cutoff, high pass filter).

Thank you for your reply. Now it makes sense as clearly my cut off frequency (6.7kHz) is much lower than carrier frequency (40kHz). Now for DC part I would think of simple solution of high value capacitor in series with low-pass filter would that approach be suitable? Kipping in mind that someone already pointed that it is not best practice to connect op amp’s output directly to capacitor. I would think of low-pass and capacitor arrangement Lastly how can I measure frequency of modulating signal?

Lastly how can I measure frequency of modulating signal?

How are you producing the signal?

The envelope shown in "3" does not have a well defined frequency.

Signal at the input of envelope detector is ultrasonic transducer picture below shows (blue waveform) amplified version of it as without it has usually amplitude is about 20mV. So envelope has exponential increase and decay I guess.

A0004DS.jpg

The precision rectifier circuit doesn't have a constant impedance, it should ideally be buffered before driving
the filter section, otherwise the diode switching will be changing the input impedance seen by the filter
every half-cycle, and the response won't exactly match theory for a LPF'd rectified signal.

Put another way the node where R1, R4 and D1 meet will not be a clean rectified signal as the filter
capacitors are back-feeding it whenever D1 is off.

Taking the rise time of the pulse to be about 1/4 of a sine wave, the pulse can be roughly approximated by 1/2 cycle of a 1.3 kHz sine wave.

Try choosing the low pass filter rolloff to be about 1 kHz.

Thank you for reply.
@jremington could I confirm how step by step you estimated to “…1/2 cycle of a 1.3 kHz sine wave…” only asking as period between peaks is about 40us.

The envelope rise time is (6 or 7) 40 us intervals, interpreted as the first 1/4 cycle of a sine wave.