Stuck with a SynthEdit project?

Tag: FIR Filters

SINC (IIR) Filters

Windowed-sinc filters are used to separate one band of frequencies from another. They are very stable, produce few surprises, and can be pushed to incredible performance levels.
These exceptional frequency cutoff characteristics are obtained at the expense of poor performance in: a) the time domain (meaning they will always introduce latency), b) excessive ripple and c) overshoot in the step response.
In the image below you can see how the signal pulse (Oscillator 280Hz) is delayed as the number of “Taps” at a filter frequency of 5 kHz increases, and the amount of “ringing” or ripple on the pulse waveform also increases.

Increasing TAPs increases the latency:

TAPs and latency.

The SINC Lowpass filter is a linear-phase FIR Filter. The number of “taps” specifies the number of coefficients, more TAPs means increased filter cut-off steepness as seen below however, increasing the number of TAPs introduces more latency. In SynthEdit however there is latency compensation. The module is watching for any change to the default value of the ‘Taps’ pin. The module then uses this value to calculate how much latency compensation it requires and passes that value to the host via the ‘SetLatency’ method. Latency is measured in sample frames.
The module reports this latency to SynthEdit to enable PDC (Plugin Delay Compensation). PDC hides the effect of latency through the clever use of delay lines. You can literally think of all FIR/SINC filters as a multitap delay with no feedback, all the taps are spaced 1 sample apart, then gain is applied per tap and then all taps are added together. So for a 171 tap delay, you have 170 delays, 171 gains (like level adjust modules) and 170 adds. It’s already well optimised with SSE2, as it’s doing 4 calculations at a time.

Resonance/Q/Feedback.

SINC filters do not include a feedback path, so have no feedback, resonance, or “Q” control plug. The are intended to be used as a filter with a very steep low/high pass cutoff characteristic, rather than for colouration of sound.

Increasing the number of TAPs and the effect on frequency roll-off.

Note about 0 Hz filter cut-off:

Although this filter will allow you to set a cut-off frequency of 0 Hz, you cannot use a filter frequency of 0Hz, this is is an ‘illegal‘ value. You will get quite loud clicks and pops, along with “glitching”.
Most SynthEdit filters are “clipped” internally so that end-users don’t input wrong values (this comes at a slight CPU cost of course), usually limited to just above 0Hz and just below the Nyquist frequency.
Why 0Hz is illegal is easiest to explain with a simple 6dB/Octave lowpass. If we set the lowpass to 100Hz, then 200Hz (2nd octave) will be filtered by -6dB, 300Hz (3rd Octave) by -12dB, 400Hz(4th Octave) by -18dB and so on, hence the “6dB/Octave” name. Now try and do the same thing with 0Hz….what is an octave above 0? 0 multiplied by 0 is still 0. It’s the same as dividing by zero.
To prevent loud pops, clicks and glitching you must limit the lowest cut-off frequency to 14 Hz.
Just be sure to limit your patch memory values to prevent illegal values.
Other than this the SINC filters are suitable for fast modulation of the cut-off frequency. Note that there is no resonance/feedback on these filters.

Changing TAP value.

One point to note with SINC filters is that when you change the TAP value the audio engine has to reset for the recalculation process.

TAP Value and filter cut-off slope.

Although we can vary the cutoff slope on SINC filters by altering the TAP number, this bears no relation to the more familiar dB/Octave slope, so unfortunately you cannot say that a certain TAP number is equivalent to a particular dB/Octave cutoff slope. This is due to the DSP structure, and the way these filters work, they are a using a different method of filtering which bears little or no mathematical resemblance to the more traditional analogue filter emulations.

Oversampling in SynthEdit

Oversampling Control Module:

This module provides control of the Oversampling rate for your Synthesizer or effects VST.
Note: This module only works when inside a container.
The oversampling rate is set by connecting a list entry control to the module.
This controls the sample rate at which the Container processes audio.
This figure is expressed as a factor relative to 44.1kHz (which is a typical sampling/processing rate). For example if you select 2x oversampling, the Container will process at a minimum of 88.2kHz.

The plugs on the oversampling module

Plugs.
<-> Oversampling: (Integer) Controls the sample rate at which the Container processes audio. This figure is expressed as a factor relative to 44.1 kHz (which is a typical standard rate). For example if you select 2x oversampling, the Container will process at (at least) 88.2  kHz.
The options are: x2, x4, x8, x16, and x32
Note: If your soundcard is already running at 88.2 kHz or higher, 2x oversampling won’t have any effect because SynthEdit takes this to mean that you are already processing at twice the ‘standard‘ rate. If the Soundcard is set to run at 88.2 kHz SynthEdit will only apply additional oversampling if you select 4x, 8x or a higher oversampling rate…
<-> List Items: (Text) Supplies the list of rates to choose from.
<-> Oversampling Filter: (Integer) Receives your choice of filtering.
<-> List Items 2: (Text) Supplies the list of filters to choose from: 3, 5, 7, 9, FIR Low, FIR Med, FIR High, FIR Ultra.

