Avatar

Please consider registering
Guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed sp_TopicIcon
V.A. Filter not available in the books
No permission to create posts
November 21, 2014
8:23 pm
Avatar
IvanCohen
Member
Members
Forum Posts: 6
Member Since:
November 21, 2014
sp_UserOfflineSmall Offline

Hello Mr. Will Pirkle !

I have read recently your articles and your last book about synth filters modeling, using topology preservation from Vadim Zavalishin, and your modified Harma method. Following the examples and the tutorials, I have been able I think to understand how to get the code to simulate filters such as the Moog Ladder, the State Variable Filter, the Sallen-Key topology etc.

So, I have tried to do the same thing for another simple filter based on the Twin-T topology. It is made of one op amp used in linear mode, two capacitances, and a few resistances in the op amp feedback. Getting its transfer function is quite trivial, but how to simulate this the best way isn't that much. So, I have a few questions I'd like to ask you to finish this project and understand everything better.

1) If I take back the example of the MS20/Sallen-Key filter you explained, I remarked something interesting : the transfer function of the filters is order 2, since only two capacitances are present in the schematic. However, when you simulate it, you use the superposition theorem to get a block scheme closer of what happens in the circuit, and you get basically three 1st order filters to simulate. What prevents you from deriving the scheme block of a 2nd order SVF and adding gain multipliers to match the transfer function of the Sallen-Key ?

2) Let's say we keep the block scheme made from three 1st order filters. It is quite easy to get it from the Sallen-Key schematic, since the components there act two-by-two like low pass filters or high pass filters. However, this direct identification you did may not be always possible. In the case of the schematic I'm studying, the feedforward and the feedback filters I need to superpose aren't trivial. What am I supposed to do with them if I know their transfer function (2nd order here) ?

Thanks a lot in advance for your answers, and for all the information you have shared !

Cordially,
Ivan

November 24, 2014
8:57 pm
Avatar
W Pirkle
Admin
Forum Posts: 143
Member Since:
January 28, 2017
sp_UserOfflineSmall Offline

Hi Ivan

It looks like you are working out of the new Synth Book, so I think this post might be better in the Chapter By Chapter part of the Synth Book topic, Chapter 7. In the future, please try to use the Synth Book Chapter-by-Chapter part of the Forum. Thanks!

As for the first question, I don't understand it, but the output of the SVF's resonant LPF is theoretically identical in frequency response to the K35 filter, you just have to match settings for Q.

For Question 2, I just recently presented a paper at the AES that answers this:

http://www.aes.org/e-lib/brows.....elib=17518

It shows how to use any combination of filters in the Sallen-Key topology. It also shows what I think is the first doubly-resonant LPF ever seen. I also did a presentation on the Modified Harma method from Chap 4/7 to precede this paper.

Since I signed a 2-year copyright on the papers, I can't re-post them until 2016 but you might be able to find them out there on the net somewhere. I also need to post the projects on this website, but I am waiting until the new RAFX v6.5 is done. The designs from that paper include:

Resonant quasi-first order lowpass and highpass filters, resonant quasi-first order low and high shelving filters, decoupled resonant second order filters and doubly resonant quasi-second order lowpass and highpass filters. In the doubly-resonant filters all three frequencies may be decoupled and independently adjustable; they also self-oscillate at both resonant frequencies.

I will try to have the AES projects up sometime in December. The Harma paper introduces a new way to make 4th order LPF and HPF filters too.

All the best,

Will

November 27, 2014
12:19 pm
Avatar
IvanCohen
Member
Members
Forum Posts: 6
Member Since:
November 21, 2014
sp_UserOfflineSmall Offline

Hi Will and thanks for your answer !

I have posted my topic here since I have read both the synth book and your AES articles, but it is ok if you want to move it in the book sections Wink

