How to Create an Ecasound Band-Reject Filter

This guide explains how to construct an audio band-reject (notch) filter using native Ecasound operators. While Ecasound does not feature a single dedicated band-reject operator, you can build an effective band-reject filter natively by splitting the signal into two parallel chains—one running a lowpass filter and the other running a highpass filter—and summing their outputs. The sections below outline the signal architecture, provide the precise command syntax, and detail frequency configuration.

Native Signal Routing Concept

A band-reject filter attenuates frequencies within a specified range while leaving frequencies below and above that range intact. Native Ecasound processing includes:

  • -efl:cutoff_frequency (Lowpass filter, 12 dB/octave roll-off)
  • -efh:cutoff_frequency (Highpass filter, 12 dB/octave roll-off)

To configure band rejection, split the audio stream across two independent chains (chain1 and chain2). Set the lowpass operator on chain1 to retain audio below the lower cutoff frequency, and set the highpass operator on chain2 to retain audio above the upper cutoff frequency. Both chains are then routed to the same output device or file, summing them to form the final notched signal.

Command-Line Syntax

Run the following command structure in your terminal:

ecasound -a:1,2 -i:input.wav \
         -a:1 -efl:800 \
         -a:2 -efh:2000 \
         -a:1,2 -o:output.wav

Parameter Breakdown

  • -a:1,2 -i:input.wav: Assigns chains 1 and 2 to receive the audio stream from input.wav.
  • -a:1 -efl:800: Applies a native lowpass filter to chain 1, allowing frequencies below 800 Hz to pass through.
  • -a:2 -efh:2000: Applies a native highpass filter to chain 2, allowing frequencies above 2000 Hz to pass through.
  • -a:1,2 -o:output.wav: Mixes the processed signals from both chains together into output.wav. The frequency band between 800 Hz and 2000 Hz is rejected.

Interactive ECI Configuration

If configuring this via the Ecasound Control Interface (ECI) or inside an .ecs preset file, use the equivalent commands:

c-add chain_low
c-add chain_high

cs-set-audio-format s16_le,2,44100
ai-add input.wav
ao-add output.wav

c-select chain_low
cop-add -efl:800

c-select chain_high
cop-add -efh:2000

Frequency Calibration Considerations

  • Bandwidth Control: The gap between the -efl parameter and the -efh parameter dictates the width of the rejected notch.
  • Filter Slopes: Ecasound's native -efl and -efh filters operate with a 12 dB/octave slope. For steeper notch skirts, cascade multiple filters on the respective chains (e.g., -a:1 -efl:800 -efl:800 produces a 24 dB/octave lowpass response).
  • Phase and Crossover: At narrow notch widths, phase interactions around the crossover point can cause mild phase cancellation. Ensure your cutoff points leave adequate spacing to minimize unintended comb-filtering near the corner frequencies.