Re: [ecasound] Filters

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [ecasound] Filters
From: Kai Vehmanen (k_AT_eca.cx)
Date: Fri Jan 25 2002 - 02:57:14 EET


On 23 Jan 2002, Nolan Darilek wrote:

> Out of curiosity, what exactly do the various filters (lowpass,
> highpass, bandpass, etc.) do? I thought that they'd remove all
> portions of an audio file which fall above/below/within the specified
> frequencies, but when I'd run them over various songs to test this,
> they didn't seem to work. For example, for the hell of it I wanted to

That is correct.

> see if I could use a bandpass filter to extract the vocals from
> Learning to Fly by Pink Floyd. (Ok, I don't expect perfection here,
> this is just an experiment. :) So I used a bandpass filter centered on
> 191 Hz with a width of about 100 Hz (The song appears to be in G, and
> if I'm correct then the frequency of that G is something around 191
> Hz.) This doesn't seem to work however. Rather than bringing out the
> vocals, or some portion of the audio, the entire song seems to be
> quieter and muffled.

The catch here is that the note G is just the fundamental note. Most
sounds contain lots of other frequencies. This is why playing the G note
on different instruments sounds different (timbre, color of sound, etc)
Some sounds are relatively simple (most bass sounds) while some are very
complex (human voice, violin, guitar).

Another limiting thing is that filters rarely are of the brickwall-type.
For instance a typical lowpass filter will attenuate all frequencies above
the cutoff-freq, but you can still hear the higher freqs - they are just
quieter. You can create better filters, but accuracy requires lots of
CPU-power. This is why DSP-processors are popular in heavyweight audio
processing. To make a really sharp filter, you need processing power.

One good way to learn more about filtering is to get a program which can
show FFT graphs (the Snd editor is what I usually use), and load different
audio samples to it.

If you have LADSPA SDK installed, you can easily generate sine tones
for analyzing and filtering. For instance:

# generates a 1000Hz sine tone (10sec)
ecasound -i null -o 1000hz_sine.wav -el:sine_fcac,1000,1 -t:10

# generates a 4000Hz sine tone
ecasound -i null -o 4000hz_sine.wav -el:sine_fcac,4000,1 -t:10

# combine the files
ecasound -a:1 -i 1000hz_sine.wav -a:2 -i 4000hz_sine.wav \
         -a:1,2 -o 1_and_4_khz_sines.wav

Then load the files to snd (or other FFT-viewer) and you should see 1+2)
one spike, 3) two separate spikes. And next you can filter the files with
ecasound and see what happens. There's also more filters available as
LADSPA plugins.

> Looking at the effect presets file, it would appear that I can add
> various effects to the areas of the frequency selected by the various
> filters. I can't seem to figure this out, however.
[...]
> ecasound -i *8* -efb:191,56 -ea:500 -efh:400 -ea:0

You need to divide the signal into multiple chains, and apply the filters
in parallel, and then recombine again before output:

# 1. foo.wav to chains '1' and '2'
# 2. process chain '1' with a bandpass filter
# 3. process chain '2' with a highpass filter
# 4. output a mix of chain signals to /dev/dsp
ecasound -a:1,2 -i foo.wav \
         -a:1 -efb:191,56 -ea:500 \
         -a:2 -efh:400 -ea:200 \
         -a:1,2 -o /dev/dsp

-- 
 http://www.eca.cx
 Audio software for Linux!

-- To unsubscribe send message 'unsubscribe' in the body of the message to <ecasound-list-request_AT_wakkanet.fi>.


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Fri Jan 25 2002 - 02:48:09 EET