Giter VIP home page Giter VIP logo

wave-beats's Introduction

Wave beats

Modeling and visualization of wave interference and beat patterns in Python

  • Python 3.9.0
  • NumPy 1.22.0
  • Matplotlib 3.5.1

A beat is an interference pattern between two sounds of slightly different frequencies at the same point in space, perceived as a periodic variation in volume whose rate is the difference of the two frequencies


Execution

Display help:

$ python beat_pattern.py -h   
usage: beat_pattern.py [-h] [-w1] [-w2] [-a] [-t]   

Plot the superposition of two waves by definition 
of frequencies, amplitude and time

optional arguments:
  -h, --help        show this help message and exit
  -w1, --wave1      wave 1 frequency (Hz) (default: 30)
  -w2, --wave2      wave 2 frequency (Hz) (default: 32)
  -a, --amplitude   waves amplitude (m) (default: 10)
  -t, --time        points to evaluate function (s) (default: 2)

Example 1

Input args:

$ python beat_pattern.py
Flag Argument Value Unit
Wave 1 frequency 30 (default) Hz
Wave 2 frequency 32 (default) Hz
Amplitude 10 (default) m
Time 2 (default) s

Output:

Resultant Pattern 1


Example 2

Input args:

$ python beat_pattern.py -w1 20 -w2 24
Flag Argument Value Unit
-w1 Wave 1 frequency 20 Hz
-w2 Wave 2 frequency 24 Hz
Amplitude 10 (default) m
Time 2 (default) s

Output:

Resultant Pattern 2


Example 3

Input args:

$ python beat_pattern.py -w1 12 -w2 12.8 -t 4
Flag Argument Value Unit
-w1 Wave 1 frequency 12 Hz
-w2 Wave 2 frequency 12.8 Hz
Amplitude 10 (default) m
-t Time 4 s

Output:

Resultant Pattern 3


Example 4

Input args:

$ python beat_pattern.py -w1 25 -w2 28 -a 2 -t 1.5
Flag Argument Value Unit
-w1 Wave 1 frequency 25 Hz
-w2 Wave 2 frequency 28 Hz
-a Amplitude 2 m
-t Time 1.5 s

Output:

Resultant Pattern 4

wave-beats's People

Contributors

ssebastianmag 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.