Giter VIP home page Giter VIP logo

sound-wave-simulator's Introduction

Sound Wave Simulator

This sound wave simulator is able to visualize phenomena which occur below, at and above the speed of sound

Link to hosted project: Wave Simulator

Made with JavaScript and visualized with the p5.js library

This wave simulation uses the algorithm from the article linked to at the bottom and renders using pixel value manipulation. The rings represent peaks of the waves which reflect off the sides of the canvas. This can simulate any type of wave such as a water wave but I looked at it in terms of a sound wave to visualize many of its phenomena.


Subsonic

At subsonic speeds, the Doppler Effect can be visualized. When the sprite moves at a speed slower than the waves, the waves that build up in front of the sprite are closer together than those behind the sprite. In other words, the frequency of the waves in front of the sprite are higher than those behind. When a car passes by, we hear the pitch of the sound the car makes drop. This is because the car is moving much like the sprite moves which causes the sound waves in front of the car to have a higher frequency and pitch than the waves behind.


Mach 1

When the sprite moves at the speed of the wave, a pressure wave can be seen. In front of the sprite there is a collection of all the peaks of the waves which forms a pressure wave. This is also known as a shock wave and creates the sonic boom sound in fighter jets.


Supersonic

When the sprite moves faster than the speed of sound, the pressure wave trails the sprite. This is similar to when a jet or a bullet travels faster than the speed of sound.




Sources:
Wave simulation: https://web.archive.org/web/20160418004149/http://freespace.virgin.net/hugo.elias/graphics/x_water.htm
Shock waves: https://en.wikipedia.org/wiki/Shock_wave
Sound barrier: https://en.wikipedia.org/wiki/Sound_barrier

sound-wave-simulator's People

Contributors

tansonlee avatar

Stargazers

 avatar  avatar

Forkers

butayama

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.