Application
note # 9 
Sample
Champion

BUTTERWORTH and CHEBYSHEV IIR digital filter
This
application note describes how to use the Sample Champion Filter
Banks plugin for custom, octave and 1/3 octave filtering.
Figure
1  Filter Banks plugin window
First of all, an impulse response must be measured or loaded
in Sample Champion. The measured or loaded Imulse Response can
be mono (1 channel) or stereo (2 channels).
Now the Filter Banks plugin can be opened (from the "New Measurement"
Window); the dialog in figure 1 will appear.
IEC 1260 Octave Filters
The
plugin implements a complete set of octave bandpass filters,
as specified in the International Standard IEC 1260 (that superseded
the IEC 225 normative). The IIR filter is generated as a 6th
order bandpass Butterworth digital filter, with passband depending
on the selected center frequency. The true frequency response
of the filter is plotted in the graph at the lower right corner
of the plugin.
Filtering
procedure:
Select "IEC 1260 Octave Filter" in the "Filter
Banks" selection and the desired center frequency of the
filter in the "Octave" selection.
For
seeing the result of filtering both in the time and frequency
domains, it can be useful to make a selection of the impulse
response and to open the Frequency domain "FFT of Selection"
window (see Application note #1).
Press "Select All" time domain data.
In
the following examples, a narrow Impulse Response has been used,
in order to have a nearly flat (unfiltered) frequency response.
Figure
2  Unfiltered Impulse Response
Figure
3  Frequency response of the unfiltered Impulse Response represented
in figure 2
Now, to apply the filtering, check "Enable Filtering",
press two times the F5 button and the filtering will be applied.
Figures 4 and 5 present the result, in the time and frequency
domains, of a 1 kHz octave filtering.
Figure
4  Impulse Response of figure 2, after 1 kHz octave filtering
Figure
5  Frequency response of the filtered Impulse Response represented
in figure 4
To
UNDO the filtering, uncheck "Enable Filtering" and
press again two times the F5 button. The UNDO restores the Impulse
Response data present when the plugin had been opened. Once
the plugin is closed, the UNDO function can no longer be applied.
IEC 1260 1/3 Octave Filters
The
plugin implements a complete set of 1/3 octave bandpass filters,
as specified in the International Standard IEC 1260.
Filtering
procedure:
Select "IEC 1260 1/3 Octave Filter" in the "Filter
Banks" selection and the desired center frequency of the
filter in the "1/3 Octave" selection.
The
same procedure of the octave filter case can be followed.
Figures
6 and 7 present the result, in the time and frequency domain,
of a 1 kHz 1/3 octave filtering.
Figure
6  Impulse Response of figure 2,
after 1 kHz 1/3 octave filtering
Figure
7  Frequency response of the filtered Impulse Response represented
in figure 6
Custom Filters
The
plugin allows also creating and applying custom lowpass, highpass
and bandpass BUTTERWORTH
and CHEBYSHEV IIR digital filters.
The parameters of the filter are:
 Filter type (LP, HP or BP)
 Filter prototype (BUTTERWORTH or CHEBYSHEV)
 Filter order (1 to 16, must be even for bandpass)
 Ripple value (in dB, CHEBYSHEV filters only)
 Lowcut and Highcut frequencies
Care
must be taken when the chosen cut frequency is near to 0 or
to the Nyquist frequency because high order filters can lead
to unexpected behaviours. Anyway the graph with the frequency
response of the filter, located
at the lower right corner of the plugin, gives
an immediate description of the result.
Figure
8  Frequency response of the Impulse Response represented in
figure 2, after a 5 kHz lowpass filtering
Figure
9  Frequency response of the Impulse Response represented in
figure 2, after a 5 kHz highpass filtering
For
each generated filter (custom or octave and 1/3 octave presets),
the plugin gives also the complete set of the computed coefficients
of the IIR filter. For example, the following coefficients have
been generated for a 1 kHz octave filter (sampling frequency
48000 kHz):
a[0]:=9,05521705998714E5; 
b[0]:=1;

a[1]:=0; 
b[1]:=5,76516227546357;

a[2]:=0,000271656511799614; 
b[2]:=13,8992002157152; 
a[3]:=0;

b[3]:=17,9364279956002;

a[4]:=0,000271656511799614; 
b[4]:=13,0669125310377; 
a[5]:=0;

b[5]:=5,09546732357597;

a[6]:=9,05521705998714E5;

b[6]:=0,830949423916396; 
They
can be used by other software for filtering time data, using
the following pseudopascal code:
//
InputData[]: array of time data to be filtered
// OutData[]: array of filtered time data
// TempData[]:
temporary time data array
// NumData:
number of time data
// a[], b[]: coefficients generated by the plugin
N:=FilterOrder;
M:=FilterOrder;
fill(TempData,0);
for q:=0 to N do InputData[q]:=0;
for ny:=N+1 to NumData do
begin
s1:=0;
for k:=0 to M do s1:=s1+a[k]*InputData[nyk];
s2:=0;
for j:=1 to N do s2:=s2+b[j]*TempData[nyj];
TempData[ny]:=s1s2;
end;
for
q:=0 to NumData do OutData[q]:=TempData[q];
//

// You are free to use, edit and redistribute this source
// code provided that reference to this site appears
// somewhere in the source code.
// 

Download
PDF file (360K) Shiftclick
to download
Back to Application Notes