About the first question I asked, I understood that a filter with a given transfer response can be simulated with a number of delay blocks depending on the structure chosen, and the order of the transfer function. For example, for a 2nd order filter, with an analog transfer function being H(s) = (b0 + b1s + b2s²) / (1 + a1s + a2s²), the digital block scheme can use 2 delay blocks if the structure is a Direct Form II, or 4 delay blocks if the structure is a Direct Form I. Using the Topology Preserving Transform, and your methodology with the superposition theorem, the linear MS20 is simulated with a structure using 3 delay blocks since there is 3 integrators in the conceptual scheme. So my question was the following : isn't possible to simulate the same filter using TPT and only two integrators / delay blocks, since the analog filter is 2nd order ? So what is the point of doing things this way ? Maybe that's because it becomes easier to choose where to put the waveshaping block and to add a naive nonlinearity ?

My second question was more or less a question about the article "Novel Hybrid Virtual Analog Filters Based on the Sallen and Key structure". In the section 2, with the figure 2.1 and 2.2, you show a way to add a feedback output to a DF1 structure simulating a biquad, allowing you to perform the modified Harma methodology to any kind of filter combination, and to get the block scheme simulating all this stuff successfully. However, I have a concern with this. One of the reasons why Vadim did all his TPT stuff is because he was looking for better structures than DF1 and TDF2 to simulate a filter on a time-varying context, for example if the cutoff frequency of the filter is modulated. With the integrators being apparent in the digital structure, it reacts closer to the analog circuit when a parameter is modulated, and it is really important when you want to use it in a synthesizer. However, tell me if I'm wrong, your Sallen-Key structure made of "custom" filters, made from the method displayed in the figure 2.1 and 2.2, are just customized DF1 with a feedback output, and not TPT structures. So, in the time varying case, they may exhibit artefacts. So, I wondered if it would be possible for any custom biquad or filter in general to find a way to create a TPT structure from its transfer function, so that we don't have this problem.

Thanks in advance for your answers Wink

November 28, 2014
9:06 pm
Avatar
W Pirkle
Admin
Forum Posts: 143
Member Since:
January 28, 2017
sp_UserOfflineSmall Offline

Hi Ivan

No need to move the topic. I did not know you had read the AES Papers. In response to your questions:

