Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

NEW REGISTRATIONS - please contact us if you wish to register on the forum

Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright

Magic IIR Biquad - testing

DSP related issues, mathematics, processing and techniques

Re: Magic IIR Biquad - testing

Postby steph_tsf » Sat Feb 22, 2020 11:58 am

Thanks 1.000.000 times, Martin. Possibly there is a catch, as nearly all textbooks ignore such implementation. Is it feasible, to embed the "matched" feature into the x86 SSE coefficients determination, exploiting Q (the resonance factor if you prefer) and Fr? And still ensure that the summation of the LP,BP and HP deliver unity? Have a nice day.
steph_tsf
 
Posts: 249
Joined: Sun Aug 15, 2010 10:26 pm

Re: Magic IIR Biquad - testing

Postby martinvicanek » Sat Feb 22, 2020 3:02 pm

steph_tsf wrote:Possibly there is a catch, as nearly all textbooks ignore such implementation.
It is good to be sceptical about an individual claiming that all textbooks are wrong - I was too! Let me illustrate the issue of delayless loops. Consider the equation

x = 2*x - 5

The textbooks argue that you can't compute x from this equation because the right hand side contains yet unknown x. At first glance, this seems to be true. But of course you can solve for x to obtain

x = 5

Textbooks copy from other textbooks, and as a result such (mis)conceptions persist without ever being questioned. It happens (although fortunately not very often) in science and in engineering.

Is it feasible, to embed the "matched" feature into the x86 SSE coefficients determination, exploiting Q (the resonance factor if you prefer) and Fr? And still ensure that the summation of the LP,BP and HP deliver unity? Have a nice day.
What do you mean by "matched feature"?
User avatar
martinvicanek
 
Posts: 1328
Joined: Sat Jun 22, 2013 8:28 pm

Re: Magic IIR Biquad - testing

Postby trogluddite » Sat Feb 22, 2020 4:23 pm

martinvicenek wrote:as a result such (mis)conceptions persist without ever being questioned

And, especially at the school level of education, one might get a ruler across the knuckles if one questions what teacher says! I recall the chapter in Nobel-laureate Richard Feynman's book Surely you must be joking, Mr. Feynman (which I heartily recommend) in which he describes his experience volunteering as a science textbook reviewer for an education board. He discovered very quickly that he was the only member of the board who bothered to read the textbooks before casting his votes, never mind confirming their factual accuracy (and he was made to feel most unwelcome because of his "trouble-making")!
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
User avatar
trogluddite
 
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: Magic IIR Biquad - testing

Postby steph_tsf » Mon Feb 24, 2020 7:18 am

martinvicanek wrote:What do you mean by "matched feature"?
Sat Sep 12, 2015 12:07 am,
DSP Robotics Flowstone < Support Home ‹ User Forums ‹ DSP < Matched Lowpass Filter, by martinvicanek
http://www.dsprobotics.com/support/viewtopic.php?f=4&t=3710&hilit=matched+lowpass+filter
steph_tsf
 
Posts: 249
Joined: Sun Aug 15, 2010 10:26 pm

Re: Magic IIR Biquad - testing

Postby steph_tsf » Mon Feb 24, 2020 11:31 am

martinvicanek wrote:Furthermore the filter is realized using trapezoidal integration, which is superior to the usual Euler integration. Trapezoidal integration, however, results in delayless loop
Nice summary. Thanks. I need a few confirmations from you before digging into this. Clearly the topology consists in two cascaded "integrators", whose outputs get fed back to a central summation point. Such feedback remaining globally negative, it prevents the two integrators outputs from reaching infinite values. Everything is thus tight, under self-control. Stability can be guaranteed. Such is the Universal State Variable Filter, barely implemented in flesh as it requires three op-amps. The two "integrators" role, is to imprint into the schematic, the great "filtering" idea that the output gain and phase must vary with frequency. The way such variation gets orchestrated (high selectivity, low selectivity), only depends the way the feedback gets organized : how much 1st-order feedback, and how much 2nd-order feedback. The fact that there are two cascaded integrators inside, provides a big advantage. Represent that the output of the second integrator, is delivering the 2nd-order lowpass transfer function. Consequently, its input, actually the output of the first integrator, is delivering the corresponding 2nd-order bandpass transfer function. And, consequently, the input of the first integrator, must have been the corresponding 2nd-order highpass signal. Thus, a same schematic is constantly delivering the three fundamental signals : lowpass, highpass, and bandpass that are corresponding to a common Fc and common Q. Consequently, in case one is allocating extra money for hooking a circuitry acting as output buffer and mixer, one can mix the three outputs in various arbitrary proportions between [-1 and +1] for synthesizing all possible 2nd-order transfer functions : notch, shelving, Linkwitz bass boost, allpass (pure phase shifter), etc.

