[LAD] simulating analog audio devices

Robin Gareus robin at gareus.org
Fri Jun 1 09:47:55 UTC 2007



Pieter Palmers wrote:
> 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.

hehe, right. ATM i don't interpolate at all.
The input just stays for the duration of the sample. - there might even
be some rounding issues here as ngSpice stores the time in (double)
seconds.

Can I feed the rabbit at irregular intervals: ie. specify time and sample?

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

So far I've only found the command to set the *maximum* time-step, not
an option to enforce it. - setting it to 1/Fsample is ok. setting it to
  0.25/Fsample and using only about every 4th value gives much better
results..  using 0.01/Fsample makes me fetch a few more coffees;

robin





More information about the Linux-audio-dev mailing list