This example shows how to visualize the magnitude response of a tunable filter. The filters in this example are implemented as audio plugins. This example uses the
audioTestBench functionality of the Audio Toolbox™.
Audio Toolbox provides several examples of tunable filters that have been implemented as audio plugins:
All of these example audio plugins can be used with the
visualize function in order to view the magnitude response of the filters as they are tuned in real time.
Any audio plugin can be tuned in real time using
audioTestBench. The tool allows you to test an audio plugin with audio signals from a file or device. The tool also enables you to view the power spectrum and the time-domain waveform for the input and output signals.
audiopluginexample.LowpassIIRFilter are the simplest of the six examples because the code is written so that the visualization is updated only when data is processed by the filter. Create the audio plugin, then call
hpf = audiopluginexample.HighpassIIRFilter; visualize(hpf) audioTestBench(hpf)
Note that moving the cutoff frequency in
audioTestBench does not update the magnitude response plot. However, once the 'Run' (or play) button is pressed, you can see and hear the changing magnitude response of the filter as the cutoff frequency is tuned in real time.
visualize functions which update the magnitude response plot even when not processing data. The visualization is also updated in real time once audio is being processed.
audioTestBench('-close') varfilter = audiopluginexample.VarSlopeBandpassFilter; visualize(varfilter) audioTestBench(varfilter)
audiopluginexample.ParametricEqualizerWithUDP illustrates how to visualize individual sections in a 3-section biquad filter along with the overall response of the 3 sections combined.
audioTestBench('-close') equalizer = audiopluginexample.ParametricEqualizerWithUDP; visualize(equalizer) audioTestBench(equalizer)