FIR Filter Plugin 1.0.0 review

Download
by rbytes.net on

FIR filter Plugin is an effect plugin for XMMS which enables to filter audio data using long FIR (finite impulse response) filters

License: GPL (GNU General Public License)
File size: 205K
Developer: Fredrik Lingvall
0 stars award from rbytes.net

FIR filter Plugin is an effect plugin for XMMS which enables to filter audio data using long FIR (finite impulse response) filters. Typical applications is loudspeaker or room equalization which typically requires filters with more than 300 taps (filter weights).

The FIR filter plugin uses the fftw3 library to perform the filtering using the overlap-and-add method. If fftw3 is not available the plugin will perform the filtering (convolution) in the time-domain which is much less efficient for long filters.

Requirements:
XMMS
fftw3

Usage:

Open the preferences in xmms (CRTL-P) and select the Effect Plugins tab. Then enter the path to your filter coefficients file in the "Filter coefficients file" field and press "Apply" or "Ok" button. There is also a Filter Gain control where you can adjust the filter gain from 0.1 to 9.9 where 10 equals a gain of 1 (= 0 dB) on the of the scale of the Gain control (this is just a quick hack and I will change this to dB in the future).

Note if the filter gain is too high the audio signal may be clipped when the audio-data is converted from floating-point to PCM data.

I recommend that you analyze the filter in a tool like Octave (http://www.octave.org) or Matlab (http://www.mathworks.com). Below are some Octave/Matlab code that can be
helpful:

load test_filter.dat -ascii
N = length(test_filter);
hf = fft(test_filter);
F_max = floor(N/2);

% Linear scale.
plot(abs(hf(1:F_max)))

% dB scale
%plot(20*log10(abs(hf(1:F_max))))

grid on

where it is assumed that the filter is stored in a text file 'test_filter.dat'.

To save a filter stored in a vector 'h_test' you can use the following code:

% Convert to a column vector.
h_test = h_test(:);

save -ascii new_filter.dat h_test

Where the filter is stored in the file 'new_filter.dat'. Note that Octave adds some comments in the beginning of the file which must be removed before the file is loaded into the plugin.

Note also that both Matlab (commercial) and Octave (freeware) contain various tools for constructing and analyzing filters (use the help command).

4 Filter file format

The filter file is just a text file with the filter taps in floating point format as shown below:

2.0304631e-02
3.9518374e-03
2.0784791e-02
3.3525805e-04
2.6293676e-02
-4.2205674e-03
3.7765046e-02
-1.8379669e-02
.
.
.

4.0472156e-02
-3.7814379e-03
1.4853832e-02
1.9319599e-02
-1.0653724e-02
5.0622926e-02
-4.0788844e-02
8.7126686e-02
-6.7932979e-02
1.0638913e-01

Known Issues

The plugin can currently only read one filter so the same filter is used for both the left and the right channel.

There is no error checking when reading the filter file. It is assumed that the filter weights are stored column wise in a text file.

FIR Filter Plugin 1.0.0 keywords