1) The point of the K35 design, and all of my latest designs, has involved simulating either the actual or the conceptual signal flow diagrams of filters. Typically, this is not the same as simulating the analog block-diagram. As you point out, theoretically, a second order filter would only require 2 integrators/reactive components. If you only analyze the analog transfer function H(s) for a 2nd order filter directly, you will arrive at either the SVF or Tow-Thomas bi-quad versions (see VanValkenberg's book for excellent derivations). If that were the case, then why do analog filter books have dozens or sometimes even scores of other block-diagrams/circuits that produce the exact same frequency response, often times with much more complex structures? The answer there has to do with signal flow and sensitivity to circuit component variations, and as I point out in the synth book the "problem at hand" for the analog designer, i.e. the end application. Of course, we don't worry about component variation. My curiosity lies more in high-level analog signal flow rather than lower level block diagram forms. For me, minimizing components or integrators is not as interesting as coming up with different/unique filters that have never been realized before.

In the case of the K35, I noticed that (1) The SVF self self-oscillates only when the inner feedback is -1.0 and if you use the equations for this, your knob/slider would need to go from 0 to infinity, or you would need a switch that turned the inner feedback to -1.0 after some point (Q>1,000,000?). The K35 is built around the sallen-key architecture which has a simple, continuous Q control that moves from no resonance to self-oscillation linearly as K goes from ~0 to 2.0. Thus the SVF structure isn't going to have the same "knob feel" as the K35. (2) The SVF would never distort the same way as the K35 with the saturator in the integrator as in Zavalishin. The K35 signal-flow+saturation reveals how the distortion occurs.

Since I have an MS-20 for comparison, I spent some time turning knobs with my eyes closed (on the MS-20 vs on a MIDI controller mapped to RAFX parameters). The idea here is to simulate the user-experience with tactile control. The SVF doesn't have the same tactile response, or the same distortion on the output, as the K35. If you wanted to, you could replace the DF1 blocks with TPT blocks, but you would still have 3 delay elements. This reveals the difference between signal flow charts and block-diagrams based off solving the differential equation for the filter. Solving the differential equation gives you one structure. But, many different signal flow diagrams can implement the same analog bock diagram structure. This is what interests me.

(2) Early on, I had several students as well as book readers who emailed me, who were mis-informed about the delay-less loop resolution. They were under the impression that the delay-less loop resolution could only be done using the TPT structure. The reality is, as pointed out the Harma paper, that the structure only needs to be in a linear form with current + stored outputs. I have even used FIR filters in the structures since they can also be fashioned into this format. After doing the modified Harma derivation, the very first thing I did was to implement the TPT-Moog ladder filter along with the DF1 (biquad) version in the Harma paper, and modulate their cutoffs with a sawtooth LFO that has a discontinuity, then use RAFX's "Process into Wave File" to process and capture both outputs with the same stimulus. I observed several things. (a) I could not hear any difference in the two. I could not hear "artifacts" or anything else artificial in the DF1 version. How would you even quantify "artifact" here? How would you detect and measure these artifacts? (b) the two filters have identical frequency responses. (c) the two filters DO have different time-responses to modulation. I found this by subtracting the two filtered outputs and finding the residual. Sure enough, there were differences right at the discontinuity in the LFO. I would not call these "artifacts," just the difference in the two outputs. The residual's RMS value was about -45dB, so these differences were quite low in amplitude. You would really need to do comparisons against actual analog circuits to make meaningful statements about artifacts or other distortions/etc and so far, I have not seen any work done on that, but would enjoy seeing it if anyone wants to do that! Right off the bat, that sets up many problems. Making comparisons with analog circuits and doing meaningful analysis is difficult due to the analog vs. digital nature of the two.

In the case of the Novel Filters paper, there are no analog structures to compare the filters with. Again, how do you quantify "artifacts" here with nothing to compare with? Ultimately, this has become my new focus - generating new filters/signal processors that have never existed before. And, yes, none of the filters in the Novel Filters paper use the TPT structure; this was on purpose to show that you don't need these structures to synthesize interesting filters with delay-free loops.

Please note that I am not downplaying the significance of the TPT structure - after all, every single filter in the Synth Book uses the TPT version! But after doing a lot of my own experiments and listening tests, and after going back to Lindquist's analog book and re-deriving the signal flow of his various filter "classes" and working on my own new variations, I decided to let others worry about the TPT "artifact" argument (and there is a lot of arguing going on, just peruse the music.dsp lists...) and move forward and design new filters no one has seen before.

I hope that sheds light on where I am coming from as well as where I am moving towards.

All the best,

Will

PS: disclaimer - Lindquist was my analog filtering/DSP prof. in grad school

PPS: after I get done with the new RAFX version, I will post all the AES filters as projects you can download. I will also do a RAFX project that lets you switch between the TPT and DF1 versions of the Moog ladder filter on-the-fly. Then, you can decide for yourself whether or not they sound the same. And, if you have a Moog synth, you could also do comparisons to reveal just how differently all the filters behave when their cutoffs are modulated. Perhaps you could do these experiments and post the results here? I know that many people, including myself, would be very interested in seeing a direct, quantified tabulation of exactly how the filters differ as well as the magnitude of these artifacts.

December 1, 2014
3:30 pm
Avatar
IvanCohen
Member
Members
Forum Posts: 6
Member Since:
November 21, 2014
sp_UserOfflineSmall Offline

Hi Will !

Will said
1) The point of the K35 design, and all of my latest designs, has involved simulating either the actual or the conceptual signal flow diagrams of filters.

That's what I have understood and that I have found really interesting in your work. Moreover, I was happy to see people trying to digest a little the TPT stuff, since the papers about it give information but also ask a few questions. I did a PhD thesis about dsp and guitar amp simulations and the reason why I'm spending some time to get this stuff is because I do intensive analog modeling too, and I have always find interesting the approaches taken by "synth guys" ;) So I'm asking dumb questions to be sure I get everything here and their implications.

So, to summarize if I have understood correctly, your approach has a few goals including keeping the "natural" mapping between the controls and the sound result, being as close as possible in the simulation structure with the analog signal flow so you can easily put the saturator in the right place, and getting interesting/unique filters ? That sounds great to me, and I have really liked what you did with structure variations, multiple resonance filters etc. too ;)

