GithubHelp home page GithubHelp logo

honood / fourier Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jezzamonn/fourier

0.0 0.0 0.0 8.35 MB

An Interactive Introduction to Fourier Transforms

Home Page: http://www.jezzamon.com/fourier

License: MIT License

CSS 0.78% JavaScript 36.20% Jupyter Notebook 62.09% Shell 0.40% HTML 0.53%

fourier's Introduction

An Interactive Introduction to Fourier Transforms

This is the source code for jezzamon.com/fourier

Understanding this code

This webpage is coded in JavaScript, using Webpack, a tool that merges all the JS files into one and translates it into something compatible with older browsers. It uses npm to install dependencies and run the build scripts.

It uses some features of modern JavaScript like classes that might not be too familiar to you if you've only done intro JavaScript, but don't let that phase you too much! All the interactivity and graphics is just done with raw JS, no graphic libraries or anything like that.

Where the interesting files are

The content of the page is written in Markdown, in content/content.md. That file gets converted into HTML when the website is built in script/make-html.js). (If you would like to create a translation for a new language, there are instructions in content/)!

The code for all the interactive elements on the page is under the js/ folder. Each interactive element has a 'controller' that handles updating and rendering that element (e.g. EpicyclesController). There's something that I called a conductor that handles events and passes them on to each controller. Then they're all created and linked to elements on the page in main.js.

The actual Fourier transform is done in just-fourier-things.js, which is really a wrapper over the fft.js library. Sound synth is done in synth.js, using the Web Audio API.

To generate the images used for the JPEG section, I used Python and a Jupyter notebook. That's in python/dct.ipynb, and it's fairly readable itself.

Installing stuff

If you're curious about playing with the code yourself, you'll need to install npm. You can then run npm install to install all the dependencies. Once that's done, you can run npm run watch to start a script that will listen for file changes and rebuild everything, and npm run reload to launch a webserver that reloads the page whenever anything changes :) (warning though: I haven't tried to build things on Windows so not sure how some of the scripts will run there)

If you want to mess with the python stuff, you'll need jupyter, as well as NumPy, PIL, SciPy and Matplotlib. I recommend using Anaconda to install all that.

fourier's People

Contributors

eatchangmyeong avatar jcponce avatar jezzamonn avatar jgorczynski avatar jonirousu avatar omarshehata avatar richoux avatar stopa avatar straaths avatar virtualwiz avatar

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.