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

Eigenvalue ordering #2

Open
RoyJames opened this issue Feb 18, 2020 · 1 comment
Open

Eigenvalue ordering #2

RoyJames opened this issue Feb 18, 2020 · 1 comment

Comments

@RoyJames
Copy link

Thank you for integrating the modal sound code and posting this repo! I have one question regarding this file https://github.com/ztzhang/SoundSynth/blob/master/file_generator/ev_generator60.m

According to matlab's documentation, [V, D] = eigs(K,M,num+shift,'sm') should give you the eigen pairs in ascending order. However, you used D=flip(diag(D)) to reverse it before writing to file. The consequence is that when they are read by ModalModel::load_eigenmodes, 0 audible modes can be loaded because the first mode frequency (which is the biggest) is beyond your threshold and will terminate the loading process. So I removed the flip operation in your code and can verify that the problem is gone and the sound is correct. Was this unintentional in your code?

@ztzhang
Copy link
Owner

ztzhang commented Feb 18, 2020

This is actually intentional. The order of the returns in MATLAB is version dependent. Newer versions switched to the behavior you just described.
I'll keep this issue open since this is quite tricky...

@ztzhang ztzhang closed this as completed Feb 18, 2020
@ztzhang ztzhang reopened this Feb 18, 2020
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

2 participants