How to model analog circuits to DSP
-
Gabriel Simoes Gabriel Simoes https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=118416
- KVRist
- Topic Starter
- 82 posts since 30 Aug, 2006 from Salvador / Ba / Brazil
Hello,
First I'd like to say that I'm sorry if there are already similar threads in the database but searching didn't reveal any for me so I decided to start a new one.
I'm studying DSP right now and I'm focusing on audio DSP but, as I'm graduated in CS and not in EE, I'm facing some difficulties in modeling analog circuits to DSP algorithms ... and I'd like to know if there are resources for this researching in this subject like books, pdfs, websites, etc ...
Thanks for your attention ...
Gabriel Simões
First I'd like to say that I'm sorry if there are already similar threads in the database but searching didn't reveal any for me so I decided to start a new one.
I'm studying DSP right now and I'm focusing on audio DSP but, as I'm graduated in CS and not in EE, I'm facing some difficulties in modeling analog circuits to DSP algorithms ... and I'd like to know if there are resources for this researching in this subject like books, pdfs, websites, etc ...
Thanks for your attention ...
Gabriel Simões
-
- KVRAF
- 1743 posts since 3 Dec, 2004
you'll find plenty of info for mapping analog filters, but very little for analog circuits (as this really isn't DSP in the strictest sense of the word).
my sig will go here
-
Gabriel Simoes Gabriel Simoes https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=118416
- KVRist
- Topic Starter
- 82 posts since 30 Aug, 2006 from Salvador / Ba / Brazil
Yes .... for the filters .... it's easy to find stuff about them .... and about fir filters too.
I've found some papers that cover some of the subject but none of them are enought to be a start, or to be posted here.
Well, it's been a hard way to follow, but I will keep trying, and if some of you find anything, please post it here, .... I will do the same because I'm sure I'm not alone in this boat.
Gabriel
I've found some papers that cover some of the subject but none of them are enought to be a start, or to be posted here.
Well, it's been a hard way to follow, but I will keep trying, and if some of you find anything, please post it here, .... I will do the same because I'm sure I'm not alone in this boat.
Gabriel
-
- KVRAF
- 3080 posts since 17 Apr, 2005 from S.E. TN
Hi Gabriel
You could google about SPICE. SPICE is circuit emulation software, and as far as I know there are both commercial and open-source variants, but I know little about it.
I think I recall googling for code one time, and finding at least one site with C code for SPICE emulation of various electronic components. A SPICE circuit would probably run too slow to embed in a realtime plugin, because slavish emulation of certain components would take a lot of cpu time and rather high samplerates, but such code examples might be a source of ideas/education.
You could google about SPICE. SPICE is circuit emulation software, and as far as I know there are both commercial and open-source variants, but I know little about it.
I think I recall googling for code one time, and finding at least one site with C code for SPICE emulation of various electronic components. A SPICE circuit would probably run too slow to embed in a realtime plugin, because slavish emulation of certain components would take a lot of cpu time and rather high samplerates, but such code examples might be a source of ideas/education.
-
- KVRer
- 12 posts since 16 Feb, 2007 from London UK
SPICE can be useful to get an idea about how an analogue circuit behaves, and what effects particular components have, e.g. their non-linearities etc. when you are building a digital version.
You'll need to understand what analogue circuits do, e.g. their frequency response, to know what the digital equivalent is. The mapping between analogue and digital is usually fairly simple. The tricky part is that analogue is limited by distortions, whereas digital is limited by the sample rate. It's the distortions that can sometimes sound good in analogue, so you want to model them, but you need to do this within the limitations of the sample rate and aliasing.
Linear Technology provide a free SPICE simulator, LTSpice:
http://www.linear.com/designtools/software/
It's designed for their products, but it is possible to add models of other circuit components into the simulation if you have specific circuits you want to simulate.
The good thing is that its easy to load a .wav file into the simulation as an input voltage and write a voltage out to a .wav file.
Derby
You'll need to understand what analogue circuits do, e.g. their frequency response, to know what the digital equivalent is. The mapping between analogue and digital is usually fairly simple. The tricky part is that analogue is limited by distortions, whereas digital is limited by the sample rate. It's the distortions that can sometimes sound good in analogue, so you want to model them, but you need to do this within the limitations of the sample rate and aliasing.
Linear Technology provide a free SPICE simulator, LTSpice:
http://www.linear.com/designtools/software/
It's designed for their products, but it is possible to add models of other circuit components into the simulation if you have specific circuits you want to simulate.
The good thing is that its easy to load a .wav file into the simulation as an input voltage and write a voltage out to a .wav file.
Derby
-
- KVRAF
- 3080 posts since 17 Apr, 2005 from S.E. TN
Anything in analog with feedback tends to be cpu-intensive to slavishly model. Since a negative-feedback analog system can achieve rather complex mult-component-interaction 'homeostasis' almost instantly-- if directly trying to digitally model such a circuit, I think one would have to use a very high sample rate, but perhaps there is some shortcut.
There are so many discrete-component audio circuits which incorporate multiple feedback paths.
And then there is the opamp, where almost all opamp circuits involve high gain and heavy feedback. And so many common analog audio devices' circuit boards look like miniature cities full of opamps. Scads of them. High-precision high-samplerate emulation of so many inter-connected opamps I think would take a lot of calculation.
So once one knows what the target analog circuit does, its probably a good idea to find a way to do something with equivalent results but different methods in an practical digital version.
There are so many discrete-component audio circuits which incorporate multiple feedback paths.
And then there is the opamp, where almost all opamp circuits involve high gain and heavy feedback. And so many common analog audio devices' circuit boards look like miniature cities full of opamps. Scads of them. High-precision high-samplerate emulation of so many inter-connected opamps I think would take a lot of calculation.
So once one knows what the target analog circuit does, its probably a good idea to find a way to do something with equivalent results but different methods in an practical digital version.
-
- KVRer
- 2 posts since 9 Apr, 2007
To clarify your query:
Do you wish to model analog circuits in your computer, or;
Do you wish to map analog circuits to digital implementations?
Could you provide a list of the types of audio circuits you care about? (amps, equaizers, effects generators, etc).
Do you wish to model analog circuits in your computer, or;
Do you wish to map analog circuits to digital implementations?
Could you provide a list of the types of audio circuits you care about? (amps, equaizers, effects generators, etc).
Its fun or I don't do it.
-
Gabriel Simoes Gabriel Simoes https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=118416
- KVRist
- Topic Starter
- 82 posts since 30 Aug, 2006 from Salvador / Ba / Brazil
In the end ... all I wish to know, study and be able to do is to model analog circuits and frequency response or amplifiers, cabnets, mics, audio processors, etc ...
-
- KVRer
- 2 posts since 9 Apr, 2007
AUTO-ADMIN: Non-MP3, WAV, OGG, SoundCloud, YouTube, Vimeo, Twitter and Facebook links in this post have been protected automatically. Once the member reaches 5 posts the links will function as normal.
So what you appear to need is asuite of tools that can assist you in different ways. Spice has already been mentioned and is fine for modeling the analog electronics. You might look at SciLab (www.scilab.org (http://www.scilab.org)) which is a free analysis tool with capabilities much like MatLab. It includes Scicos (similar to Simulink) that can be used to dirrectly model hybrid designs (analog and digital)as well as things like microphone patterns and case design (though I personnaly cannot help with much of the later). I'd aquaint myself with these tools first then start posting how-to queries for specific issues.Its fun or I don't do it.
- KVRian
- 759 posts since 10 Aug, 2004 from Fredericton NB
-
- KVRian
- 1000 posts since 1 Dec, 2004
In general, you don't usually want to directly model analog circuits. To simulate how they work, you'd probably have to use a sample rate in the megahertz range, especially stuff like Op-amps. This would use up ridiculous amounts of CPU. See what JCJR said.
So in practice, you have to emulate the result, instead of the raw components. The same applies to physical models of real instruments: you can try to simulate stuff with nets of points joined by springs, but the result is usually kinda disappointing. The better way is actually to start up with a roughly optimal model (waveguides for most string and wind instruments for instance) and work in the specificities of what you're trying to model. This not only takes less cpu, but usually ends up sounding better anyways. (because you're concentrating on modelling stuff you can hear, rather than stuff you can't hear)
I'm not a specialist of analog stuff at all, but the same approach probably applies. Some "dumb" stuff like voice stealing, slow enveloppes and such seem to contribute to the analog sound. You'll probably want to look into that.
So in practice, you have to emulate the result, instead of the raw components. The same applies to physical models of real instruments: you can try to simulate stuff with nets of points joined by springs, but the result is usually kinda disappointing. The better way is actually to start up with a roughly optimal model (waveguides for most string and wind instruments for instance) and work in the specificities of what you're trying to model. This not only takes less cpu, but usually ends up sounding better anyways. (because you're concentrating on modelling stuff you can hear, rather than stuff you can't hear)
I'm not a specialist of analog stuff at all, but the same approach probably applies. Some "dumb" stuff like voice stealing, slow enveloppes and such seem to contribute to the analog sound. You'll probably want to look into that.
-
AdmiralQuality AdmiralQuality https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=83902
- Banned
- 6657 posts since 10 Oct, 2005 from Toronto, Canada
That was a FUN thread?