About the TPT structures, indeed the resolution of delay free loops can be done with thousands of methods when you are in a linear context. What I have understood about this is that the author has just given one method to do the resolution using his paradigms, and he wanted to keep somehow in the digital domain one structure in the analog one with explicit integrators, being replaced with bilinear integrators in the digital domain, plus some multiplications to solve the delay loops. The interest of that was to make the digital structure behave closer to the analog one when a parameter such as the cutoff frequency changes. Some artefacts may appear when other structures are used, such as the DF1, since variations of the coefficients may change abruptly a gain factor, placed after the integrators in the digital structure, which is something causing aliasing because of the step generation in the output happening when the gain changes without any smoothing. Even if the artefacts may not be very important in some cases, since the frequency has to be modulated often in synthesizers, with some rates close to audio frequencies even for LFOs, I always assume it is a bad idea not to provide any smoothing here, and I can hear the difference easily with any filter modulated with extreme LFO rates/amounts. However, if you use the TDF2 structure instead, that I prefer to the DF1 in general, the variation of the coefficients is smoothed, since the integrator is always placed after, so this problem never happens there.

The question remaining for me is : what is the use of a standard TPT structure when you can also use TDF2 ? I have runned tests too, with some signal going to both structures, and a quick variation of one coefficient, to see what happened. My conclusion was that... I wasn't able to find something really interesting between both results, interesting enough to make me change all my TDF2 into TPT structures :) Some people on the KVR DSP forum might argue differently indeed.

However, the will to maintain in a way or another the signal flow of analog in the digital domain when simulating is an idea I have found really interesting. And I think that what you do goes more to this direction than what Vadim said initially in his papers, with his TPT structures. All this stuff makes me want to do again a lot of tests with various filter structures !

Thanks for all you responses to this ;)

December 3, 2014
11:39 pm
Avatar
W Pirkle
Admin
Forum Posts: 143
Member Since:
January 28, 2017
sp_UserOfflineSmall Offline

Hi Ivan

I am glad you understand my point of view on modeling signal flow rather than just the analog block diagram; there seem to be more gold out there to mine. I have also been looking at comparisons of multiple signal flow diagrams that produce the same frequency domain response with varying time-domain responses, and simulations of sensitivities to analog component variations in the various classes of filters. Also been looking at some non-filter opportunities such as phase locked loops.

I can't give you a good answer regarding TPT vs TDF2 since I have not done any extensive testing on this regarding audibility and "closeness to the real analog filter" but if you were my grad student and proposed a thesis on the audibility of the different forms in time-varying situations, the first thing I would say is to do a small listening test to see if the effects are audible, and if so, how audible. Then, we could launch into research. Academia and message-boards can be mutually exclusive sometimes. In academia, nothing is proven until many tests and verifications are done, and even then a few people will still question the results - as it should be. Have you ever been on a penny-stock message board/forum?

Thanks for all the input! I am sure many others have enjoyed the dialog too. And I would love to see any quantitative analysis you have on TDT vs TDF2. I am also hoping one of my new grad students expresses an interest in this as well so we can do more work in this area. My own personal research time is limited these days.

All the best,

Will

December 4, 2014
1:40 pm
Avatar
IvanCohen
Member
Members
Forum Posts: 6
Member Since:
November 21, 2014
sp_UserOfflineSmall Offline

Hi Will !

I'm still working on this stuff, so if I get interesting results, I will be glad to post a message about them here ;)

And thanks again for your explanations, and all the information you shared with your articles and your books !

All the best too,
Ivan

December 5, 2014
2:06 am
Avatar
RMA
Member
Members
Forum Posts: 12
Member Since:
September 28, 2013
sp_UserOfflineSmall Offline

I've been following this conversation. Very interesting. Just now got a notice from Amazon that the synth book is being shipped, so that's pretty exciting. I'm very eager to read the bits about VA and Modified Harma filters. I have been watching the VA discussions on KvR since they started, and your apparent conversion to VA and your new direction have made for exciting reading.

I'm trying to decide if I should buy the papers you wrote, Will. You mentioned that you will be posting source for the filters that have come out of your work. If I have the book and you post the filters, is there a reason to buy the papers? If I have a good handle on DSP and a fair handle on filter design, would the papers help me design my own novel filters?

