Convolution with audio system toolbox
조회 수: 19 (최근 30일)
Hi all, i'm trying to use the audio system toolbox to turn one of my scripts into a VST. The plugin needs to take an impulse response in the form of an array and convolve it with the given input samples. When I implement this with conv(a,b) I get an output frame size larger than the input frame size (2). Do I need to implement a circular buffer to fix this, if so how could this be done?
Gabriele Bunkheila 2017년 11월 1일
I thought I'd capture a quick update on this topic as R2017b has already been out there for a few weeks. With the latest release, DSP System Toolbox now includes a new dsp.FrequencyDomainFIRFilter System object, which audiopluginexample.FastConvolver is now using under the hood. If you need fast convolution using partitioned frequency-domain filtering you can now use dsp.FrequencyDomainFIRFilter directly.
The new object includes both overlap-add and overlap-save methods, it has a property to report algorithmic latency as a function of the partition length used, and it comes with a block equivalent to use with Simulink.
Give it a try if you get a chance and let us know what you think!
Gabriele Bunkheila 2018년 11월 21일
You are right indeed - currently I see no plug-and-play solution to share the FFT of the input signal across many instances of dsp.FrequencyDomainFIRFilter. Yours is good feedback and we'll take into account for enhancements in future releases.
For the time being, I suggest:
- Using multiple separate instances of dsp.FrequencyDomainFIRFIilter first and quantify how big of a performance problem you really have. Beyond the built-in tools like tic, toc , timeit, or and the MATLAB Profiler, I also suggest taking a look at the approach used in the example Measure Performance of Streaming Real-Time Audio Algorithms
- If needed, take a look inside dsp.FrequencyDomainFIRFilter to inspire yourself for an improved version. All the code should be open and visible, so hopefully it shouldn't take long if you only need one specific operating mode