VCX. Equalizer

Subscribe to RSS news feed

Describes how to implement equalizer in your application using Visual Studio (C# or Visual Basic .NET).


Binary : sample_equalizer.zip
C#: sample_equalizer_source_csharp.zip
VB.NET: sample_equalizer_source_vbnet.zip

Setup

Select a sound card. Press the Start/Stop buttons to start/stop playback. Use a slider to adjust the corresponding frequency band volume.

Click for full sized image

Programming background

In this demo the Equalizer component is placed in the way of WaveIn > WaveOut.

1) Configure frequency bands.

Equalizer.NumBands property indicates the number of frequency bands. The exact frequency range for each band is calculated either automatically:

Equalizer.FreqAssignMode = unafam_powerOf2

...or manually:

Equalizer.FreqAssignMode = unafam_manual, call the Equalizer.SetFrequency method to define the frequency bands.

2) Change volume.

Every time you change a slider position, call the Equalizer.SetGain method to change the volume of the corresponding frequency band.

Gain values should be in the range: -10 dB... +10 dB

Equalizer component reference

Physics background

The equalizer comprises a sequence of bell-shaped 2nd-order filters. Each of them is used to amplify or attennuate the signal in the respective frequency range:

Click for full sized image

The following graph represents the frequency response of one band (3 kHz) for different gains:

Click for full sized image