Digital Filtering: low-pass, high-pass, band-pass and spectrum filters

From STX Wiki
Jump to navigation Jump to search

Digital filters provide convenient tools for almost all signal manipulation in the frequency domain. The theory behind digital filtering is beyond the scope of this manual. If you are interested in further reading, you can start with Steven Smith's 'The Scientist and Engineer's Guide to Digital Signal Processing'.

In short, however, STx's digital filter introduces into the source signal (primitive) both desired and side effects. All users are advised to apply filtering on copies of their original signals only and to control the filtering carefully by means of STx spectral analysis tools such as Spectrogram & Parameters Viewer as well as spectral averaging. If you do wish to filter the original signals, you are encouraged to examine the test results by listening. Auditory control still provides a fast and convenient way to detect filter mistuning or distortion.

Digital filters simulate the transducer behaviour of analogue filters to a large extend. They introduce relatively small insertion loss to waves in one or more frequency bands and relatively large insertion loss to waves of other frequencies.

The settings Source Signal and Target Signal are explained here.

Analysis and Synthesis Method

Ws dsp filter analysis method.png

STx filter types can be selected from the following methods:

  • Wiener filter with no overlapping
  • Wiener filter with half overlapping
  • Phase Vocoder

For all of the filter types the length of the filter, which determines the frequency bin resolution, can be specified in samples or in ms.

Time Scale Modification (TSM)

Expansion and compression in the time domain can also be achieved using the Phase Vocoder Analysis/Synthesis method.

Either choose the Input / Output Shift with different analysis and shift values

Ws dsp time scale modification.png

or choose the Time Factor, selecting Expand or Collapse and the desired factor.

Ws dsp time scale factor.png

Time expansion can be useful in zooming in on fast transients, which cannot be perceived analytically at normal speed. A time expansion factor of 2 or 4 has proved to be appropriate for many music and speech applications.

If you only wish to compress or expand the signal, select the Band-pass setting Bypass with an amplitude of 1.

The window function and mode (normal, dual or tight) can also be set.

The time scale modification setup shown fits for a sampling frequency of 44100 Hz. In case of lower/higher sampling frequencies the filter length as well as the Input/Output shift has to be adapted accordingly. Currently integer divisors of the power of two FFT-lengths are applicable only.By default STx time scale modification supports integer ratios (1:2, 2:1..) only. Non-integer ratio TSM can be provided on request.

High-pass filter

The high-pass filter has a single transmission band which ranges from F1, some band-edge frequency greater than zero up to the half of the sampling frequency, F2.

Band-pass filter

Ws dsp filter bandpass.png

The band-pass filter has a single transmission band which ranges from a lower band-edge frequency F1 > 0 to an upper band-edge frequency F2 < sampling frequency/2.

Low-pass filter

The low-pass filter has a single transmission band which ranges from F1 near to 0 Hz to some upper band-edge frequency, F2 < sampling frequency/2.

Band-stop filter

Ws dsp filter bandstop.png

Suppresses the range of frequencies between F1 and F2.

Comb(pass) / Comb(stop)

A comb filter with pass bands or stop bands.

Parameters

The comb filter supports the following parameters:

F1 - the center frequency of the first band in Hz.

B - the band width in Hz.

DF - the increment of the comb filter's center frequency (F1 + i * DF).

Mn/Mx - the range of the comb filter.

Initialisation

Each band-pass or notch is initialized with a 1-cos(f)/2 function maximum (1) at center, 1/2 at center +/- B/2, 0 at center +/- B.

Linear Polar Modification

Ws dsp filter linear polar.png

Linear polar modification can be used to modify the amplitude and phase of each time/frequency component generated by the selected analysis method.

The formula is as follows:

(Ai,ji) => Ai(new) = (Ampl. Mul.) • Ai + (Ampl. Offs.) ji(new) = (Phase Mul.) • ji + (Phase Offs.)

Parameters

Ampl. Mul. - any real number Ampl. Offs. - any real number Phase Mul. - any real number Phase Offs. - any real number Amplitude Threshold for Phase (log10) - any real number. The phase is set to zero for all components with an amplitude below or equal to 10^At*precision, where precision is the smallest positive non-zero float number. Note that this parameter is only available for the Phase Vocoder analysis method.

Spectrum (Multi-band) Filter

Ws dsp filter spectrum.png

The spectrum or multi-band filter has a theoretical unlimited number of transmission bands in the frequency range from 0 Hz to sampling frequency/2. In reality, the frequency response of a multi-band filter is limited by the length of the filter and the frequency bin resolution. STx provides a method for using a previously calculated amplitude spectrum as a multi-band filter. Graphic editing of the spectrum has yet to be implemented.

Due to the limited length of digital filters, special care has to be taken when transition bands with steep slopes are specified; they result in unreal filter responses producing a number of side effects.Parameters

The spectrum multi-band filter supports the following parameters:

Spectrum - the spectrum with which to filter.

Gain - the gain (either linear or dB).

truncate - truncate the filter spectrum to the min/max amplitude

invert - invert the filter spectrum.

min/max - the range of the spectrum filter.

Initialization

The following initialization steps are performed:


  • load spectrum from the DataSet, amplitudes in dB
  • normalize to 0dB
  • optional: truncate: set amplitudes above max to max and amplitudes below min to min. Normalize to 0 dB (-> max. filter damping = max - min)
  • optional invert: invert spectrum (sp -> -sp)

normalize to 0 dB

  • gain linear: convert sp to linear amp., multiple with linear gain

gain in dB: add gain, convert sp to linear amp.

Example

The averaged and inverted noise spectrum of a recording taken from signal pauses can be applied in order to perform pre-whitening of a signal before denoising is started.

Ws sp digital filtering.png

You can then use this signal as the Spectrum parameter.