Open distortion project
- KVRAF
- 8511 posts since 12 Feb, 2006 from Helsinki, Finland
Can someone give a realistically useful audio circuit where an op-amp is configured such that it isn't safe to treat it either as linear (ie has feedback) or a sign-function (ie abusing op-amps as comparators)?
I mean sure, at some point slew-rate could become a factor and the feedback wouldn't immediately correct the non-linearities.. and if you drive it hard enough you could hit supply-rails, but is that ever done in purpose?
I mean sure, at some point slew-rate could become a factor and the feedback wouldn't immediately correct the non-linearities.. and if you drive it hard enough you could hit supply-rails, but is that ever done in purpose?
- KVRian
- Topic Starter
- 1091 posts since 8 Feb, 2012 from South - Africa
It has been done on purpose:mystran wrote: I mean sure, at some point slew-rate could become a factor and the feedback wouldn't immediately correct the non-linearities.. and if you drive it hard enough you could hit supply-rails, but is that ever done in purpose?
http://www.geofex.com/effxfaq/distn101.htm
Bottom of page Nr.14
Cool webpage as well, never knew that you could clip with LEDs - shurely they have some memory effect!? And Marshall uses Zener diodes - wouldn't have guessed that either.
- KVRAF
- 8511 posts since 12 Feb, 2006 from Helsinki, Finland
Doesn't really qualify, since based on the description that's the "abuse as comparator" case, which is also occasionally seen in synths (eg mix a saw-wave with PWM CV and feed it to an open-loop op-amp and you'll get a PWM square, etc).Ichad.c wrote:It has been done on purpose:mystran wrote: I mean sure, at some point slew-rate could become a factor and the feedback wouldn't immediately correct the non-linearities.. and if you drive it hard enough you could hit supply-rails, but is that ever done in purpose?
http://www.geofex.com/effxfaq/distn101.htm
Bottom of page Nr.14
- KVRian
- Topic Starter
- 1091 posts since 8 Feb, 2012 from South - Africa
Sorry, my bad! So far in my research I haven't really seen op-amps being driven - their distortion charectistics seem unfavourable - It's ironic though - because I've seen quite alot of clippers being used in dsp land - but analog engineers don't like it - and they don't even have aliasing to contend with. Kinda ironic, our excuse is -it's cheap and easy on CPU.mystran wrote:
Doesn't really qualify, since based on the description that's the "abuse as comparator" case, which is also occasionally seen in synths (eg mix a saw-wave with PWM CV and feed it to an open-loop op-amp and you'll get a PWM square, etc).
My whole point of starting this thread was to learn more about non-linearities and how to model it. Especially, dynamic and memory effects.
In your honest opinion, what is the most overlooked components in moddeling analog distortion?
- KVRAF
- 8511 posts since 12 Feb, 2006 from Helsinki, Finland
Feedback.Ichad.c wrote: In your honest opinion, what is the most overlooked components in moddeling analog distortion?
- KVRian
- Topic Starter
- 1091 posts since 8 Feb, 2012 from South - Africa
While on the guitar-amp subject. If you need something a little harder than tanh(x) but CPU is tight - this might work for you:
Andrew
Code: Select all
//double tanh
a = tanh(x);
out = a /((a*a)+1);
//note control the (a*a)level with an envelope follower for some dynamic fun.
- KVRian
- Topic Starter
- 1091 posts since 8 Feb, 2012 from South - Africa
Could you maybe give a simple example?mystran wrote:
Feedback.
Andrew
- KVRAF
- 8511 posts since 12 Feb, 2006 from Helsinki, Finland
What I mean that practically any interesting distortion whatsoever (including any amplifier really) typically has plenty of (usually) frequency dependent feedback going on.Ichad.c wrote:Could you maybe give a simple example?mystran wrote:
Feedback.
Andrew
For example, it's not terribly important what an op-amp does in open-loop configuration, if you're going to use it in a regular feedback configuration (which is what it was designed for) because the feedback will correct any non-linearities as long as the thing doesn't hit any limits like supply rails.
Now stick a bunch of diodes into the feedback loop, and suddenly you can have it soft-clip because the feedback gets shaped by the diodes and gives "wrong" results as far as linear operation would go. Stick a capacitor there too, and the result's going to be frequency dependent. Say a cap in parallel with some diodes would let high frequencies through, effectively by-passing the diodes at higher frequencies restoring linearity past some point, while still clipping at low-frequencies.
Most interesting distortion circuits do tons of stuff like that, and it's usually a whole lot more important than the exact shape of the waveshaper you happen to use.
- KVRian
- Topic Starter
- 1091 posts since 8 Feb, 2012 from South - Africa
Okay, my emphasis is on the practical - so you suggest:mystran wrote: For example, it's not terribly important what an op-amp does in open-loop configuration, if you're going to use it in a regular feedback configuration (which is what it was designed for) because the feedback will correct any non-linearities as long as the thing doesn't hit any limits like supply rails.
Now stick a bunch of diodes into the feedback loop, and suddenly you can have it soft-clip because the feedback gets shaped by the diodes and gives "wrong" results as far as linear operation would go. Stick a capacitor there too, and the result's going to be frequency dependent. Say a cap in parallel with some diodes would let high frequencies through, effectively by-passing the diodes at higher frequencies restoring linearity past some point, while still clipping at low-frequencies.
Code: Select all
input+feedback->non-linear-gain->output
feedback = -(clip(output)->Lowpass filter)
-
- KVRAF
- 7579 posts since 17 Feb, 2005
Let's put it this way: Feedback happens faster than sample rate, and in between samples there were many feedbacks that did something. But in digital, unless you EXPLICITLY define this behavior, the feedback is discrete time based, and not going to happen the same way. To get this behavior, requires more CPU time between samples, and depending on how large the circuit is, CPU will eventually cease to process the audio real-time.
I am sure someone could provide a simple, more intelligent example of this then I could
I am sure someone could provide a simple, more intelligent example of this then I could
- KVRian
- Topic Starter
- 1091 posts since 8 Feb, 2012 from South - Africa
So you basically have to solve a delayless structure for non-linear feedback, I've seen quite a couple of examples here on kvr of delayless feedback filters but none of them solve for non-linear feedbackcamsr wrote:Let's put it this way: Feedback happens faster than sample rate, and in between samples there were many feedbacks that did something. But in digital, unless you EXPLICITLY define this behavior, the feedback is discrete time based, and not going to happen the same way. To get this behavior, requires more CPU time between samples, and depending on how large the circuit is, CPU will eventually cease to process the audio real-time.
I am sure someone could provide a simple, more intelligent example of this then I could
Anybody with an example?
- KVRAF
- 8511 posts since 12 Feb, 2006 from Helsinki, Finland
That's because in the linear case (or a case where you can approximate it as a linear case without too much damage) you can solve the thing analytically. When you have a non-linear feedback situation, the analytic solution often either doesn't exist, or is infeasible in practice.Ichad.c wrote:So you basically have to solve a delayless structure for non-linear feedback, I've seen quite a couple of examples here on kvr of delayless feedback filters but none of them solve for non-linear feedbackcamsr wrote:Let's put it this way: Feedback happens faster than sample rate, and in between samples there were many feedbacks that did something. But in digital, unless you EXPLICITLY define this behavior, the feedback is discrete time based, and not going to happen the same way. To get this behavior, requires more CPU time between samples, and depending on how large the circuit is, CPU will eventually cease to process the audio real-time.
I am sure someone could provide a simple, more intelligent example of this then I could![]()
![]()
![]()
The principle is really the same anyway, except instead of using a nice analytic expression to get the answer, you need to use a numerical solver (eg some type of iterative method that hopefully converges eventually).
- u-he
- 30248 posts since 8 Aug, 2002 from Berlin
There was one here about half a year ago. I was in pseudo-code though, i.e. the actual solver wasn't shown. I could try to find it...Ichad.c wrote:So you basically have to solve a delayless structure for non-linear feedback, I've seen quite a couple of examples here on kvr of delayless feedback filters but none of them solve for non-linear feedbackcamsr wrote:Let's put it this way: Feedback happens faster than sample rate, and in between samples there were many feedbacks that did something. But in digital, unless you EXPLICITLY define this behavior, the feedback is discrete time based, and not going to happen the same way. To get this behavior, requires more CPU time between samples, and depending on how large the circuit is, CPU will eventually cease to process the audio real-time.
I am sure someone could provide a simple, more intelligent example of this then I could![]()
![]()
![]()
Anybody with an example?
found: http://www.kvraudio.com/forum/viewtopic.php?t=333887
Not 100% sure if this is what you're after, but the basic idea works for any kind of feedback system where "guess" and "result" converge, e.g. said OpAmp based waveshaper, compressors, FM operator feedback.
It might not be feasable for realtime operation though.
- KVRian
- Topic Starter
- 1091 posts since 8 Feb, 2012 from South - Africa
Thanks Urs! I've read though that thread - all the examples seem to solve for linear feeback - the non-linearities just distort the state(s) and not the delta(s). Though to be truly honest I do not care that much(yet) about delayless feedback - when it comes to distortion. I just want to get past the static waveshaper idea of doing things. For me there are 3 categories:
1: Static Waveshaper
2: Dynamic/with memory/varying dist per frequency Waveshaper
3: The above with delayless feedback(if need be)
I am more interisted in Nr2 really. Just need a couple of ideas/basic building blocks to get me going.
Thanks for everybody help so far though.
Andrew
1: Static Waveshaper
2: Dynamic/with memory/varying dist per frequency Waveshaper
3: The above with delayless feedback(if need be)
I am more interisted in Nr2 really. Just need a couple of ideas/basic building blocks to get me going.
Thanks for everybody help so far though.
Andrew
- KVRAF
- 12615 posts since 7 Dec, 2004
not for ideal opamps under regular conditions. not all opamps though are ideal and so also are the conditions they operate under.mystran wrote:Can someone give a realistically useful audio circuit where an op-amp is configured such that it isn't safe to treat it either as linear (ie has feedback) or a sign-function (ie abusing op-amps as comparators)?
I mean sure, at some point slew-rate could become a factor and the feedback wouldn't immediately correct the non-linearities.. and if you drive it hard enough you could hit supply-rails, but is that ever done in purpose?
some opamps have non-linear inputs which may be uncorrected. for example the common OTA ca-3080 has huge non-linear response when driven at reasonable levels. you need to feed linearization current which most designs do not.
other strange opamps exist which are more common. yes though, there are numerous circuits utilizing opamps in non-linear ways. if you took all the electronics in the world and replaced the opamps with ideals quite a lot of stuff would stop working as it used to.
there are also opamp issues that can cause locking, inversion, reversal, oscillation and others. you'd need to ask a wizard familiar with opamp torture for specific tricks but i've seen them used intentionally here and there.
Free plug-ins for Windows, MacOS and Linux. Xhip Synthesizer v8.0 and Xhip Effects Bundle v6.7.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.
