), then imported to WaveWarp via a simple dialog box
(refer to the
WaveWarp Users' Guide
for
a detailed description of the specific FIR structure implemented in WaveWarp, and the
associated ASCII file format for storing the coefficients). For MATLAB users in
particular, the "wwmatlab" sub-directory of the WaveWarp root directory contains
the necessary function m-files (plus example scripts) for exporting
filters from MATLAB, enabling the seamless integration of
MATLAB's powerful filter design tools with WaveWarp's real-time audio engine.
Likewise, m-files are supplied for importing filters designed by WaveWarp into MATLAB
for off-line analysis (refer to the
WaveWarp Users' Guide
for
a summary of all bundled m-files for working with MATLAB
in a variety of areas in addition to digital filter design).
Notes on terminology: a band-pass filter allows a band of frequencies (the "pass-band")
to pass through, while attenuating frequencies above and below this pass-band.
Denoting the lower and upper edge frequencies of the pass-band as fpass L and
fpass U, respectively, the pass-band thus spans the range from fpass L to fpass U.
Ideally, the two corresponding "stop-bands" would consist of all frequencies below fpass L
and above fpass U, respectively. However, no filter is ideal, and
there will always be finite "transition bands" between the stop-band(s) and pass-band(s).
In the case of the band-pass filter, these can be described in terms of the
stop-band edge frequencies fstop L and
fstop U such that the lower stop-band extends from 0 to fstop L,
followed by the lower transition band from fstop L to fpass L,
followed by the pass-band,
then the upper
transition band from fpass U to fstop U,
and then the upper stop-band
from fstop U to the Nyquist frequency, fNyq (defined as half the sample rate) which
is the maximum possible frequency for a digital filter (by contrast, an analogue filter can, in principle, extend to
infinity!)
Furthermore, a practical filter will never completely attenuate
the amplitude of the signal within the stop-band(s), nor will it allow the signal
within the pass-band(s) to pass through unscathed. Instead,
the stop-bands will be attenuated by a finite gain factor,
denoted G stop (for the present band-pass filter designs, the same gain for both stop-bands), and the pass-band
will be scaled by a gain factor, denoted G pass, which would ideally be equal to unity.
(By convention, all gain factors are
expressed in decibels defined as: G dB = 20 log10 G.)
For the built-in band-pass filter design option, the filter specifications (in terms of
fstop L, fpass L, fpass U, fstop U,
G stop and G pass)
are adjustable via the
Parameter Window, as summarised in the following table.
IMPORTANT: Owing to the complexity of the calculations involved, the filter re-design can take
a significant amount of time (seconds to minutes), hence the sliders are automatically disabled when the
DrawingBoard is playing
in order not to interfere with the real-time audio process. Likewise, depending on the component settings
when saved
on a DrawingBoard, the DrawingBoard may take a significant amount of time to re-load.
| Parameter | Purpose |
| "FIR Design method" buttons | Selects the built-in filter design
method. If "Load filter design from file" is selected, any arbitrary FIR filter may be imported from an ASCII file,
not just
a band-pass design. |
| "Lower stop freq" slider | Adjusts fstop L
within the allowable range from 0 to fNyq, and re-designs the filter. |
| "Lower pass freq" slider | Adjusts fpass L
within the allowable range from fstop L to fNyq, and re-designs the filter. |
| "Upper pass freq" slider | Adjusts fpass U
within the allowable range from fpass L to fNyq, and re-designs the filter. |
| "Upper stop freq" slider | Adjusts fstop U
within the allowable range from fpass U to fNyq, and re-designs the filter. |
| "Stop gain" slider | Adjusts G stop, and re-designs the filter |
| "Pass gain" slider | Adjusts G pass, and re-designs the filter |
| "Magnitude Response Plot" | Displays the filter magnitude response
corresponding to the chosen design parameters. The magnitude scale can be switched between linear or logarithmic; the frequency scale can be
expressed in hertz or normalised to fNyq. |
| "Phase Response Plot" | Displays the filter phase response (unwrapped)
corresponding to the chosen design parameters. The frequency scale can be
expressed in hertz or normalised to fNyq. |
| "Output gain" slider | Adjusts the amplitude of the output signal. |
| "Save filter design to file" dialog | Exports the
filter coefficients to an ASCII file for off-line analysis or for future import
by another FIR filter component. |
Notes on filter design:
The Digital Filters
category of the Component Library contains FIR (direct convolution), FIR (fast convolution), and IIR
implementations for general-purpose filtering
(see
[OpSc]
for an introduction to digital filtering,
[Roa]
and
[Zo]
for discussions specific to audio applications, and
[MAT2]
for filter design examples in MATLAB.
).
The following guidelines should be kept in mind when choosing
a filter:
In order to achieve narrow transitions, high
stop-band attenuation, or selective filtering at low frequencies,
longer filters are required, with consequent
cost in CPU usage.
A rule-of-thumb when using the WaveWarp FIR filters is that
if the required length exceeds approximately 100
for a desired set of requirements, it is more efficient to use the fast convolution implementation of
the filter (denoted
"(FFT)"
in the
Component Library), rather than the direct
convolution implementation (the results are identical except for an additional latency associated with
the FFT method). Another option is to use a
recursive (IIR) design which generally requires a significantly shorter filter for
the same design specifications. The drawback of the IIR approach is the non-linear phase distortion inherent to
the method. By contrast, FIR filters exhibit linear phase distortion (the contrast is readily apparent
by comparing the
"Phase Response Plots", displayed in the Parameter Windows, for the two methods: an FIR
plot is characterised by straight-line segments, whereas an IIR plot is generally highly curved.) The audio
consequences can be significant: the FIR linear-phase distortion is virtually inaudible since all
frequencies are, in essence, "delayed by the same amount". This makes FIR filters the preferred
choice for many audio applications.
The IIR non-linear-phase distortion,
by contrast, can have a significant effect on the perceived sound, depending on the
spectral and temporal nature of the underlying audio material.
The suitability of the chosen filtering method therefore
depends on the specific application. Trial-and-error experimentation is often the best course of action.
If the application specifically requires selective filtering at low frequencies, it is recommended to
employ multirate techniques, whereby the signal is downsampled before filtering.
The Multirate
category of the Component Library contains a wide range of downsamplers (and upsamplers) for this purpose.
All WaveWarp components automatically adapt to the sample rate of the incoming signal, so it is straightforward
to connect a digital filter component after a downsampler in order to realise the significant performance
gains inherent to multirate techniques
(refer to the
WaveWarp Users' Guide
for more information on WaveWarp's multirate signal processing functionality; and see
[CrRa]
and
[StNg]
for a detailed treatment
of multirate filtering.)
Algorithm
The "windowing" method is used to design the FIR filter (see
[OpSc]
section 5.5), and direct convolution
is used to implement it.
Signal Implementations
| Audio signals | Control signals | Description |
| Single input single output mono-mono | n/a | The mono audio input is filtered and sent to the mono audio output. |
| Single input single output mono-stereo | n/a | The mono audio input is filtered and sent (in duplicate) to the stereo audio output channels. |
| Single input single output stereo-mono | n/a | Each audio input channel is filtered separately (but with the same filter coefficients). The filtered channels are then averaged and sent to the mono audio output. |
| Single input single output stereo-stereo | n/a | Each audio input channel is filtered separately (but with the same filter coefficients) and sent to the separate stereo output channels. |
Related components:
Example DrawingBoards illustrating usage:







