Convolution

From wiki.jriver.com
Jump to navigation Jump to search

Convolution is a complex digital signal processing method that allows for significant changes to audio that would not be possible with conventional electronic or software filtering.

Conventional electronic filters are typically Minimum Phase filters. This means that any change to the Frequency Response of the audio is accompanied by a corresponding change to the Phase (or timing) of that audio; in a minimum phase environment, you can't normally change one without the other. JRiver's parametric equalizer modules are Infinite Impulse Response filters that simulate conventional minimum phase electronic filters.

By contrast, Convolution can perform Linear Phase filtering: altering the frequency response of the signal separately from the phase using Finite Impulse Response filters. In addition to this capability, many automated room correction software suites use convolution filters as an output because it makes a convenient way to bundle a large DSP bank into a single file.

How to Use Convolution

Filter Generation

In order to use Convolution, you'll need to use third party software to generate a filter. Most such software requires a microphone to create the filter. Many software solutions are available, and the following solutions are used by various JRiver forum members:

  1. DRC - Free cross-platform convolution filter generator. Automated filter generation; Requires a microphone; Limited graphical interface.
  2. Rephase - A no cost convolution filter editing tool. Not automated; no microphone required; Requires more user expertise to get good results.
  3. Room EQ Wizard - A no cost measurement and filter generation (requires forum registration). Automated filter generation; Requires a microphone; Does not support linear phase filtering
  4. Audiolense - Commercial software with limited free trial. Automated filter generation; Requires a microphone
  5. Acourate - Commercial software with limited free trial. Automated filter generation; Requires a microphone

Additionally there are other convolution solutions that do not generate filters, but instead perform the filtering themselves (such as Dirac), but because they do not generate convolution filters for use with JRiver's convolution DSP they are beyond the scope of this article.

Note: This list does not constitute an endorsement by JRiver of any of these software suites, it is intended as a list of known convolution filter generating utilities for informational purposes

Using the Filter in JRiver

To use a single filter in JRiver, just navigate to Tools > Options > Audio > DSP Studio & Output Format > Convolution. Browse to to your filter location, select it, and make sure that the check box beside the convolution tab is checked.

For more complex configurations, JRiver can interpret standard plain-text Convolution Config Files. See these Examples for how to write one.

Convolution filters are created at a specific sample rate, which means that they will only work correctly with that sample rate. However, JRiver offers two solutions to that issue:

  1. JRiver will automatically resample the filters on the fly.
  2. If you want more control over what happens with different sample rates and channel configurations, you can generate separate filters at each sample rate, and JRiver will automatically switch between them, but you must use the following naming format for your filters: Name2.0_441 or Name5.1_48, etc. The regular expression is: ^(.+)(\\d{1}.\\d{1})_(\\d{2,3}).cfg$ , which outputs: Name Channels Sample rate.

Pros and Cons

Because convolution is very flexible and very powerful, it can be used for many audio tasks including room correction, speaker correction, active crossovers, and sub integration. There some potential downsides to using convolution.

Pros

  1. Flexibility- FIR filters can make changes that simply aren't possible in other DSP
  2. Convenience- While audio tuning is never entirely easy, many of the automated utilities described above take microphone measurements and generate a single convolution filter that you can use in JRiver, which is much easier than doing the math and working out your own filter banks.

Cons

  1. Latency- FIR fltering necessarily entails some delay. In pure audio applications, this isn't very relevant, but in live playback applications or applications using JRiver's WDM Driver the delay introduced by convolution can be meaningful.
  2. Processor Usage- Most modern PCs can handle fairly sophisticated convolution filters without problems. However, older or low-powered PCs or very long/complex convolution filters can sometimes create problems.
  3. Videoclock- Because convolution involves minute changes to audio timing, VideoClock can sometimes interfere with convolution. VideoClock adjusts the timing of the audio signal to maintain a perfect sync with the video and this can cause problems for convolution.

Troubleshooting the Cons

Latency

Because JRiver's implementation of convolution is not partitioned, the delay introduced by a convolution filter can be calculated using the following formula: (Taps / 2) / Sampling Rate (expressed in seconds). So a 22000 tap filter sampled at 44100HZ would introduce about 1/4 of a second of delay, which is significant. While JRiver generally takes it's own DSP latency into account when playing back video internally, external video sources that are using JRiver's WDM Driver for playback may have lipsync issues when using convolution. The film standard for lipsync is about 25ms; more delay than that will potentially begin to introduce lipsync issues. For that reason, it's advised to create low-tap convolution filters if you plan to use them for live playback or WDM audio.

CPU usage

If you're getting drop outs or unexpected behavior from your filters, open the convolution pane in DSP studio and look at the status display at the bottom. It will include a performance measurement indicating how many times faster than real-time your CPU is processing the filters. Typical modern PCs often show performance ratings better than 30x real-time, but the performance can fluctuate widely based on what else the PC is doing. If you see that your performance multiplier is in the single digits or task manager is showing significant CPU usage, that may be an indicator that your processor isn't up to the task.

Video Clock

IF you have a Phantom Center speaker, you may find that video clock destabilizes the center image. Not everyone experiences this, but if you find that your phantom center image is not stable, or you have other inexplicable spatialization/imaging issues, try turning off VideoClock to troubleshoot.

Links

A guide to speaker measurement and correction which includes some discussion of convolution can be found here:

http://yabb.jriver.com/interact/index.php?topic=87538.0

The feature was proposed and discussed in this thread on Interact:

http://yabb.jriver.com/interact/index.php?topic=69312.0

Additional discussion of measuring techniques and filter generation software can be found in these threads:

http://yabb.jriver.com/interact/index.php?topic=69312.0

http://yabb.jriver.com/interact/index.php?topic=85631.0