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

Remove iterations parameter #195

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Remove iterations parameter #195

wants to merge 1 commit into from

Conversation

dsharlet
Copy link
Owner

As @Federerer mentioned on #193, the iterations parameter is of questionable utility. I did some experiments and found that performance was actually better with more iterations in some cases. I think this is because the simulation state is closer to converged for the next sample if we don't stop iterating too early.

I also reduced the default oversample parameter from 8 to 2. I read somewhere ages ago (I can't remember where) that simulating audio circuits needed a high oversampling factor to avoid aliasing harmonics in an audible way, and the author recommended 8x. But, I've never once been able to notice a difference with any oversampling factor in terms of audio quality. Maybe this not an issue because our numerical integration is higher quality or something. We're also just doing a box downsample at the end anyways, perhaps this is negating any advantage from oversampling. 2 is what the VST plugin has been doing all along, and I don't think that has caused any issues. Most people are probably using the VST plugin anyways.

Opening this PR for discussion, more testing is probably needed.

@Federerer
Copy link
Collaborator

Looks good. Regarding the default oversampling - I think that it would be useful to have a global settings window somewhere, where you can set your defaults (and maybe other advanced simulation settings, like integration method or newton's method delta error value). I find it very annoying that I have to change that every time I start a simulation. Also, there is a possibility to save it per-schematic - creating a json file with the same name as the schematic file with extension like: *.sim.json and reading it when starting simulation with a fallback to defaults.

I've done some audio null tests comparing different oversampling settings and the differences are very minor(mostly on transients in upper harmonics range), in case of iterations, there is a clearly audible clicking/popping when you set it too low. I've also tested changing the relative newton iteration error. Maybe I'll record a quick demo, so you can hear it yourself 😃

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

Successfully merging this pull request may close these issues.

2 participants