webit/fft

There is no license information available for the latest version (1.0.0) of this package.

Web-IT FFT Library

1.0.0 2015-05-09 09:58 UTC

This package is auto-updated.

Last update: 2024-10-20 22:21:58 UTC


README

FFT and IFFT Calculator

Installation

via Composer

Add the webit/fft into composer.json

{
    "require": {
        "php": ">=5.3.2",
        "webit/fft": "~1.0"
    }
}

Usage

FFT

<?php
use Webit\Math\Fft\FftCalculatorRadix2;
use Webit\Math\Fft\Dimension;
use Webit\Math\ComplexNumber\ComplexArray;

// FFT
$calculator = new FftCalculatorRadix2();
$signal = ComplexArray::create(array(123, 456, 789, 1111));

$fft = $calculator->calculateFft($signal, Dimension::create(4)); // ComplexArray

IFFT

<?php
use Webit\Math\Fft\IFftCalculator;
use Webit\Math\Fft\FftCalculatorRadix2;
use Webit\Math\Fft\Dimension;
use Webit\Math\ComplexNumber\ComplexArray;

// FFT
$calculator = new IFftCalculator(new FftCalculatorRadix2());
$signal = ComplexArray::create(array(123, 456, 789, 1111));

$ifft = $calculator->calculateIFft($signal, Dimension::create(4)); // ComplexArray