How to model analog circuits to DSP

DSP, Plugin and Host development discussion.
Post Reply New Topic
RELATED
PRODUCTS

Post

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

Post

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

Post

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

Post

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.

Post

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

Post

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.

Post

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).
Its fun or I don't do it.

Post

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

Post

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.

Post

Image

Post

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.

Post

DavenH wrote:Physical modelling from a circuit schematic

Pretty fun thread.
That was a FUN thread? :P

Post Reply

Return to “DSP and Plugin Development”