Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nonlinearity behavior of OTA all-pass unit #4

Open
jpcima opened this issue Oct 7, 2019 · 1 comment
Open

Nonlinearity behavior of OTA all-pass unit #4

jpcima opened this issue Oct 7, 2019 · 1 comment

Comments

@jpcima
Copy link
Owner

jpcima commented Oct 7, 2019

Stumbled upon this paper, suggesting a digital model for OTA stages.

Huovilainen, Antti. "Enhanced digital models for analog modulation effects." Proc. Int. Conf. Digital Audio Effects (DAFx-05), Madrid, Spain. 2005.

I wrote faust code of the digital model section 3.2 (substitute the tanh later)

ota_allpass(f, x) =
  x + w
letrec {
  'w = w + (2 * R1 * Vt * g / R2) * ma.tanh(-R2 * (x + x' + w) / (2 * R1 * Vt));
}
with {
  g = 1 - exp(f * (-2 * ma.PI / ma.SR));
  // components
  R1 = 27e3;
  R2 = 10e3;
  C = 68e-9;
  // characteristics
  Vt = 25e-3;
};

Effect on phase response depending on signal level. (on the left is original, right is OTA)
nonlinear

@jpcima
Copy link
Owner Author

jpcima commented Oct 7, 2019

This is a tabulated tanh function.

copysign(x, y) = ba.if(y<0, -1, +1) * abs(x);

fastTanh(x) = copysign((tab(i1), tab(i2)) : si.interpolate(mu), x) with {
  xmax = 5.0;
  size = 128;
  tab = rdtable(size, (float(ba.time)/float(size-1)) : *(xmax) : ma.tanh);
  pos = (float(size-1)/xmax)*abs(x);
  mu = pos-int(pos);
  i1 = min(int(pos), size-1);
  i2 = min(int(pos)+1, size-1);
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant