Difference between revisions of "Convolution"

From JRiverWiki
Jump to: navigation, search
(Troubleshooting the Cons)
Line 50: Line 50:
 
'''Latency'''
 
'''Latency'''
  
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 Media Center generally takes it's own DSP latency into account when playing back video internally, external video sources that are using Media Center'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.
+
The delay introduced by a convolution filter can be calculated using the following formula: <code>(Taps / 2) / Sampling Rate</code> (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 Media Center generally takes it's own DSP latency into account when playing back video internally, external video sources that are using Media Center'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'''
 
'''CPU usage'''

Revision as of 21:41, 23 February 2015

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. Media Center'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:

  • DRC - Free cross-platform convolution filter generator. Automated filter generation; Requires a microphone; Limited graphical interface.
  • Rephase - A no cost convolution filter editing tool. Not automated; no microphone required; Requires more user expertise to get good results.
  • 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
  • Audiolense - Commercial software with limited free trial. Automated filter generation; Requires a microphone
  • 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 Media Center'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 Media Center

To use a single filter in Media Center, 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, MC 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, MC offers two solutions to that issue:

  1. MC will automatically resample the filters on the fly; this solves the problem for most use cases.
  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 MC 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

  • Flexibility- FIR filters can make changes that simply aren't possible in other DSP.
  • 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 Media Center, which is much easier than doing the math and working out your own filter banks.

Cons

  • Latency- FIR fltering necessarily entails some delay. In pure audio applications, this isn't very relevant, but in live playback applications or applications using Media Center's WDM Driver the delay introduced by convolution can be meaningful.
  • 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.
  • 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. Most Media Center users do not experience issues when using Convolution and Videoclock together, but see the troubleshooting section below for some ways to tell if you're experiencing an issue.

Troubleshooting the Cons

Latency

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 Media Center generally takes it's own DSP latency into account when playing back video internally, external video sources that are using Media Center'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. You can lighten the load by using shorter (lower taps) or less complex convolution filters.

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 if you have other inexplicable spatialization/imaging issues, try turning off VideoClock to troubleshoot.

More