GithubHelp home page GithubHelp logo

fourier-animation's Introduction

FourierSeries

A generic algorithm for Fourier Synthesis and Analysis.

bat horse bat bat

This is just a hobby project to demonstate an application of

  1. std::accumulate algorithm in the evaluation of fourier series (Fourier Synthesis)
  2. std::inner_prodcut for the fourier transform (Fourier Analysis)

It is just an easy to use header only library.The library has dependency over C++14. To run the cosole version do the following

  cd path_to_repo/tests/justmain
  g++  main.cpp -std=c++14 -lstdc++
  ./a.out

You can try the Graphical example if you are willing to depend on QT. Or you can use base libray with any other Graphical toolkit of your choice to draw your own animaitons.

Using Qt Version.

  Install Qt from https://www.qt.io/download?hsCtaTracking=f24f249b-61fb-4dec-9869-50512342f8d9%7Cf3adf380-4740-4f7e-9e49-d06fa99445fa
  open qtcreator 
  import FourierTest.pro from path_to_rep/tests/qtexample/FourierTest.
  qmake
  build 
  run

Example

#include "../../src/fourier.h"
#include <iostream>
int main(int argc, char *argv[])
{
      FTerm t1{50,1.};
      std::vector<FTerm> terms;
      terms.push_back(t1);
      terms.emplace_back(std::polar(2.,PI/2.) * t1);
      terms.emplace_back((1.+2.i)*t1);
      terms.emplace_back(FTerm{50,3});
      int epiccirle{0};
      auto callback = [=](auto center, auto pointAt, auto amp)mutable{
          std::cout<<" Inner Circle: "<<epiccirle << " center: " << center << " pointAt time 0.05: " << pointAt << " amplitude: " <<amp<<"\n";
          epiccirle++;
      };
      std::cout<<F_S(terms,{10,10},0.05,callback) << endl;
      
      //symbolic expression 
      auto v=t1 + std::polar(2.,PI/2.) * t1 + (1.+2.i)*t1 + FTerm{50,3};
      std::cout<<FType(10,10)+v(FInterpolator(0.05,callback))<<endl;
      return 0;
}

fourier-animation's People

Contributors

abhilashraju avatar

Watchers

 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.