Book: The Art of VA Filter Design 2.1.2

DSP, Plugin and Host development discussion.
Post Reply New Topic
RELATED
PRODUCTS

Post

Z1202 wrote:
Robin from www.rs-met.com wrote:
mystran wrote:Urgh, if you mean replacing the integrator with something that doesn't have a pole at DC...
hmm, actually i meant considering the integrator itself as stable filter vs considering only the larger structures containing the integrator (such as the lowpass) as stable filters. the integrator is exactly on the border between (strictly) stable and (strictly) unstable and i considered it within the set whereas Vadim didn't. that was the reason for the confusion, i guess.
I guess for me the intuitive definition of stable is BIBO. And the integrator isn't BIBO. I always considered marginal stability as being not really stable :)
yes. i see. question answered. thanks.

...looking forward to read the rest of the book this evening. :D
My website: rs-met.com, My presences on: YouTube, GitHub, Facebook

Post

Z1202 wrote:I assume peaking in your terminology is the one I refer to as band-shelving on p.81? There is a bandwidth-based formula for the damping. I guess it should match yours, if neither of us did a mistake. Can't compare them without a piece of paper though :)
Yes "peaking eq" is the term I've seen used more often, but it's the same thing. Yeah, there was band-width formulas, and while I'm too lazy to check if it leads to the same definition (if you measure bandwidth at half dB-gain then yes), I thought it might be helpful to consider it directly. But I agree it's somewhat orthogonal to the main subject.
As for 2-pole low- and high-shelf I basically only mention this possiblity as a footnote on the same page. IIRC, I had some weird amplitude response shapes from 2-pole low- and high-shelves (maybe at high resonance, don't remember anymore). Still unsure, if it's a good idea to discuss those.
Main value I see is that we could start using your book as the "default" reference for people that ask about learning filters. Beyond the occasional utility biquads (and everyone knows my opinion about direct forms) I just don't see the point to refer people to traditional texts anymore.

But up to you. :)

Post

mystran wrote: Ok, so we basically need:

1. integration (needs to be understood conceptually)

2. trapezoidal integration as a digital filter; how does it approximate integration (conceptual level should be fine), and how do we implement it

3. solving systems of equations

If you don't understand one of these, maybe we can try to give some pointers. Please tell which point you have trouble with, and I (or someone else) can try to help.
Thanks for all the help and support Mystran - you are a scholar and a gentleman, but I think I'd just be wasting your time at this given point in time. Think I should rather brush up on my math skills (what Vadim refers to as high-school algebra is not the case in my country! The internet is a foreighn concept to some), I also need to improve my c++ knowledge (still in noob land - but taking a course shortly), and actually read Maxima's manual :oops:

When I got that sorted, I'll give you a shout.

Kind Regards
Andrew

Post

mystran wrote:Main value I see is that we could start using your book as the "default" reference for people that ask about learning filters. Beyond the occasional utility biquads (and everyone knows my opinion about direct forms) I just don't see the point to refer people to traditional texts anymore.
I guess that's the highest mark the book could ever get, thank you for the compliment! Let's see if everyone else agrees though ;)

Post

Z1202 wrote:
mystran wrote:Main value I see is that we could start using your book as the "default" reference for people that ask about learning filters. Beyond the occasional utility biquads (and everyone knows my opinion about direct forms) I just don't see the point to refer people to traditional texts anymore.
I guess that's the highest mark the book could ever get, thank you for the compliment! Let's see if everyone else agrees though ;)
I agree Vadim, I think your book will prove to be a very valuable text for learning about filters for many people. Thank you for sharing :)

Post

Great book, and great idea to write it! :)

I've found some minor typos, if you want I can PM you those.

Richard
Synapse Audio Software - www.synapse-audio.com

Post

Richard_Synapse wrote:Great book, and great idea to write it! :)

I've found some minor typos, if you want I can PM you those.

Richard
Sure, I'd appreciate any constructive feedback. Maybe you collect those and send them in a single message? Thanks

Post

Richard_Synapse wrote:Great book, and great idea to write it! :)

I've found some minor typos, if you want I can PM you those.

Richard
i found just one: page 61 in the block diagram: i think, it should be a captial "S".

i'm through the book. it was a great read. thanks again. i also think, that it will soon become a kind of standard, must-read reference when it comes to (musical) digital filters.

i think, now i'll finally get my hands dirty with implementing the TPT/ZDF-SVF (which is also the first time, that i implement an SVF at all - as strange as that may sound)
My website: rs-met.com, My presences on: YouTube, GitHub, Facebook

Post

Robin from www.rs-met.com wrote: i think, now i'll finally get my hands dirty with implementing the TPT/ZDF-SVF (which is also the first time, that i implement an SVF at all - as strange as that may sound)
done. and - lo and behold - it worked on first go. well, at least, plotting the impulse responses looked reasonable and LP+2*R*BP+HP reconstruct the original signal, as it should be. here it is:

