Tag Archives: audio-programming

Time Varying BIBO Stability Analysis of Trapezoidal Integrated Optimised SVF v2

In November 2013 I posted a draft of “Time Varying BIBO Stability Analysis of Trapezoidal integrated optimised SVF v2” to the music-dsp mailing list.[1] The draft applied Jean Laroche’s state-space method [2] to prove the time varying stability of the SVF filter that Andy Simper had recently derived using trapazoidal integration.[3] I didn’t quite finish the stability proof. You can read the discussion in the mailing list thread to see how close we got.

I recently learnt that Aaron Wishnick had completed the stability proof and had also published a number of useful coefficient formulas for the SVF.[4] Aaron kindly cited my partial proof. Thanks Aaron!

For future reference the maxima source file for my draft analysis is now archived on github.

[1] Bencina, R. (2013) “Time Varying BIBO Stability Analysis of Trapezoidal integrated optimised SVF v2,” music-dsp mailing list, Nov. 2013, Available at www.mail-archive.com/music-dsp@music.columbia.edu/msg02467.html

[2] Laroche, J. (2007) “On the Stability of Time-Varying Recursive Filters,” J. Audio Eng. Soc., vol. 55, no. 6, pp. 460-471, June 2007.

[3] Simper, A. (2013) “Solving the Continuous SVF equations Using Trapezoidal Integration and Equivalent Currents,” Nov. 2013, Available at www.cytomic.com/files/dsp/SvfLinearTrapOptimised2.pdf

[4] Wishnick, A. (2014) “Time-Varying Filters for Musical Applications” Proc. of the 17th Int. Conference on Digital Audio Effects (DAFx-14), Erlangen, Germany, September 1-5, 2014. Available at www.dafx14.fau.de/papers/dafx14_aaron_wishnick_time_varying_filters_fo r_.pdf

Interfacing Real-Time Audio and File I/O

Q: How to stream audio data to/from a file in real-time without glitching?

It’s a question that comes up on the PortAudio mailing list from time to time.

I’ve just published a paper on the use of message passing and lock-free queues to implement real-time-safe asynchronous file I/O. The paper presents one method for interfacing between real-time client audio streams and an I/O server thread. The paper will be of interest to developers wanting to implement their own real-time file streaming code. It also describes a number of lock-free tricks that are generally useful for real-time audio programming. In addition to the paper there are slides, an animation, and example source code linked below. Here’s the abstract:

Programming a computer to record or play a sound file in real-time is not as easy as it may seem. The naive approach is to call file I/O APIs from within the routine that handles real-time audio I/O. This leads to audible glitches whenever the time taken to access a file exceeds the time available to deliver a buffer of real-time audio. This paper describes an approach to streaming file playback and recording that operates correctly under these conditions. It performs file I/O in a separate thread, buffers audio data to mask file I/O delays, and uses asynchronous message passing and lock-free queues for inter-thread communication.

The full reference for the paper is:

Bencina, R. (2014) “Interfacing Real-Time Audio and File I/O,” Proceedings of the 2014 Australasian Computer Music Conference, ACMC 2014. Melbourne, Australia. July 9-11 2014.

A number of people generously gave feedback on earlier drafts of the paper: Tony Holzner, Scott Brewer, Phil Burk, Andrew Bencina and the anonymous reviewers — thanks guys, I appreciate it, your feedback was invaluable.

Here are links to the paper and supporting materials:

For background reading, you might be interested in these related blog posts:

If you have any questions or comments please feel free to get in touch, either by email, or in the comments below.