(Although the illustrations are taken from a Windows 95 environment,
the comments apply equally to Windows 3.1)
The
main choices in the filter program are selected from the File
menu. Filter Type offers a sub-menu (which can also be quickly
accessed using a right mouse click) allowing you to select the type of
filter you require. Graphic Equaliser is separated from the
rest as it is operated in a slightly different way.
Low Pass and High Pass options are effectively
inverses of each other, and therefore offer similar parameter choices.


The Scale in dB checkbox controls the way in which the
computed frequency response is shown. The default option is to display
using a logarithmic (dB) vertical scale: un-checking it lets you see the
response in linear form.
Use window is the other default - it applies a Hamming
window to the filter to improve both the in-band ripple response and the
out-of-band rejection ratio.
Number of filter taps allows you to select the number
of coefficients used to create the filter. It is always odd, and can be
set between three and four hundred and ninety nine. Generally you will
want to keep the number of taps as low as possible (while the filter still
meets your specification) to increase the speed of the final filter.
Sample rate is er… the sampling rate! The sampling rate
and corner frequencies scale with each other (so the same filter is generated
for a 22050 sample rate and 5000 corner frequency, and a 44100 sample rate
and 10000 corner frequency) but it is convenient to be able to define the
exact frequencies you will be using and not have to bother with the scaling.
Corner frequency defines the point at which the frequency
response drops to -6dB relative to the maximum pass band response. Note
that the responses are always scaled to show 0dB as the pass band maximum.


Band Pass and Band Stop are again logical
inverses of each other. The only difference is that instead of a corner
frequency, you have instead a centre frequency to mark the centre of the
pass (or stop) band, and a Width entry which sets the gap between the -6dB
points. As an example, in the examples shown above, the -6DB points are
at 5012Hz and 6012Hz.

The Graphic Equaliser is operated in a slightly different
way from the preceding options. All the other options have no user input
once the parameters have been set, but this selection requires you to define
the frequency response you require. The only parameters you can change
at this point are whether or not you use a window, and the number of filter
coefficients. The scaling of the display is automatically returned to logarithmic
(dB).
After the 'OK' button is pressed, you are presented with a flat response
curve:

The straight line is the response which the filter will try to track.
The black squares are handles which you can use to move the line - left
click on a handle and drag to a new position. When the left button is released
the filter response is re-calculated. To add another handle, left click
on the line. You'll notice that the cursor tracks the frequency and the
level as you move. After you've defined a few points you'll see that the
program has begun to track the response. The more filter taps you select,
the better the tracking will be. You can have a maximum of twenty one handles.

If you need to remove a handle, right click on the handle and you'll
be offered a sub-menu with a choice: either remove the handle on which
you've clicked, or remove all the handles and restore to a flat response.
The other options offered by the File menu are Open
Filter and Save Filter. These allow you to save and
load named filters. Because this is a sixteen bit application, the normal
8.3 file names apply, rather than the long filenames available in Windows
95.
There are two files which are saved: one with an '.inc' extension which
can be used as a C++ include file (and which is loaded back into the program
on an Open Filter), and a simpler binary file which can be used directly
as data by a program. This is a sample of the '.inc' file:
// digital filter parameters
// filename: DEMO.INC
// type 4 <user defined>
// filter taps: 21
// sampling frequency: 22050
// Handles: 4 100 0 58 23 96 53 55 100
#define DEMOTaps 21 static int DEMOCoeffs[21] = {
0, // 0.00000010
155, // 0.00475310
412, // 0.01258510
487, // 0.01488610
165, // 0.00506110
834, // 0.02547110
2704, // 0.08254810 etc…
When you include the file, two variables become visible: the defined
xxTaps, and a static array xxCoeffs[], where xx is the name of the file
(always in capitals). The array contains the 16 bit signed values of the
coefficients, with the decimal fractions commented. Note that the commented
parts are used by Filter when a file is loaded.
A second file is also saved, this time with the file type '.fir'. Here,
the format is simpler: it is a binary file intended to be read by a program
(say as a command line parameter). It consists of sixteen bit integer values,
the first one being the number of coefficients and the remainder the coefficients
themselves. The integers follow normal Intel format, low byte first.