May 10th 2011
A few days ago, I’ve released my first VST plugin. Now it is time to analyze how it works.
The block is really straightforward:
The oversampled signal is only used for the overdrive, and it composes more than half of the plugin code.
Oversampling impact on spectral content
To analyze the effect of the oversampling, I feed inside the plugin a sinesweep at 96kHz and then I draw a spectrogram of both the input and the output signal.
If only a 2x oversampling is used, the audio frequency band is filled with alias, which is definitely not good..
The 8x oversampling has only a some alias in the high frequency sine sweep. It is thus far better than the 2x oversampling.
Finally, the 32x oversampling is almost perfect. It still has some background noise for the high frequency sine sweep.
Profiling with 8x oversampling
First, some timings. On my laptop with Ubuntu, the test case (2 millions samples for a sin sweep at 96kHz) takes 17s with a 2x oversampling, 20s for a 8x oversampling and finally 54s for an 32x oversampling. On Windows, those timings are respectively 14s, 22s and 63s.
The profil shows that the main cost is due to the exponential function. It is used because two diodes are used in the analog model of this overdrive. A circuit with no exponential would be faster, but it is the diode’s behavior that is caracteristic of this sound.
Clearly, going from an 8x to 32x oversampling is far more costly than from 2x to 8x. 8x seems a good compromise between performance and quality. 32x may only be used for offline rendering.
I’ve made a small presentation on this subject that is available on SlideShare.
9 Comments »