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
Open distortion project
Goto page Previous  1, 2, 3  Next
mystran
KVRAF
- profile
- pm
- e-mail
- www
PostPosted: Thu May 10, 2012 9:18 am reply with quote
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?
----
<- my plugins | my music -> @Soundcloud
^ Joined: 11 Feb 2006  Member: #97939  Location: Helsinki, Finland
Ichad.c
KVRist
- profile
- pm
- e-mail
- www
PostPosted: Thu May 10, 2012 9:56 am reply with quote
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?


It has been done on 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.
^ Joined: 08 Feb 2012  Member: #274678  Location: South - Africa
mystran
KVRAF
- profile
- pm
- e-mail
- www
PostPosted: Thu May 10, 2012 10:03 am reply with quote
Ichad.c wrote:
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?


It has been done on purpose:
http://www.geofex.com/effxfaq/distn101.htm
Bottom of page Nr.14


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


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.

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?
^ Joined: 08 Feb 2012  Member: #274678  Location: South - Africa
mystran
KVRAF
- profile
- pm
- e-mail
- www
PostPosted: Thu May 10, 2012 10:55 am reply with quote
Ichad.c wrote:

In your honest opinion, what is the most overlooked components in moddeling analog distortion?


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


//double tanh
a = tanh(x);
out = a /((a*a)+1);

//note control the (a*a)level with an envelope follower for some dynamic fun.


Andrew
^ Joined: 08 Feb 2012  Member: #274678  Location: South - Africa
Ichad.c
KVRist
- profile
- pm
- e-mail
- www
PostPosted: Thu May 10, 2012 11:03 am reply with quote
mystran wrote:


Feedback.


Could you maybe give a simple example?

Andrew
^ Joined: 08 Feb 2012  Member: #274678  Location: South - Africa
mystran
KVRAF
- profile
- pm
- e-mail
- www
PostPosted: Thu May 10, 2012 11:28 am reply with quote
Ichad.c wrote:
mystran wrote:


Feedback.


Could you maybe give a simple example?

Andrew


What I mean that practically any interesting distortion whatsoever (including any amplifier really) typically has plenty of (usually) frequency dependent feedback going on.

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


Okay, my emphasis is on the practical - so you suggest:

 input+feedback->non-linear-gain->output

 feedback = -(clip(output)->Lowpass filter)

Would that be correct?
^ Joined: 08 Feb 2012  Member: #274678  Location: South - Africa
camsr
KVRAF
- profile
- pm
PostPosted: Thu May 10, 2012 3:41 pm reply with quote
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 Smile
----
^ Joined: 16 Feb 2005  Member: #58183  
Ichad.c
KVRist
- profile
- pm
- e-mail
- www
PostPosted: Fri May 11, 2012 4:14 am reply with quote
camsr 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 Smile


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 feedback Shocked Shocked Shocked

Anybody with an example?
^ Joined: 08 Feb 2012  Member: #274678  Location: South - Africa
mystran
KVRAF
- profile
- pm
- e-mail
- www
PostPosted: Fri May 11, 2012 5:09 am reply with quote
Ichad.c wrote:
camsr 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 Smile


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 feedback Shocked Shocked Shocked


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.

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).
----
<- my plugins | my music -> @Soundcloud
^ Joined: 11 Feb 2006  Member: #97939  Location: Helsinki, Finland
Urs
KVRAF
- profile
- e-mail
- www
PostPosted: Fri May 11, 2012 5:48 am reply with quote
Ichad.c wrote:
camsr 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 Smile


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 feedback Shocked Shocked Shocked

Anybody with an example?

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

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.
^ Joined: 07 Aug 2002  Member: #3542  Location: Berlin
Ichad.c
KVRist
- profile
- pm
- e-mail
- www
PostPosted: Fri May 11, 2012 2:04 pm reply with quote
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
^ Joined: 08 Feb 2012  Member: #274678  Location: South - Africa
aciddose
KVRAF
- profile
- pm
- e-mail
- www
PostPosted: Fri May 11, 2012 2:48 pm reply with quote
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?


not for ideal opamps under regular conditions. not all opamps though are ideal and so also are the conditions they operate under.

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.
^ Joined: 07 Dec 2004  Member: #50793  
All times are GMT - 8 Hours

Printable version
Page 2 of 3
Goto page Previous  1, 2, 3  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