IMO, the first lesson about analog signal processing and filtering should consist in describing the Universal State Variable Filter, the way I just did.

The second lesson could consist into learning what's a Butterworth filter and Bessel filter, lowass, highpass, and bandpass.

The third lesson could consist in telling a) that one can derive a "short" universal filter that's embedding one integrator instead of two, that's delivering all possible 1st-order transfer functions, and telling also b) that there is no use in designing a 4th-order or 5th-order etc. Universal Variable Filter, as all Nth-order transfer functions, always can get decomposed into 2nd-order and 1st-order transfer functions, put one after the other. This way one can easily build in modular form, high-order transfer functions like Butterworth, Chebyshev, Bessel, Cauer, and high-order paired transfer functions like Hilbert pairs.

The fourth lesson could consist in telling that there exist many cost-optimized shortcuts allowing to implement 2nd-order and Nth-order transfer functions without relying on staged Universal Filters. One can tell about the Sallen-Key topology, Multiple-Feedback topology, etc.

The fifth lesson could consist in telling that beyond the Universal State Variable topology, Sallen-Key topology and Multiple-Feedback topology, there exist another class of active filters consisting in p-transposed passive filters, requiring p-transposed capacitors synthesized using op-amps. One can thus build high order p-transposed passive filters, only costing one opamp per p-transposed capacitor. Provided the p-transposed capacitor is ground-referred.

Nowadays, digital is everywhere. Nowadays, one can compute billions of delays, additions and multiplications per second. So comes the fundamental question : how to compute integrators, behaving like the analog integrators that one is requiring for implementing the Universal State Variable Filter?

It's easy, albeit remaining inaccurate because in digital, we are due to ignore the (analog) input values that are existing between the digitized samples. The integrator will thus transform into a plain simple digital accumulator. Upon booting, you initialize the accumulated value to zero. In other words, you compute [acc <- 0]. In operation, you treat each new incoming sample this way : first you compute [acc <- acc + in], then you deliver the newly computed [acc] value as output. Very simple indeed, albeit remaining inaccurate, like all sampling systems are.

Hal Chamberlin authored this in his book, as early as 1980.
https://www.amazon.com/Musical-Applications-Microprocessors-Hayden-microcomputer/dp/0810457539

Now that we managed to build some kind of integrator, let's deal with other stuff that's required for implementing the Universal State Variable filter, in digital.

You apply digital amplification (multiply by a constant greater than one), when wanting to quickly integrate, and when wanting to establish a strong feedback path. You apply digital attenuation (multiply by a constant smaller than one), when wanting to slowly integrate, and when wanting to establish a weak feedback path.

It then suffices to grab the three signals (highpass, bandpass, lowpass) for mixing them in digital domain using various weights, for synthesizing the particular 2nd-order transfer function that you are targeting.

Now that the context got precisely defined, everybody knowing what he is talking about, I would like to gain more knowledge about the pitfall and refinements.

Of course, the digital accumulator will become a better imitation of the analog integrator, in case one is relying on a doubled or quadrupled sampling frequency.

1. In such context, what is "trapezoidal integration"?
Is it conceivable to reach a better integrator imitation, without doubling the sampling frequency, and without systematically relying on mean values of consecutive samples?
Systematically relying on mean values of consecutive samples , equates IMO to lowpass filtering the accumulator data, which IMO may cause a stability issue (the two integrators put in series, with feedback), and a transfer function distortion.

