Plug-ins, Hosts, Apps,
Hardware, Soundware
Developers
(Brands)
Videos Groups
Whats's in?
Banks & Patches
Download & Upload
Music Search
KVR
   
KVR Forum » DSP and Plug-in Development
Thread Read
Book: The Art of VA Filter Design
Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8, 9  Next
Robin from www.rs-met.com
KVRAF
- profile
- pm
- e-mail
- www
PostPosted: Wed May 23, 2012 7:59 am reply with quote
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 Smile


yes. i see. question answered. thanks.

...looking forward to read the rest of the book this evening. Very Happy
----
^ Joined: 08 Mar 2004  Member: #15959  Location: Berlin, Germany
mystran
KVRAF
- profile
- pm
- e-mail
- www
PostPosted: Wed May 23, 2012 8:20 am reply with quote
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 Smile


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.

Quote:

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. Smile
----
<- my plugins | my music -> @Soundcloud
^ Joined: 11 Feb 2006  Member: #97939  Location: Helsinki, Finland
Ichad.c
KVRist
- profile
- pm
- e-mail
- www
PostPosted: Wed May 23, 2012 9:25 am reply with quote
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 Embarassed

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

Kind Regards
Andrew
^ Joined: 08 Feb 2012  Member: #274678  Location: South - Africa
Z1202
KVRist
- profile
- pm
PostPosted: Wed May 23, 2012 10:13 am reply with quote
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 Wink
^ Joined: 11 Apr 2002  Member: #2472  
Caco
KVRian
- profile
- pm
PostPosted: Wed May 23, 2012 11:26 pm reply with quote
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 Wink


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 Smile
^ Joined: 25 Apr 2005  Member: #66287  
Richard_Synapse
KVRist
- profile
- pm
PostPosted: Thu May 24, 2012 1:06 am reply with quote
Great book, and great idea to write it! Smile

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

Richard
----
Synapse Audio Software - www.synapse-audio.com
^ Joined: 19 Dec 2010  Member: #245936  
Z1202
KVRist
- profile
- pm
PostPosted: Thu May 24, 2012 1:21 am reply with quote
Richard_Synapse wrote:
Great book, and great idea to write it! Smile

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
^ Joined: 11 Apr 2002  Member: #2472  
Robin from www.rs-met.com
KVRAF
- profile
- pm
- e-mail
- www
PostPosted: Thu May 24, 2012 1:25 am reply with quote
Richard_Synapse wrote:
Great book, and great idea to write it! Smile

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)
----
^ Joined: 08 Mar 2004  Member: #15959  Location: Berlin, Germany
Robin from www.rs-met.com
KVRAF
- profile
- pm
- e-mail
- www
PostPosted: Thu May 24, 2012 3:19 am reply with quote
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:


// 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
  }
}
----
^ Joined: 08 Mar 2004  Member: #15959  Location: Berlin, Germany
Dentoid
KVRist
- profile
- pm
PostPosted: Thu May 24, 2012 3:31 am reply with quote
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! Smile
----
kiloHearts Developer
^ Joined: 09 May 2011  Member: #256325  
mystran
KVRAF
- profile
- pm
- e-mail
- www
PostPosted: Thu May 24, 2012 3:35 am reply with quote
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.php?p=4913251#491325 1
----
<- my plugins | my music -> @Soundcloud
^ Joined: 11 Feb 2006  Member: #97939  Location: Helsinki, Finland
Robin from www.rs-met.com
KVRAF
- profile
- pm
- e-mail
- www
PostPosted: Thu May 24, 2012 3:43 am reply with quote
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.php?p=4913251#491325 1


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?
----
^ Joined: 08 Mar 2004  Member: #15959  Location: Berlin, Germany
Z1202
KVRist
- profile
- pm
PostPosted: Thu May 24, 2012 3:46 am reply with quote
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 Smile But intuitively, you're right, that's still kind of weird Smile
^ Joined: 11 Apr 2002  Member: #2472  
Robin from www.rs-met.com
KVRAF
- profile
- pm
- e-mail
- www
PostPosted: Thu May 24, 2012 3:49 am reply with quote
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 Smile But intuitively, you're right, that's still kind of weird Smile


good to know, that i'm in good company to think so.
----
^ Joined: 08 Mar 2004  Member: #15959  Location: Berlin, Germany
Z1202
KVRist
- profile
- pm
PostPosted: Thu May 24, 2012 3:53 am reply with quote
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 Smile But intuitively, you're right, that's still kind of weird Smile


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.
^ Joined: 11 Apr 2002  Member: #2472  
All times are GMT - 8 Hours

Printable version
Page 4 of 9
Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8, 9  Next
Display posts from previous:   
ReplyNew TopicPrevious TopicNext Topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Username: Password:  
KVR Developer Challenge 2012