intro2ddsp / intro2ddsp.github.io

A Jupyter book accompanying the ISMIR 2023 tutorial Introduction to DIfferentiable Audio Synthesiser Programming
54 stars 3 forks source link

Physical Modeling Intro and Modal Analysis #1

Closed rodrigodzf closed 11 months ago

rodrigodzf commented 1 year ago

This is the first draft of the physical modelling part and modal analysis.

dsuedholt commented 1 year ago

Nice! I think it's pretty clear to follow and demonstrates the main concepts well - but I'm also coming from having gnawed on this specific topic for a while, so it would be good to have somewhat "fresher" eyes than mine on it as well :D

I'll just add some comments here until we have the notebook reviewing sorted out:

sho.ipynb:

many_oscillators.ipynb:

review-notebook-app[bot] commented 1 year ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

rodrigodzf commented 1 year ago

Cool! thanks for the feedback! I have corrected the notebooks.

Regarding

I think we could consider getting rid of the control import entirely. Since you implement SS simulation and frequency sampling anyway, we could just also use these functions for the plots?

I use also control for the bilinear sampling of the continuos SS, I think I could pull it out from control but I didn't want to introduce too much tangential information.

Do we want to address using a general SS model vs specific domain knowledge restrictions? Here for example, we're learning a full, dense matrix , but if we just want to find out the parameters of a harmonic oscillator, we know that it should have counter-diagonal entries only. Maybe go into how to we recover mass and spring constant from the full matrix?

The state transition matrix $A$ doesn't have to end up with counter diagonal entries, any vector space that has the same eigenvalues will satisfy the dynamics of the system. I think imposing either the modal solution (diagonal) or the anti-diagonal, is interesting from imposing some prior physical knowledege, however, I don't know how would be possible to recover $k$ or $m$ since at this point we only have a ratio.

I think the mathematical derivation of modal expansion should definitely be included in the webbook, but for the tutorial itself it might be a bit hard to present and follow, especially within a strict time limit. Maybe we can handwave the theory a bit, and focus the in-session tutorial on fitting the filterbank to a given magnitude response?

Yea, it can be skipped if there's no time. I can make two cells, one with an easy text explanation, and one with the derivation that can be collapsed for the presentation. The idea was to follow from the beginning to the end without leaving big holes.

I also added a draft of the md files pre/postceding these notebooks

rodrigodzf commented 12 months ago

Control and scikit-fem could either be added there or installed within the notebook with the magic %pip command?

I don't have a strong opinion on this. I added scikit-fem to the requirements, but I could also add it as a %pip command. The same with control. Maybe @ben-hayes has an opinion about this?

ben-hayes commented 11 months ago

@rodrigodzf Sorry just saw this question re scikit-fem. As it's used to construct the mass/stiffness matrices, my preference would be to store these matrices in files and load them, explaining in the text where they came from, rather than introduce an extra dependency.

I appreciate you want to illustrate the whole process though, so with that in mind I think installing just for this notebook with the %pip magic would be reasonable, as it's a light install (no compilation).