UNDER CONSTRUCTION

This page includes MATLAB functions and scripts that I have written and used for experimenting with audio signal processing.

This page includes MATLAB functions and scripts that I have written and used for experimenting with audio signal processing.

**Biquadratic Filter Design**

Usage:

**[b,a] = order2Filt(G,f0,Q,fs,type)**

Input:

**G**- gain in dB**f0**- center or corner frequency in Hz**Q**- Q factor (related to bandwidth)**fs**- sampling frequency in Hz**type**- filter type -**'Bass'**for bass shelf,**'Peak'**for peak and**'Treble'**for treble shelf

Output:

**b**- numerator coefficients**a**- denominator coefficients

Description:

Determines the numerator and denominator coefficients of three types of biquadratic filters based on desired values of gain, center or corner frequency, and Q factor. The three types are:

**'Bass'**- bass shelf filter with low-frequency gain**G**and corner frequency**f0****'Peak'**- peak filter with center-frequency gain**G**, center frequency**f0**and Q factor**Q****'Treble'**- treble shelf filter with high-frequency gain**G**and corner frequency**f0**

Note that the Q factor does not apply to the shelf filters and the input

**Q**is ignored for these types. The function also requires the sampling frequency as an input.

For each type, the function first determines the numerator and denominator coefficients of the corresponding analog filter based on well-known, straightforward formulas. The function uses different formulas for gain > 0 dB and gain < 0 dB to enforce symmetry. The function then computes the digital filter coefficients using the MATLAB function

**bilinear**.

The figures below show the frequency response curves for examples of the three filter types.

Source file for

**order2Filt**: /uploads/3/4/7/2/34726384/order2filt.m

**Parametric Equalizer Script**

This script uses MATLAB streaming audio tools to read an audio file, process the audio through a parametric equalizer and play the processed audio while displaying a plot of the magnitude of the equalizer frequency response. The script also provides a GUI with sliders to tune the equalizer parameters.

The script consists of an initialization section, a processing loop and a clean-up section as follows:

Initialization section

- Create an audio file reader object, a biquadratic filter object and an audio player object using functions from the MATLAB DSP system toolbox.
- Initialize the parameter tuning GUI and the frequency response display.

Processing loop

- Check for new tuning parameters and update filter parameters and frequency response display with new parameters.
- Read a block of audio, process it through the filter and play the filter output.

Clean-up

- Delete objects and close GUI and display.

Source file for parametric equalizer: /uploads/3/4/7/2/34726384/rteq.m