2. In such context, and in function of what "trapezoidal integration" is, what is the "delayless loop" algorithmic difficulty that one is incurring when implementing the digital Universal State Variable Filter topology?
I have a difficulty in understanding what you wrote, Martin. Sorry. Please show me the way using kind of caveman language. Sorry.

Have a nice day.
steph_tsf
 
Posts: 249
Joined: Sun Aug 15, 2010 10:26 pm

Re: Magic IIR Biquad - testing

Postby martinvicanek » Tue Feb 25, 2020 12:26 pm

steph_tsf wrote:what is "trapezoidal integration"?
You connect consecutive samples by straight lines and determine the area under the resulting graph.

in function of what "trapezoidal integration" is, what is the "delayless loop" algorithmic difficulty that one is incurring when implementing the digital Universal State Variable Filter topology?
To evaluate an integral via the trapezoidal rule up to sample n, say, you need to know the integrand up to (and including!) sample n. However, sample n may not be known at the time needed. In a block diagram this fact manifests itself as a delayless loop. In trying to resolve the loop, you don't know where to start because all nodes are unknown.
User avatar
martinvicanek
 
Posts: 1328
Joined: Sat Jun 22, 2013 8:28 pm

Re: Magic IIR Biquad - testing

Postby steph_tsf » Wed Feb 26, 2020 8:35 am

martinvicanek wrote:You connect consecutive samples by straight lines and determine the area under the resulting graph.
Clearly, you don't say "Instead of accumulating the newest sample (into what is supposed to be the digital integrator of the State Variable Filter), I am accumulating the mean value of the two newest samples." Please tell why you don't say so. I guess you know the transfer function of the "two consecutive samples average" filter you are embedding into the State Variable Filter accumulators. Is this a kind of "frequency warping" that's easing the computation of the integrator gain coefficient, and easing the computation of the feedback coefficients? Please articulate the details.
steph_tsf
 
Posts: 249
Joined: Sun Aug 15, 2010 10:26 pm

Re: Magic IIR Biquad - testing

Postby steph_tsf » Wed Feb 26, 2020 9:12 am

Isn't there an annoying catch in a State Variable Filter, caused by the one-sample processing delay of the digital integrator? The signal chain is : HP -> digital integrator #1 -> BP -> digital integrator #2 -> LP. For assessing that (HP + BP (constant gain) + LP = unity), one may need to rely on a output signal mixer that's embedding delays. One may need to delay the HP output by two samples. One may need to delay the BP output by one sample. Can you please check? Have a nice day.
steph_tsf
 
Posts: 249
Joined: Sun Aug 15, 2010 10:26 pm

Re: Magic IIR Biquad - testing

Postby martinvicanek » Wed Feb 26, 2020 1:46 pm

Steph, my explanations seem to confuse rather than clarify, they seem to generate more questions than they actually answer. I am afraid that my scarce remarks have steered the discussion in a direction that will lead to nothing. You have a solid basis in DSP, so I recommend you Vadim's book for the specific area of ZDF, trapezoidal integration and all that.
User avatar
martinvicanek
 
Posts: 1328
Joined: Sat Jun 22, 2013 8:28 pm

Re: Magic IIR Biquad - testing

Postby steph_tsf » Wed Feb 26, 2020 4:17 pm

martinvicanek wrote:Steph, my explanations seem to confuse rather than clarify.
Thanks for pointing the Vadim book. What is a "VA" filter ? Page 50 and following are remarkable. Apparently, Vadim is not interested in checking that the schemes he is presenting, duly deliver unity when summing the LP, BP (constant gain), and HP. Apparently, all Vicanek implementations lead to a perfect summation. I just checked. I still have a difficulty in explaining why they perfectly sum up to unity. Am I wrong in thinking that there is a one-sample delay hiding inside each digital integrator? Have a nice day.
steph_tsf
 
Posts: 249
Joined: Sun Aug 15, 2010 10:26 pm

Previous

Return to DSP

Who is online

Users browsing this forum: No registered users and 35 guests