Code: Select all

// Example code for a TPT/ZDF-SVF (obviously, this could be optimized for production code)
// written by Robin Schmidt, licensing/copyright: none (public domain)
// Parameters:
// fc: cutoff frequency
// fs: sample-rate
// R:  damping coefficient
// N:  number of samples
// x:  input signal
// yL: lowpass output
// yB: bandpass output
// yH: highpass output
void svf(double fc, double fs, double R, int N, double x[], double yL[], double yB[], double yH[])
{
  double wd = 2*PI*fc;           // target radian frequency
  double T  = 1/fs;              // sampling period
  double wa = (2/T)*tan(wd*T/2); // prewarped radian frequency for analog filter (Eq. 3.7)
  double g  = wa*T/2;            // embedded integrator gain (Fig 3.11), wc == wa

  // states of the 2 integrators, static so we can call the function block-wise while maintaining 
  // the states from block to block:
  static double s1 = 0.0;
  static double s2 = 0.0;

  // loop over the samples:
  for(int n = 0; n < N; n++)
  {
    // compute highpass output via Eq. 5.1:
    yH[n] = (x[n] - 2*R*s1 - g*s1 - s2) / (1 + 2*R*g + g*g);

    // compute bandpass output by applying 1st integrator to highpass output:
    yB[n] = g*yH[n] + s1;
    s1    = g*yH[n] + yB[n]; // state update in 1st integrator

    // compute lowpass output by applying 2nd integrator to bandpass output:
    yL[n] = g*yB[n] + s2;
    s2    = g*yB[n] + yL[n]; // state update in 2nd integrator

    // Remark: we have used two TDF2 integrators (Fig. 3.11) where one of them would be in code:
    // y = g*x + s; // output computation
    // s = g*x + y; // state update
  }
}
[/size]
My website: rs-met.com, My presences on: YouTube, GitHub, Facebook

Post

Just skimmed it so far, and it looks like amazing work, Vadim! I really look forward to reading it through and hopefully fill in some gaps in my knowledge! :)
kiloHearts Developer

Post

Robin from www.rs-met.com wrote:
Robin from www.rs-met.com wrote: i think, now i'll finally get my hands dirty with implementing the TPT/ZDF-SVF (which is also the first time, that i implement an SVF at all - as strange as that may sound)
done. and - lo and behold - it worked on first go. well, at least, plotting the impulse responses looked reasonable and LP+2*R*BP+HP reconstruct the original signal, as it should be. here it is:
Looks reasonable. I actually posted another earlier, but it's pretty much similar (I use different state-update but that's not really important):

http://www.kvraudio.com/forum/viewtopic ... 51#4913251

Post

mystran wrote: Looks reasonable. I actually posted another earlier, but it's pretty much similar (I use different state-update but that's not really important):

http://www.kvraudio.com/forum/viewtopic ... 51#4913251
yes, looks similar, although i didn't check in detail. but the filter makes me wonder a bit: we obtain the lowpass from the output of the bandpass by integration - but the bandpass signal should already have DC removed completely, no? so, how can the integrator reconstruct a DC component that has already been filtered out completely?
My website: rs-met.com, My presences on: YouTube, GitHub, Facebook

Post

Robin from www.rs-met.com wrote:but the filter makes me wonder a bit: we obtain the lowpass from the output of the bandpass by integration - but the bandpass signal should already have DC removed completely, no? so, how can the integrator reconstruct a DC component that has already been filtered out completely?
Well, the integrator has an infinite gain at DC :) But intuitively, you're right, that's still kind of weird :)

Post

Z1202 wrote:
Robin from www.rs-met.com wrote:but the filter makes me wonder a bit: we obtain the lowpass from the output of the bandpass by integration - but the bandpass signal should already have DC removed completely, no? so, how can the integrator reconstruct a DC component that has already been filtered out completely?
Well, the integrator has an infinite gain at DC :) But intuitively, you're right, that's still kind of weird :)
good to know, that i'm in good company to think so.
My website: rs-met.com, My presences on: YouTube, GitHub, Facebook

Post

Robin from www.rs-met.com wrote:
Z1202 wrote:
Robin from www.rs-met.com wrote:but the filter makes me wonder a bit: we obtain the lowpass from the output of the bandpass by integration - but the bandpass signal should already have DC removed completely, no? so, how can the integrator reconstruct a DC component that has already been filtered out completely?
Well, the integrator has an infinite gain at DC :) But intuitively, you're right, that's still kind of weird :)
good to know, that i'm in good company to think so.
I would further assume, that should you simply connect an integrator to the bandpass output, the resulting lowpass signal might "drift" around DC, whereas inside the filter the feedback will probably take care of the precision losses.

Post Reply

Return to “DSP and Plugin Development”