This is a simple Discrete Fourier Transform library implemented in PHP.
require 'DFT.php'; // input discrete values $Y=[2,3,-1,1]; // instantiate and calculate factors $DFT=new DFT($Y); // get Fourier (frquency domain) factors (Complex) $Factors=$DFT->getFactors(); // get Magnitudes (absolute values) (float) $Magnitudes=$DFT->getMagnitudes();
As simple as that!