[LAD] simulating analog audio devices

Pieter Palmers pieterp at joow.be
Fri Jun 1 09:05:52 UTC 2007


Pieter Palmers wrote:
> Erik de Castro Lopo wrote:
>> Robin Gareus wrote:
>>
>>> hey LADs.
>>>
>>> For those of you who have not followed the 'fuzztone' thread on LAU. I'd
>>> like to announce a /cool hack/ to ngSpice that provides soundfile I/O
>>> capabilities. - it's more a LAD than a LAU issue anyway.
>>
>> This is a CoolAsAllFsck (tm) hack as far as I am concerned.
>> Congrats.
>>
>>> Simple tests sound rather promising; but my fuzztone experiment is not
>>> really satisfying yet. well, maybe it's just meant to sound *that* weird
>>> ;)
>>
>> I used Spice as part of my engineering degree and also in jobs later, 
>> but my memory of this is definitely hazy.
>>
>> However, my memories of how spice works is my discretizing the
>> differential equations that describe the components. I believe
>> the specification of the time step determines how fine grained
>> (in time) a grid will be used for operating on the diff equations.
>>
>> One thing you might have missed is matching up the samplerate of
>> the input file with the time grid of the spice calculations. You alos 
>> want to be *really* careful about how you interpolate
>> the file data to spice sample rate. Please, please, please, do
>> not use linear interpolation. Secret Rabbit Code is probably the way 
>> to go here.
> 
> All spices I use (although this excludes ngspice) have an option to 
> force them to calculate the response at specified timesteps (along with 
> the ones they need for accuracy). In this case it seems obvious to set 
> this timestep to 1/Fsample. Then use only the values at these timesteps. 
> This is way better than interpolation because the differential equations 
> are actually solved at these points.

Also worth to mention is that as far as my experience goes, you need to 
crank up the precision quite a lot to make sure that the 'signal vs 
simulation noise' is more than 100dB.

Pieter



More information about the Linux-audio-dev mailing list