Oversampling Filter options:
3, 5, 7, 9, FIR Low, FIR Med, FIR High, FIR Ultra.

About the Oversampling Filter:- This option Controls the type of filter used to down-sample the audio as it exits the oversampling container.
A value of 5, 7 or 9 will select an IIR filter with the corresponding number of poles (more is better). These types of filters have low latency, and low CPU but introduce phase-shift into the signal.
A value of FIR-low, FIR-Medium, FIR-High, or FIR-Ultra will select a FIR filter. These filters are very clean and high-quality but do introduce some latency. FIR-Ultra is the best quality.
 Oversampling Filters: ( [3,5,7,9] Elliptic IIR Filter, [13-low, 14-med, 15-hi, 16-ultra] FIR Adaptive Quality, [20+] FIR actual taps)
Important Notes about Oversampling:
Note: Oversampling filter increases the CPU load by the same factor as the oversampling multiplier, this means x8 oversampling means the workload for the CPU is increased eightfold.
Note: Changing the oversampling rate causes a short interruption to audio processing while the oversampling filters are inserted into the signal flow.
Note: DO NOT connect a Patch Memory module to the Oversampling Module it will cause some very unpredictable and undesirable results..

About FIR Filters.

In signal processing, a finite impulse response (FIR) filter is a ‘filter whose impulse response (or response to any finite length input) is of finite duration, because it settles to zero in finite time’.
This is in contrast to infinite impulse response (IIR) filters, which may have internal feedback and may continue to respond indefinitely to an impulse (usually decaying).
The impulse response (that is, the output in response to a Kronecker delta input) of an Nth-order discrete-time FIR filter lasts exactly N + 1 samples (from first non-zero element through last non-zero element) before it then settles to zero. FIR filters can be discrete-time or continuous-time, and digital or analogue.

Example: 
A whole plugin is running at 44.100Hz, but you want to decrease aliasing created by distortion. So you containerize just the distortion module and add an Oversampling Control to that same container. Now, only the distortion part will be processed at double standard rate (88.200Hz, which will create less aliasing) and then filtered back to the original SR for further signal processing.
Note: There should be only one Oversampling Control per container, and it works “remotely” without any audio patch cables connected to it. It has two properties that you can access by selecting the Oversampling Control’s parent container and checking the Properties Panel

About Oversampling:

In signal processing, oversampling is the process of sampling a signal at a sampling frequency significantly higher than the Nyquist rate. In theory, a bandwidth-limited signal can be perfectly reconstructed if sampled at the Nyquist rate or above it.
The Nyquist rate is defined as ‘twice the bandwidth of the signal’.
Oversampling is capable of improving audio resolution and signal-to-noise ratios, and can assist in avoiding aliasing and phase distortion by reducing anti-aliasing filter performance requirements.
A signal is said to be oversampled by a factor of N if it is sampled at N times the Nyquist rate.
For example, we have a system with a Nyquist limit of 44kHz, but it’s actually sampled at 88kHz, then it would be oversampled by a factor of 2 so if the sample rate is taken up to 132kHz then we are oversampling by a factor of 3.

Why oversample?
There are four good reasons for performing oversampling:
1) To improve anti-aliasing performance (the higher the sample rate, the lower the level of the aliasing by products)
2) To increase audio resolution
3) To reduce background noise levels
4) It’s much easier to reduce aliasing distortion during sampling than after the sampling process (reducing aliasing after sampling is almost impossible to do without affecting sound quality adversely).
Oversampling and Anti Aliasing.
Oversampling makes it much easier to design and create analogue
anti-aliasing filters. Without oversampling, it is very difficult to create filters with a sharp enough cut-off necessary to maximize the available bandwidth without the audio exceeding the limitations of the Nyquist frequency limit.
By increasing the bandwidth of the sampling system, design considerations for anti-aliasing filters may be made simpler. Once the signal has been sampled, the signal can be digitally filtered and then down-sampled to the required sampling frequency.
In modern digital circuit or DSP technology, any filtering systems associated with the down-sampled audio are easier to put in place than an analogue filter system that would be required by a non-oversampled audio design.

SynthEdit Oversampling in action.
Its as simple as this, just connect these modules up like so inside the container, and welcome to the world of Oversampling. No further connections are needed.

Connecting up the oversamplin module