December 5, 2014
9:20 pm
Avatar
RMA
Member
Members
Forum Posts: 12
Member Since:
September 28, 2013
sp_UserOfflineSmall Offline

From your P17-5 paper's description: "In this paper we demonstrate novel variations on the Sallen-Key architecture and we decouple the resonant and cutoff frequencies. This produces multiple hybrid filter designs including resonant quasi-first order lowpass and high pass filters."

A couple questions.

1) What happens if you set up a low-pass filter and have the resonant frequency well above the cutoff frequency? Obviously there is still some signal above the cutoff, but is the amplitude of the resonant peak dampened? Have you spent any time with such a filter? Is it musically useful to sweep or modulate the cutoff separately from the resonant? It certainly sounds like fun.

2) Resonant first order filters? That's pretty nifty and unusual, although it wouldn't be the first, right? We're talking 6dB per octave drop, right? Seems like one could do it by stacking a LPF and an APF together. After all, I believe I have encountered resonant all pass filters before.

And this one, unrelated to the paper.

You have a switchable 2pole/4pole Moog filter on your site. Could they be blended together to get a continuously varied 2-4 pole filter? Or would you get a comb-filter-like response? In other words, how well are the two filters matched? I intended to ask you this before, and I can't remember if I did. Apologies if I've repeated an old question of mine.

Now pulling the last question into the domain of your paper:

Would your new filter structures or approaches help with this at all: With the right pairing of a resonant 4-pole APF and a resonant 4-pole LPF, could you make a filter with continuing varied response from 0dB/octave to 24dB/octave? And if you can, why haven't you? And if you have, code please? :-)

December 5, 2014
9:39 pm
Avatar
W Pirkle
Admin
Forum Posts: 143
Member Since:
January 28, 2017
sp_UserOfflineSmall Offline

1) the when the resonant peak is above the cutoff, you still hear it, though it is attenuated depending on location. When the filter self-oscillates, the oscillation is likewise attenuated. I think it sounds killer myself and very fun to play with, cross modulating the cutoff and resonant peak out of phase with each other

2) yes, the Korg35 HPF is a good example of that (that is explained in my earlier paper on modeling the K35 filters, AES e-brief)

3) I have not tried blending/mixing the 2-4 pole Moog filters but I don't see why that couldn't be done either

I have not delved into making adjustable filters as you are describing, but I urge you to experiment on your own.

Will

December 5, 2014
9:47 pm
Avatar
RMA
Member
Members
Forum Posts: 12
Member Since:
September 28, 2013
sp_UserOfflineSmall Offline

Thanks for the answers. Perfectly happy to do it on my own if you don't already have the code lying around! Thanks, Will.

December 6, 2014
2:59 am
Avatar
RMA
Member
Members
Forum Posts: 12
Member Since:
September 28, 2013
sp_UserOfflineSmall Offline

After your comments, I couldn't resist buying your two recent AES papers. Very interesting stuff.

One small typo in the text. On page 5 of paper 9195, I believe "roll-of slope" should be "roll-off slope". This error occurs twice on the page. Seems to be correct in other parts of the paper.

These filters look great. I'll be watching for source code, and trying out some of my own filters at some point.

December 9, 2014
12:23 am
Avatar
W Pirkle
Admin
Forum Posts: 143
Member Since:
January 28, 2017
sp_UserOfflineSmall Offline

I have added the Novel Filters App Note and Code to the App Note page (see right sidebar too).

- Will

December 9, 2014
11:49 pm
Avatar
RMA
Member
Members
Forum Posts: 12
Member Since:
September 28, 2013
sp_UserOfflineSmall Offline

Will said

I have added the Novel Filters App Note and Code to the App Note page (see right sidebar too).

- Will

Very nice. I've got your two papers now and the code. Also took a look at your youtube video. Amazon claims I'll have the synth book by tomorrow evening. I should now be able to make my own filter using the modified Harma method.

It's amazing how much the thinking about dsp audio filters has changed in the last 5 years. I did not see that coming at all.

December 19, 2014
6:58 pm
Avatar
IvanCohen
Member
Members
Forum Posts: 6
Member Since:
November 21, 2014
sp_UserOfflineSmall Offline

