[LAD] simulating analog audio devices

Erik de Castro Lopo mle+la at mega-nerd.com
Fri Jun 1 10:03:08 UTC 2007


Robin Gareus wrote:

> hehe, right. ATM i don't interpolate at all.
> The input just stays for the duration of the sample.

Thats called zero order hold:

    http://en.wikipedia.org/wiki/Zero_Order_Hold

and is a really crappy sound sample rate converter. Signal to noise
ratio is about 10dB.

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

No, not really.

When Spice loads the libsndfile component, can the component find out
the inter-sample period used by Spice? If so, the best solution would
be to use the Rabbit to up sample to that inter-sample period.

If the above is not possible, I suggest that you up sample the audio 
by say 128 times and then linearly interpolate to get whatever inter
sample values you need.

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

I suspect that using 0.01/Fsample will give you a result much closer
to the real device. I suspect that what you get at 1/Fsample produces
results that may not match reality.

Erik
-- 
-----------------------------------------------------------------
Erik de Castro Lopo
-----------------------------------------------------------------
"Islam makes it incumbent on all adult males, provided they are not disabled
or incapacitated, to prepare themselves for the conquest of countries so that
the writ of Islam is obeyed in every country in the world."
-- Ayatollah Khomeini



More information about the Linux-audio-dev mailing list