digital adjustment of the gain of the cut-off points of the analog filter - Page 1
Forum section: electronics / projects

author: electronx
author_rank: Regular Contributor
timestamp: December 11, 2023, 08:56:45 pm
content: As seen in the graph, I have a bandpass filter.The problem is that the signal gain decreases at the cutoff points, but I want my gain to create sharp corners, including the cutoff frequencies, and I want the gain to remain at 1.I can achieve this by increasing the orders of the filters, but there are phase distortions and increasing the stages means more opamps and more cost. For this, I plan to use an ADC at the end of the filter. Then, I hope to multiply the frequencies where attenuation occurs by certain gain coefficients and make the gain equal to 1. Is there a special name given to this type of equalization in signal processing, or what are other more logical solutions?

author: MarkT
author_rank: Frequent Contributor
timestamp: December 11, 2023, 09:45:42 pm
content: I'm tempted to say "Undesirable?" or "Unnecessary?"I guess the point is why do you think you want this?Perhaps you really are looking for a Chebyshev type II filter which has much sharper roll off but still a flat passband. 4-pole Butterworth filters are never going to give you sharp edges.Perhaps if you explain the application?You could do some heavy digital filtering to effect what you desire, but why use an analog bandpass filter at all?

author: electronx
author_rank: Regular Contributor
timestamp: December 12, 2023, 06:15:50 pm
content: It will be used in the iepe sensor and the amplitude information tells us the g force and we do not want it to be attenuate .It would be great to get a gain of 1 at 0.7 Hz. Or am I wrong?

author: Benta
author_rank: Super Contributor
timestamp: December 12, 2023, 08:33:52 pm
content: Total overthinking and unrealistic expectations.

author: SiliconWizard
author_rank: Super Contributor
timestamp: December 12, 2023, 09:44:59 pm
content: If you're gonna use an ADC at the end of your filter, why not do the filtering digitally? Adjusting the parameters of the filter will be straightforward.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: December 12, 2023, 11:32:00 pm
content: Why not calibrate the gain(freq) spectrum? If this is going to be a precision sort of device, you most likely have to, anyway.A fluctuation of some mdB in the passband will either mean nothing, or be calibrated out. Perhaps a "gross error" of 1 or 2 dB would be unacceptable bounds even with calibration, perhaps uniform flat group delay is a comparable priority, I don't know.Fundamentally, you're asking the impossible: the sharper and steeper the transfer function, the higher order the filter must be, the more phase deviates from linear, and the more total group delay spent in the filter.Put still another way: suppose you wanted an ideal brick-wall filter, a sharp discontinuity in frequency response, all or nothing at some cutoff frequency. The impulse response of such a filter is the sinc(t) function, which has a nonzero value for almost all t < 0, i.e., the output begins ringing before the input even begins -- it must predict the future, which is impossible. It's non-causal. You can only have an approximately so-sharp cutoff, when sufficient delay is included, basically to create that pre-ringing starting suddenly from t >= 0, then eventually the impulse peak, and final post-ringing, that corresponds to a time-shifted and truncated sinc(t) impulse response.The same reasoning extends to any piecewise (hard corners) function of frequency, which must have significant delay to approximate the corners to some arbitrary "sharpness".On the upside, any reasonable, well-informed user of your product, will know and understand this, and you can simply provide the zeroes and poles of your transfer function, and all will be understood. Or, again, it can (or depending on what kind of product this really is -- should) be calibrated, perhaps with a best-fit curve and error (deviation between fitted and real) plotted, and the parameters of that fit shown (i.e. the dominant zeroes and poles of the function).Related example: every time you see an op-amp rated for like, "noise 0.1-10Hz", it's measured with a first-order filter, IIRC, and some amount of noise strictly outside that bound, is simply an expected part of that measurement. Likewise for frequencies strictly within bounds, the depressions at the ends are simply a part of it. This is more-or-less supported by plotting noise(freq) elsewhere, hopefully including the relevant span, so it's obvious there isn't a noise peak within, or just outside, this span. Most real amps are 1/f tail in this range (or flat, for autozero/chopper types), and the noise spectrum is well-defined, without nasty bumps in it, and so the arbitrary frequency range, and the soft cutoffs, aren't important, it's all just modest ratios depending on the slope of the spectrum and it works fine as an apples-to-apples comparison.Tim

author: Tation
author_rank: Regular Contributor
timestamp: December 13, 2023, 09:07:40 am
content: I think that the problem is not well defined. I mean, analog filter design starts knowing the maximum deviations from the ideal transfer function that your application can withstand. Such deviations are, many times, expressed as:maximum attenuation in the passbandminimum attenuation in the stopbandwidth of the transition bandsothers: as if ripple is acceptable or not in the pass/stop bands, phase distortion, maximum group delay, etc.From the very nature of the filtering operation, one cannot expect to locate a feasible filter for any set of specs. For example, stating that the maximum acceptable attenuation in the passband is 0 dB (as is your specification of gain exactly 1.0 down to 0.7 Hz) is not realizable. No matter if analog or digital, such a filter is not realizable, period. You can indeed approximate such filter if you accept some deviation from the desired gain, say 3 dB, 1 dB, 0.1 dB or even 1 μdB. The more stringent your requirements, the higher the required order of the filter and, usually, the worse the phase distortion of an analog filter and the higher deviations in the transfer function due to component tolerances.So, what are your on-Earth filter specs? This is:what is the range of frequencies that must pass thru the filter? (from 0.7 Hz up to?)what is the maximum deviation from gain = 1 that you can accept for such frequencies (0 dB is not realizable)what are the ranges of frequencies that must be blocked by the filter (for the filter to be feasible, there must be some transition bands —with > 0 Hz width— between the passband and the stopbands)what is the minimum acceptable attenuation for such blocked frequencies? (∞ dB is not realizable) Do both stop bands have the same?can you accept ripple in the pass band? In the stop bands?Do you need linear phase? A maximum group delay?A maximum achievable order? (say, you want to use 2nd order Sallen-Key cells and only want to use 2 opamps, then, with some effort, you can reach order 5 for low/high pass, 2 for band pass. Or, for a passive filter, you want to keep the number of, bulky, coils below some value)When the above is known (at least items 1-4), then you can search between the different available approximations (Butterworth, Chebyshev, etc.) what of them can fulfil the requirements with the less effort.Apart from increasing the filter order, if you need a sharper cutoff, there are approximations better than Butterworth:Chebyshev I (with ripple in the passband)Chebyshev II (with ripple in the stop band)Cauer (aka elliptic) (with ripple in both pass and stop bands)Legendre (aka Papoulis, aka optimum L) (without ripple)Many times, a pass band filter is better constructed as a cascade of a high and a low pass. Is suppose that your filter is designed in such way.

author: Tation
author_rank: Regular Contributor
timestamp: December 13, 2023, 10:15:13 am
content: I forgot:Even if you, after the analog filter, include an ADC and then a digital filter to equalize the passband extremes, you cannot achieve with 100 % fidelity the gain = 1.0 from 0.7 Hz up to x Hz goal. But you can "distribute" the filtering effort between a "coarse" analog low pass + high pass and a digital equalizing filter. A high enough order digital filter will eventually achieve some reasonable requirement about maximum deviation from G = 1 in the pass band, provided you achieve good alignment between the analog and digital parts.But I also believe that maybe you are overthinking all this.