Hello Will !

Just a message to tell you that I have been able to model successfully a synth filter from a schematic (very close to the one used for the TR 808 kick, with an op amp) using the Modified Harma's method Wink, the same way you did for the Korg35 LPF.

The only main differences are that I have only a filter (2nd order) in the feedback path, and another before the loop input (2nd order too), like you had before using one LPF in the middle. Moreover, my biquads are not simple filter topologies (SVF and others), but custom filters with Laplace coefficients got from automatic equation generations algorithms, such as the MNA. So, I had to discretize them with the TDF2, since it is not trivial to get the equivalent with a TPT structure.

I'm working now on ways to improve the results. Obviously I'm not happy with the use of the TDF2 structure. The plug-in displays artefacts when I move the cutoff or resonance knobs, and I have been able to do tests showing that it would not happen with a TPT structure. I did a program on MATLAB, which sends a sawtooth into a lowpass filter made with various structures, with a cutoff change (400 to 1600 Hz) in the middle of the execution. Then, the program displays the resulting waveforms, and estimate the distortion made by the cutoff change. I have been able to see that the TPT structure gives better results in a very obvious way than the other ones, the DF2 being the worst of course. I may share the program source code if you are interested. In short, the waveform in the TPT case looks continuous and bounded, whereas the waveforms in the others cases have continuous more or less importants peaks, with little distortion but relevant consequences caused by the fast increase of the output amplitude.

So, I'm trying right now to implement the algorithms from a DAFX 14 article I have seen recently, to make a TPT structure from my Laplace filters. I may also use classical techniques to smooth the parameter changes, but I'd rather do that automatically with the TPT structure if possible (and I'm not sure it will work, since the article tells that we need coefficients to multiply to the SVF outputs)

http://www.dafx14.fau.de/paper.....s_for_.pdf

Then, I will try to replace the "naive" nonlinearity I have used by something made with an implicit solver algorithm, so that the nonlinearity will be considered in the simulation the right way.

December 20, 2014
3:09 am
Avatar
W Pirkle
Admin
Forum Posts: 143
Member Since:
January 28, 2017
sp_UserOfflineSmall Offline

Hi Ivan

Wow - that's very cool that you used the Modified Harma method to model the filter. Any chance on sharing the analog schematic? One of my students is going to try something similar with a Russian synth LPF that is an interesting gain-tuned design.

In my residual tests between the Moog Ladder with DF1 vs TPT using an up-sawtooth for modulation, I saw ringing followed by a small discontinuity on each of the up-saw edges, but as a residual, that's all you get. So, I am really glad you are going into these experiments. Really useful information so please feel free to share your results. I might also have some grad students interested in pursuing this line of research next semester, so I will stay in touch.

Glad that you are getting good mileage out of those AES papers and the Modified Harma method.

- Will

December 20, 2014
7:43 pm
Avatar
IvanCohen
Member
Members
Forum Posts: 6
Member Since:
November 21, 2014
sp_UserOfflineSmall Offline

Hello Will !

I'm think I'm going to do a PDF to share my results, it will be complicated to do this an other way. I will tell you when it's ready ;)

December 22, 2014
10:13 pm
Avatar
W Pirkle
Admin
Forum Posts: 143
Member Since:
January 28, 2017
sp_UserOfflineSmall Offline

Hi Ivan

Sweet! Really looking forward to your results - thanks again for sharing, I am sure they will be helpful for many.

- Will

Forum Timezone: America/New_York

Most Users Ever Online: 36

Currently Online:
3 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Skyler: 47

Peter: 41

Derek: 41

clau_ste: 39

Frodson: 38

Gwen: 32

EZB: 24

lppier: 23

Msaldaña: 18

Jorge: 17

Member Stats:

Guest Posters: 1

Members: 476

Moderators: 1

Admins: 4

Forum Stats:

Groups: 11

Forums: 30

Topics: 482

Posts: 1876

Newest Members:

sam, annaharris, Marie Weaver, kev, Steven, Mr Anderson, mguy, omelc

Moderators: W Pirkle: 143

Administrators: Tom: 65, JD Young: 80, Will Pirkle: 0, W Pirkle: 143