MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   MATLAB技术文章 (https://www.labfans.com/bbs/forumdisplay.php?f=25)
-   -   Code for Sonic and Ten Sonic Movies - Cleve Moler on Mathematics and Computing (https://www.labfans.com/bbs/showthread.php?t=27451)

poster 2024-12-18 23:52

Code for Sonic and Ten Sonic Movies - Cleve Moler on Mathematics and Computing
 
Two previous blog posts, [URL="https://blogs.mathworks.com/cleve/2024/12/08/sonic-adds-sound-to-logo-recaman-chaos/"]Dec. 12, 2024[/URL] and [URL="https://blogs.mathworks.com/cleve/2024/11/16/lights-camera-action-and-sound/"]Nov. 16, 2024[/URL], introduced "Sonic", my new tool for incorporating sound in videos. Today's blog post includes a link to the MATLAB source code for Sonic, as well as links to new versions of ten examples.

[B]Contents[/B]
[LIST][*][URL="https://www.labfans.com/bbs/#430e1f71-5674-4dd0-9822-ecdf14267246"]Code[/URL][*][URL="https://www.labfans.com/bbs/#261cb182-c13b-4b1e-9932-f52485ff1334"]Sonic[/URL][*][URL="https://www.labfans.com/bbs/#c9a4823d-d0b6-48fd-a9f0-388f00ec93b3"]Ten Movies[/URL][/LIST][B]Code[/B]

The MATLAB code for Sonic and all the examples is available in this 11 MB zip file.

[URL="https://blogs.mathworks.com/cleve/files/Sonic.zip"]Sonic.zip[/URL]

[B]Sonic[/B]

There are two ways to generate the musical sounds. The three movies Warm-Up, TanSin and Blackjack use recordings of C-major scales played on three different pianos. All the other movies rely on [URL="https://www.mathworks.com/help/signal/ref/resample.html"]resampling[/URL] a single note from a trumpet, xylophone or piano.

The function sonic_examples(kases,n) is a driver for sonic. The first parameter, kases, is an integer vector of desired examples, 0 though 9. The second parameter, n, is the number of desired samples.
[LIST][*]n = 25 is very fast[*]n = 100 is reasonable[*]n = 200 is the default[*]n = 300 is overkill[/LIST][B]Ten Movies[/B]

Here are links to new versions of the animated videos, and the final frames.

[B]0. Warm-Up[/B]

[URL="https://blogs.mathworks.com/cleve/files/sonic_examples_0.mp4"]sonic_examples_0.mp4[/URL]

[IMG]http://blogs.mathworks.com/cleve/files/sonic_examples_0.png[/IMG]

[B]1. Lissajous[/B]

[URL="https://blogs.mathworks.com/cleve/files/sonic_examples_1.mp4"]sonic_examples_1.mp4[/URL]

[IMG]http://blogs.mathworks.com/cleve/files/sonic_examples_1.png[/IMG]

[B]2. Mertens[/B]

[URL="https://blogs.mathworks.com/cleve/files/sonic_examples_2.mp4"]sonic_examples_2.mp4[/URL]

[IMG]http://blogs.mathworks.com/cleve/files/sonic_examples_2.png[/IMG]

[B]3. TanSin[/B]

[URL="https://blogs.mathworks.com/cleve/files/sonic_examples_3.mp4"]sonic_examples_3.mp4[/URL]

[IMG]http://blogs.mathworks.com/cleve/files/sonic_examples_3.png[/IMG]

[B]4. Van der Pol[/B]

[URL="https://blogs.mathworks.com/cleve/files/sonic_examples_4.mp4"]sonic_examples_4.mp4[/URL]

[IMG]http://blogs.mathworks.com/cleve/files/sonic_examples_4.png[/IMG]

[B]5. VdP Derivative[/B]

[URL="https://blogs.mathworks.com/cleve/files/sonic_examples_5.mp4"]sonic_examples_5.mp4[/URL]

[IMG]http://blogs.mathworks.com/cleve/files/sonic_examples_5.png[/IMG]

[B]6. Blackjack[/B]

[URL="https://blogs.mathworks.com/cleve/files/sonic_examples_6.mp4"]sonic_examples_6.mp4[/URL]

[IMG]http://blogs.mathworks.com/cleve/files/sonic_examples_6.png[/IMG]

[B]7. Vibrating L-shaped Membrane[/B]

[URL="https://blogs.mathworks.com/cleve/files/sonic_examples_7.mp4"]sonic_examples_7.mp4[/URL]

[IMG]http://blogs.mathworks.com/cleve/files/sonic_examples_7.png[/IMG]

[B]8. Recamán Sequence[/B]

[URL="https://blogs.mathworks.com/cleve/files/sonic_examples_8.mp4"]sonic_examples_8.mp4[/URL]

[IMG]http://blogs.mathworks.com/cleve/files/sonic_examples_8.png[/IMG]

[B]9. Swinging Sticks[/B]

[URL="https://blogs.mathworks.com/cleve/files/sonic_examples_9.mp4"]sonic_examples_9.mp4[/URL]

[IMG]http://blogs.mathworks.com/cleve/files/sonic_examples_9.png[/IMG]

[RIGHT][COLOR=gray][I]
[URL="javascript:grabCode_6be05d5d2be34097bc51738847d9f5b6()"][I]Get the MATLAB code (requires JavaScript)[/I][/URL]

Published with MATLAB® R2024b
[/I][/COLOR][/RIGHT]


所有时间均为北京时间。现在的时间是 05:00

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.