Help |
Try loading an example from the dropdown menu in the top panel and hit "Run" (PLAY). Real time settings can be adjusted mid simulation to adjust the scale, colour etc. (e.g. try the DICE button).
Use the bottom right panel to alter where source and receivers are placed. Note: a warning is given if there are active source/receivers located on an object. Several other properties can be set here, including e.g. the centre frequency in Hz of the source pulse.
Select load image (LOAD_FILE) to load your own image. Size is restricted to 10x10 to 1000x1000 pixels (otherwise resize/pad/cropping will occur). Image luminance is used to determine where to model objects, so black and white or greyscale images may work best. Simple images are more likely to work as intended (e.g. try making something in MS Paint!). After loading, use the threshold percentage setting (bottom panel) to adjust what parts of the image are made into objects.
Use the draw tools (DRAW_LINE, DRAW_OPEN_FREEFORM, DRAW_RECTANGLE, DRAW_CIRCLE) to create or add to an image. You can delete individual shapes (ERASE_ACTIVE_SHAPE) or the full image (CLEAR_ALL). Use the pan (PAN), zoom in/out (ZOOM_IN, ZOOM_OUT), advanced zoom/select (ZOOM), and reset (RESET_AXES) tools to alter the view/modelled area. Save an image (SAVE_CURRENT_VIEW) prior to running to commit/render to an image ready for simulating.
An image of the current plot can be downloaded at any time (DOWNLOAD_PLOT_AS_A_PNG). Selecting the bottom panel make GIF or wav checkboxes creates and downloads a file/files after a full simulation is run. Note: creating a GIF will make things run a little slower. Settings are taken at the start of the simulation, and will have no effect if altered whilst running (e.g. change of colour). The wav file contains the response at the receiver position, and will have an integer (likely non-standard in terms of audio use) sample rate dictated by mesh resolution.
The default mode is a constant absorption value across surfaces. To vary the absorption change the absorption mode (bottom panel) and use an image with varying luminance (e.g. greyscale). This then assigns more absorbing surfaces to lighter areas of the image and more reflecting surfaces to darker areas.
Note: hovering over most input boxes and buttons displays a description of what they do.
Note: this is not 'cutting edge', and is a 'warts and all' implementation. You may see artefacts, often caused by either the modelling of curved surfaces using a underlying square grid or the imperfect surface absorption when set to full (α = 1). Dispersion is also a problem at higher frequencies. But hey, it's still fun!
In the background this is PyScript, so it's a version of Python, only in your browser. This is pretty cool, but does mean you use data to download, and it can take a short while. It's also quite experimental at this stage, though this page uses a fixed version so hopefully shouldn't break any time soon.
Any major bugs please get in touch. There will be some!
Info |
A 2D acoustic Finite Difference Time Domain (FDTD) simulation.
Make and simulate/animate a 2D sound world from an image. Mainly a bit of fun, but also for interest/understanding.
Richard Hughes
Uses PyScript to download and run Python code. Python not required, but takes a short while to load and data is on order of tens of MB. PyScript is developmental and constantly changing; I'll try to make sure it doesn't break!
The figure uses Plotly
If of interest:
Content on this site provided solely for fun. 'Use at your own risk'. No guarantee made of accurate predictions and should not be relied on.
Settings |
Source settings |
|
Type | |
No. periods | |
Mesh settings |
|
Mesh check | |
General |
|
Auto offline update |