What is KVR Audio? | Submit News | Advertise | Developer Account

Options (Affects News & Product results only):

OS:
Format:
Include:
Quick Search KVR

"Quick Search" KVR Audio's Product Database, News Items, Developer Listings, Forum Topics and videos here. For advanced Product Database searching please use the full product search. For the forum you can use the phpBB forum search.

To utilize the power of Google you can use the integrated Google Site Search.

Products 0

Developers 0

News 0

Forum 0

Videos 0

Search  

Book: The Art of VA Filter Design

DSP, Plug-in and Host development discussion.

Moderator: Moderators (Main)

KVRAF
 
3648 posts since 8 Mar, 2004, from Berlin, Germany
 

Postby Robin from www.rs-met.com; Wed May 23, 2012 7:59 am

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
Image
KVRAF
 
4078 posts since 11 Feb, 2006, from Helsinki, Finland
 

Postby mystran; Wed May 23, 2012 8:20 am

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. :)
Image <- plugins | forum
User avatar
KVRian
 
600 posts since 8 Feb, 2012, from South - Africa
 

Postby Ichad.c; Wed May 23, 2012 9:25 am

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
KVRist
 
492 posts since 11 Apr, 2002

Postby Z1202; Wed May 23, 2012 10:13 am

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 ;)
KVRian
 
1040 posts since 25 Apr, 2005

Postby Caco; Wed May 23, 2012 11:26 pm

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 :)
User avatar
KVRian
 
514 posts since 19 Dec, 2010

Postby Richard_Synapse; Thu May 24, 2012 1:06 am

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
KVRist
 
492 posts since 11 Apr, 2002

Postby Z1202; Thu May 24, 2012 1:21 am

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
KVRAF
 
3648 posts since 8 Mar, 2004, from Berlin, Germany
 

Postby Robin from www.rs-met.com; Thu May 24, 2012 1:25 am

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)
Image
KVRAF
 
3648 posts since 8 Mar, 2004, from Berlin, Germany
 

Postby Robin from www.rs-met.com; Thu May 24, 2012 3:19 am

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
  }
}
Image
KVRist
 
146 posts since 9 May, 2011

Postby Dentoid; Thu May 24, 2012 3:31 am

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
KVRAF
 
4078 posts since 11 Feb, 2006, from Helsinki, Finland
 

Postby mystran; Thu May 24, 2012 3:35 am

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
Image <- plugins | forum
KVRAF
 
3648 posts since 8 Mar, 2004, from Berlin, Germany
 

Postby Robin from www.rs-met.com; Thu May 24, 2012 3:43 am

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?
Image
KVRist
 
492 posts since 11 Apr, 2002

Postby Z1202; Thu May 24, 2012 3:46 am

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 :)
KVRAF
 
3648 posts since 8 Mar, 2004, from Berlin, Germany
 

Postby Robin from www.rs-met.com; Thu May 24, 2012 3:49 am

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.
Image
KVRist
 
492 posts since 11 Apr, 2002

Postby Z1202; Thu May 24, 2012 3:53 am

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.
PreviousNext

Moderator: Moderators (Main)

Return to DSP and Plug-in Development