I'd really like to add some sort of "getTransferFunctionAt(complex z)" to the SVF that somehow computes the value of the transfer function for a given z but I'm somehow stumped. I got as far as writing down the following:
where h[n], b[n], l[n] are the time domain highpass, bandpass and lowpass signals and u[n], v[n] are the integrator states and H(z), etc. are the corresponding z-transforms of these signals. I renamed the variables a bit compared to the source code to make them shorter (because expressions will get long and messy anyway). So far so correct? But what now? I'd like to find expressions for H(z)/X(z), B(z)/X(z) and L(z)/X(z). These would then be the transfer functions of the highpass, bandpass and lowpass. Right? To obtain the overall transfer function, I just form a weighted sum with the a-coefficients. But so far, I had no success finding these expressions. It gets messy really quick and I'm not really sure, how I could explain this task to a computer algebra system (like Sage - which is what I typically use). How would one go about this? I tried the following snippets:
here:
https://sagecell.sagemath.org/ The stuff after the arrow -> are the results I get - which are no results. I'm using d = z^-1, btw. I'm doing something wrong. Am I even on the right track or is this all pure nonsense?
Code:
h[n] = s*x[n] - s*c*u[n-1] - s*v[n-1] <--> H(z) = s*X(z) - s*c*z^-1 * U(z) - s*z^-1 * V(z) b[n] = g*h[n] + u[n-1] <--> B(z) = g * H(z) + z^-1 * U(z) l[n] = g*b[n] + v[n-1] <--> L(z) = g * B(z) + z^-1 * V(z) u[n] = 2*b[n] - u[n-1] <--> U(z) = 2 * B(z) - z^-1 * U(z) v[n] = 2*l[n] - v[n-1] <--> V(z) = 2 * L(z) - z^-1 * V(z)
Code:
var("d g s c X H B L U V") # d = z^-1e1 = H == s*X - s*c*U*d - s*V*de2 = B == g*H + U*de3 = L == g*B + V*de4 = U == 2*B - U*de5 = V == 2*L - V*dsolve([e1,e2,e3,e4,e5],[H/X,B/X, L/X]) -> TypeError: H/X is not a valid variable.var("d g s c X H B L U V") e1 = H == s*X - s*c*U*d - s*V*de2 = B == g*H + U*de3 = L == g*B + V*de4 = U == 2*B - U*de5 = V == 2*L - V*dHX = H/XBX = B/XLX = L/Xsolve([e1,e2,e3,e4,e5],[HX,BX, LX]) -> TypeError: H/X is not a valid variable.var("d g s c X H B L U V HX BX LX") e1 = H == s*X - s*c*U*d - s*V*de2 = B == g*H + U*de3 = L == g*B + V*de4 = U == 2*B - U*de5 = V == 2*L - V*de6 = HX == H/Xe7 = BX == B/Xe8 = LX == L/Xsolve([e1,e2,e3,e4,e5,e6,e7,e8],[HX,BX,LX]) -> []
https://sagecell.sagemath.org/ The stuff after the arrow -> are the results I get - which are no results. I'm using d = z^-1, btw. I'm doing something wrong. Am I even on the right track or is this all pure nonsense?
Statistics: Posted by Music Engineer — Sun Nov 10, 2024 9:17 am