the Testbed

06/11/2012 § 3 Comments

Before I move on to show some real filters and their theory, lets prepare our testbed. My initial plan was to hack Mixxx’s sound engine and patch it with my audio filters. I defered due to following reasons:

  • Mixxx lacks ‘analysis’ tools. Not lack actually, Mixxx is not supposed to do track analysis, that’s by design.
  • Every time I want to see effect of changes I do, I have to re compile complete project which is a time taking procedure
  • The visual of waveform displayed is not designed to see small changes in audio when effects are applied
  • Saving the changes a part of audio/editing only a part of audio is still on wishlist

So, I decided to use a LADSPA host (Audacity) and a LADSPA plugin (FIL-4pand parametic eq). Here are steps to see your effects in action (for a Linux box)

    • Install Audacity (that’s quite obvious, isn’t it ?)
    • Download FILs plugin from here.
    • For FILs plugin your effects will be in ParamSect::proc(…) inside file ‘filters.h’ file, like so,
void proc (int k, float *sig, float f, float b, float g)
{
 int i, count = 10;
 float out=0.0f;

 // filter coeff. (refer to Z domain)
 float a0=.55, a1=-1.055, a2=.55, b1=-1.055, b2=.1;
 for (i=0; i<k; i++)
 {
     // convolution
     out = a0*sig[i] + a1*hz1 + a2*hz2 - b1*hp1 - b2*hp2;

     // store the current state of filter
     hz2 = hz1;
     hz1 = sig[i];
     hp2 = hp1;
     hp1 = out;

     // scaling the output
     if (out > 17000)
         out = 17000;
     if (out < -15000)
         out = -15000;

    // storing the output
    sig[i] = out;
 }

 }


Steps 1 to 3, below, will be followd recursively to see the changes in audio done by your filter.

  1. Compile plugin and get LADSPA library. (use simple Ladspa loader to poke around this library)
  2. Copy LADSPA library into /usr/share/audacity/plug-ins folder (you may need root’s passwd)
  3. Restart Audacity, load your Guinea pig (audio sample; no offence to animals intended), apply you filter, which will be listed in effects -> effects 1 to 15 This will apply your effects onto the loaded track.

Saving/clipping an audio file in Audacity is pretty straight forward, so I won’t describe that. For pointers see, documentation. For loading LADSPA plugin in Audacity, see plugin installation.

Filter design is independent of host and plugin, so you may choose some other LADSPA host and any plugin. The point is to use a platform which you can hack and can understand.

Advertisements

§ 3 Responses to the Testbed

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

What’s this?

You are currently reading the Testbed at a tryst with DSP.

meta

%d bloggers like this: