Login / Register  0 items | $0.00 NewWhat is KVR? Submit News Advertise
User avatar
valhallasound
KVRAF
 
3350 posts since 14 Nov, 2006, from Pacific NW

Postby valhallasound; Sun May 15, 2011 10:16 pm Tape Saturation and Pre/De-emphasis filters

Hi all,

I'm thinking about putting some simple tape emulation into a few future plugins. I'm not trying to reproduce a high-end Studer - more low-end nastiness. There's a chapter in the 2nd edition of the DAFX book that describes tape echo modeling, with some useful info in it.

For my purposes, I want to get a gentle tape-esque saturation. I have seen this described in a basic form as a pre-emphasis filter, followed by a nonlinear function (usually some variant of the S-shaped transfer function we are all so fond of), followed by a de-emphasis filter.

Does anyone have any pointers to design techniques for pre/de-emphasis filters? I'm not sure if these can be approximated by simple first-order filters, or if a higher order filter needs to be used.

Thanks,

Sean Costello

P.S. Searching the KVR archives turned up this interesting thread on tape emulation:

http://www.kvraudio.com/forum/viewtopic ... &start=135
liqih
DASH Guy
 
7257 posts since 19 Sep, 2001

Postby liqih; Tue May 17, 2011 2:37 pm

Hi Sean,

for Tape Saturation usually I assume there is some hysteresis in it for getting the
"low-end nastiness"

what you describe looks more like "enhancers" : EQ>>>waveshaping>>>EQ,
for which I would use standard biquad filters, since you'd need a Q factor,

my 2C,
http://nusofting.liqihsynth.com
NUSofting & Dash Signature
User avatar
aciddose
KVRAF
 
11059 posts since 7 Dec, 2004, from Vancouver, Canada

Postby aciddose; Tue May 17, 2011 3:18 pm

you can use a highpass filter, like this:

delta = input - integrator[0]
integrator[0] += delta * coefficient[0]

integrator[1] += saturation(integrator[0]) * coefficient[1] + integrator[1] * coefficient[2]

something like that. basically, integrate the highpass output after it's been saturated. this would be the "ideal" filter assuming you wanted a differentiator/integrator pair. in reality the filters are going to be approximated and adjusted to meet the specific properties of the tape head[s] and tape.

de/emphasis is just taking into account that the response of the system is non-linear with respect to frequency and attempting to compensate for that by "leveling" the frequency response. you apply the inverse of the "bad" response at the input, so when you are "inside" the system the response becomes linear. (or as desired)

once outside the system, apply the "bad" filter to bring the signal back to linear.

one interesting application to get an idea of how this works is x-law style encoding. you just apply a compressing function to the input signal, then quantize it. when you reproduce the signal, apply the reciprocal/expanding function.

for example:

compress(x) = x * (2.0 - abs(x))
expand(x) = x*abs(x)
quantized = (int)(2^bits * compress(signal))
output = expand(quantized / 2^bits)

with dither, this makes a 8 or 12 bit signal "usable" for applications like delay effects. (you probably might also want to apply a de/emphasis, but apply a lowpass to the input, and a differentiator to the output)
bootsie
KVRian
 
649 posts since 19 Apr, 2007, from Frankfurt, Germany

Postby bootsie; Wed May 18, 2011 1:19 am

just use a tilt-style filter to overall balance the frequency response (pre and post). There is one example in musicdsp archive as a good starting point.
follow me on Image
User avatar
valhallasound
KVRAF
 
3350 posts since 14 Nov, 2006, from Pacific NW

Postby valhallasound; Thu May 19, 2011 8:56 am

Thanks for the suggestions so far. Two more questions:

Most of the pre/de-emphasis filters described in analog circuits are described via time constants.

- How do you translate the time constant to frequency? (a link to a relevant web page will suffice)

- Are these filters usually shelving filters, or more of a straight lowpass/highpass filter, or...?

In the past, I've designed an allpass filter at a given frequency, and used the zero coefficients in a one-zero filter for the pre-emphasis, and the pole coefficients in a one-pole filter (with no gain normalization) for the de-emphasis. This works well, and creates a truly transparent pre/de-emphasis filter block, but I am looking at how to create something less transparent.

Sean Costello
mystran
KVRAF
 
4480 posts since 11 Feb, 2006, from Helsinki, Finland

Postby mystran; Thu May 19, 2011 9:04 am

valhallasound wrote:Thanks for the suggestions so far. Two more questions:

Most of the pre/de-emphasis filters described in analog circuits are described via time constants.

- How do you translate the time constant to frequency? (a link to a relevant web page will suffice)


Quick google found this: http://www.sengpielaudio.com/calculator ... nstant.htm

In the past, I've designed an allpass filter at a given frequency, and used the zero coefficients in a one-zero filter for the pre-emphasis, and the pole coefficients in a one-pole filter (with no gain normalization) for the de-emphasis. This works well, and creates a truly transparent pre/de-emphasis filter block, but I am looking at how to create something less transparent.


I don't think you necessarily want the filters themselves to not be transparent (at least not the pre/de-emphasis filters); if there's non-linear processing in between, the result won't be transparent anyway (even if the filters cascade to a wire).
Image <- plugins | forum
User avatar
valhallasound
KVRAF
 
3350 posts since 14 Nov, 2006, from Pacific NW

Postby valhallasound; Thu May 19, 2011 9:37 am

mystran wrote:I don't think you necessarily want the filters themselves to not be transparent (at least not the pre/de-emphasis filters); if there's non-linear processing in between, the result won't be transparent anyway (even if the filters cascade to a wire).


My allpass technique will have phase distortion, so it won't quite cascade to a wir. In the context of tape emulation that is probably just fine. And things can be essentially transparent, if you have a nonlinearity that is essentially linear for low level signal gain. For example, a hard clip will be linear for signal values that don't reach the clipping threshold. From all accounts, tape nonlinearities are closer to the standard sigmoid shape we know and love (the DAFX book uses the error function for emulating tape saturation).

Sean Costello
mystran
KVRAF
 
4480 posts since 11 Feb, 2006, from Helsinki, Finland

Postby mystran; Thu May 19, 2011 11:46 am

valhallasound wrote:
mystran wrote:I don't think you necessarily want the filters themselves to not be transparent (at least not the pre/de-emphasis filters); if there's non-linear processing in between, the result won't be transparent anyway (even if the filters cascade to a wire).


My allpass technique will have phase distortion, so it won't quite cascade to a wir. In the context of tape emulation that is probably just fine. And things can be essentially transparent, if you have a nonlinearity that is essentially linear for low level signal gain.


You could also just design whatever emphasis filter you want using whatever method you feel like, then swap the poles with the zeroes (or just numerator with denominator if you're lazy) so that the zeroes of the first filter cancel the poles of the second, and the poles of the first filter cancel the zeroes of the second. As long as your first filter is minimum-phase (and obviously no zeroes exactly on unit-circle), the result should be stable. If you want an all-pass instead of a wire, you can always reverse the numerator coeffs afterwards.
Image <- plugins | forum
User avatar
valhallasound
KVRAF
 
3350 posts since 14 Nov, 2006, from Pacific NW

Postby valhallasound; Thu May 19, 2011 11:53 am

mystran wrote:
valhallasound wrote:
mystran wrote:I don't think you necessarily want the filters themselves to not be transparent (at least not the pre/de-emphasis filters); if there's non-linear processing in between, the result won't be transparent anyway (even if the filters cascade to a wire).


My allpass technique will have phase distortion, so it won't quite cascade to a wir. In the context of tape emulation that is probably just fine. And things can be essentially transparent, if you have a nonlinearity that is essentially linear for low level signal gain.


You could also just design whatever emphasis filter you want using whatever method you feel like, then swap the poles with the zeroes (or just numerator with denominator if you're lazy) so that the zeroes of the first filter cancel the poles of the second, and the poles of the first filter cancel the zeroes of the second. As long as your first filter is minimum-phase (and obviously no zeroes exactly on unit-circle), the result should be stable. If you want an all-pass instead of a wire, you can always reverse the numerator coeffs afterwards.


Interesting idea. I might try this with my 1st order shelving filters - it should be fairly quick to test.

Thanks,

Sean Costello

Moderator: Moderators (Main)

Return to DSP and Plug-in Development