-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
build-plug.py "singular matrix" error #109
Comments
Hi |
I see. |
Yes. The first thing we do is calculate the linear response as a IIR filter. Then we measure the response in the non-linear domain. Hence, it's always a IIR filter running into a interpolation table, or for the case the circuit is strict linear (like a EQ or a Wah) simple just a IIR filter. |
"The first thing we do is calculate the linear response as a IIR filter." |
You must split the circuit by yourself, but the tool will glue it together to one plugin. Example is shown here: |
That happen when the analyser can't fetch any influence of a variable resistor. Bu, I tried your circuit from above and get it working as expected.
build-plug.py have a option to plot the filter, as well faust have some options to do a plot for the files, other than that Ardour has a option to show the frequency and power response. |
For the fun I made quickly the power amp stage of the Voxac30: It should replace the stage_03. I build a guitarix plugin from it by: |
Yes, you are right, the generated code DOES work as intended. I will take a look at your vox amp later on:) Btw; do you still have the same schematics you used on the hoffman plexi; |
To make a controller logarithmic, you must add |
Here they are: |
Aha! Thank you for the schematics. |
This is the right place here, and I'm open to answer all questions about it (and fetch your input). At least we make it open source for that reason. |
Ok, great!
|
That's why I said your input is welcome. I wont said this tool is perfect, the opposite is the case. So, when ever you've a idea to make it better, it will be more then welcome. |
Beside that, I guess you are aware that I've developed a couple of plugs already with this tool, were I work around the drawbacks it has. |
Yes, I understand that the dkbuilder tool is still in experimental stage. For example; Then when I change the value in the schematic to 47k, build the plug and run it, |
That may be relate to the windings or the resistance of the transformer, but I'm not sure. Never found some useful resources about that. Maybe reduce the resistance of the transformer may help here, maybe implement inductors in the signal flow, check out the jcm800_power.sch for a more complex implementation of a power amp. Unfortunately that one is to complex to generate a usable filter, but is the most correct we've ever done. |
Might indeed be the output resistance of the transformer. It's currently set to 5400 Ohm in the plexi. |
Oh wait, the 5400 Ohm is probably the primary winding. |
Does dkbuilder model Miller Capacitance and Slew Rate in op-amps, transistors, tubes etc.? |
dkbuilder is based on this thesis: https://www.vut.cz/www_base/zav_prace_soubor_verejne.php?file_id=60090 |
Thanks Hermann for the pointers. Ok, so parasitic capacitance (Miller effect) is not simulated/modeled. Take for example, the second stage grid in Marshall plexi amps. Of course the above example is easily fixed by adding a 200pF C in parallel to the grid, Anyway, I thought I mention it here so that new users of dkbuilder are aware of this limitation. |
I've been following this thread with interest. I don't have much to contribute as I'm not a mathematician or an electrical engineer, but as a programmer/guitarist I would very much like to see progress on the performance and accessibility of tools like dkbuilder. |
Yes, you are right. If you've a idea how we could implement it, that would be welcome. |
The correct place to add miller cap. is probably in the models. As a workaround you can simply add a parasitic capacitor to the schematic at the correct place. The way you did it in your plexi sim is adding an extra RC filter (150Ohm, 0.1u). |
Hermann, Is there a way to set the wiper position of a potmeter in the schematics? |
Sorry, nope. I sometimes append a extra active volume control circuit and replace the potentiometer with a resistor, |
Ok. |
Me again, How to fix? |
It's a way easier and lighter to implement it in C/C++ this way.
Not really, It may be that already the IIR filter is way to loud, I guess that's because of the missing compression. That could be solved by adjust the table operator. ( -o ) I didn't find a way to automate that factor, so a general factor is used. So using -o 0.1 will reduce the operator and therewith the gain nonlinear (compression). Additional there is the --reduce_gain (-r ) flag witch will reduce the gain linear. |
Hello, I am trying to use build-plug.py on a very basic diode clipper schematic.
![diode_clipper_asym](https://user-images.githubusercontent.com/74819462/167890796-6c799b97-870b-4fec-b623-c06964bfc984.png)
However as soon as I add the extra series diode D3 to get asymmetric clipping the script errors as follow;
$ python build-plug.py -i diode_clipper_asym.sch --table_neg 1 -x 2.0 --build
Input file 1: diode_clipper_asym.sch
module_id: diode_clipper_asym
['D3', 'DIODE', 'Is=10e-12,mUt=30e-3', 'unnamed_net3', 'GND']
['D1', 'DIODE', 'Is=10e-12,mUt=30e-3', 'unnamed_net1', 'unnamed_net3']
['D2', 'DIODE', 'Is=10e-12,mUt=30e-3', 'GND', 'unnamed_net1']
['R1', 'RESISTOR', '2.2k', 'unnamed_net1', 'unnamed_net2']
['C1', 'CAPACITOR', '4.7u', 'unnamed_net2', 'V1']
['OUT1', 'OUTPUT', 'None', 'unnamed_net1']
['IN1', 'INPUT', 'None', 'V1']
S = ((D(3), 'u3', GND,),
(D(1), 'u1', 'u3',),
(D(2), GND, 'u1',),
(R(1), 'u1', 'u2',),
(C(1), 'u2', 'V1',),
(OUT, 'u1',),
(IN, 'V1',),
)
V = {C(1): 4.7e-6,
D(1): dict(Is=10e-12, mUt=30e-3),
D(2): dict(Is=10e-12, mUt=30e-3),
D(3): dict(Is=10e-12, mUt=30e-3),
R(1): 2.2e3,
}
Traceback (most recent call last):
File "build-plug.py", line 680, in
main(sys.argv[1:])
File "build-plug.py", line 677, in main
dk.build()
File "build-plug.py", line 552, in build
faustdsp, faustui = c1.get_faust_code(filename=str(dspname))
File "./analog.py", line 779, in get_faust_code
self._ensure_filter(symbolic=symbolic)
File "./analog.py", line 417, in _ensure_filter
sim = dk_simulator.SimulatePy(dk_simulator.EquationSystem(p), self.solver, self.dc_method)
File "./dk_simulator.py", line 756, in init
self.Si = self.S.I
File "/usr/lib/python2.7/dist-packages/numpy/matrixlib/defmatrix.py", line 972, in getI
return asmatrix(func(self))
File "/usr/lib/python2.7/dist-packages/scipy/linalg/basic.py", line 687, in inv
raise LinAlgError("singular matrix")
numpy.linalg.linalg.LinAlgError: singular matrix
lex@msi:~/guitarlex/build/gschem-schematics$
The text was updated successfully, but these errors were encountered: