Extreme Optimization™: Complexity made simple.

Numerical Components
for .NET

  • Home
  • Features
    • Math Library
    • Vector and Matrix Library
    • Statistics Library
    • Performance
    • Usability
  • Documentation
    • Introduction
    • Math Library User's Guide
    • Vector and Matrix Library User's Guide
    • Statistics Library User's Guide
    • Reference
  • Resources
    • Downloads
    • QuickStart Samples
    • Sample Applications
    • Frequently Asked Questions
    • Technical Support
  • Blog
  • Order
  • Company
    • About us
    • Testimonials
    • Customers
    • Press Releases
    • Careers
    • Contact us
Introduction
Deployment Guide
Using Parallelism
Expand Mathematics Library User's GuideMathematics Library User's Guide
Expand Vector and Matrix Library User's GuideVector and Matrix Library User's Guide
Expand Statistics Library User's GuideStatistics Library User's Guide
Expand ReferenceReference
  • Home
    • Features
    • Solutions
    • Documentation
    • QuickStart Samples
    • Sample Applications
    • Downloads
    • Technical Support
    • Download trial
    • How to buy
    • Blog
    • Company
    • Resources
  • Documentation
    • Introduction
    • Deployment Guide
    • Using Parallelism
    • Mathematics Library User's Guide
    • Vector and Matrix Library User's Guide
    • Statistics Library User's Guide
    • Reference
  • Mathematics Library User's Guide
    • General Classes
    • Mathematical Functions
    • Complex Numbers
    • Arbitrary Precision Arithmetic
    • Automatic Differentiation
    • Curves
    • Curve Fitting
    • Solving Equations
    • Optimization
    • Calculus
    • Fast Fourier Transforms
    • Generic Arithmetic
    • Appendices
  • Fast Fourier Transforms
    • One-Dimensional Fast Fourier Transforms
    • Window Functions
    • Two-Dimensional Fast Fourier Transforms
Collapse image Expand Image Copy image CopyHover image
         




Fast Fourier Transforms

The Extreme Optimization Numerical Libraries for .NET provide a set of classes for computing the Discrete Fourier Transform of real and complex signals.

One time FFT's

When only very few Fourier transforms of a given length need to be computed, the VectorComplexVector classes provide methods that can perform this computation in one line of code.

To compute the Fourier transform of a real sequence, use FourierTransform(Vector). This method takes as its only parameter a Vector that specifies the signal that is to be transformed. It returns a ComplexVector that contains the transform.

The inverse transform is computed using the InverseFourierTransform(ComplexVector) method. This method takes a ComplexVector and returns a Vector. Only the first n/2+1 components are used in the computation.

The following example computes the Fourier transform of a short vector, and then computes the inverse transform. The result is a vector identical to the first one:

C#  Copy imageCopy
DenseVector r1 = Vector.Create(1.0, 2.0, 3.0, 4.0);
ComplexVector c1 = Vector.FourierTransform(r1);
Vector r2 = Vector.InverseFourierTransform(c1);
Visual Basic  Copy imageCopy
Dim r1 As DenseVector = Vector.Create(1.0, 2.0, 3.0, 4.0)
Dim c1 As ComplexVector = Vector.FourierTransform(r)
Dim r2 As Vector = Vector.InverseFourierTransform(c)

For complex signals, the ComplexVector class has a FourierTransform(ComplexVector) and a InverseFourierTransform(ComplexDenseVector) method. Each method takes one parameter: a ComplexVector, and also returns a ComplexVector.

Multiple FFT's of the same size

In many applications, many Fourier transforms of the same length need to be calculated. To make this process more efficient, you can use Fft objects, that represent the implementation of an FFT of a given length. Fft objects are created through an FftProvider.

FFT Providers

The FftProvider is the base class for accessing a specific set of FFT algorithms. Two FFT providers are shipped with the library: a managed provider that uses 100% managed code, and a 'native' provider that uses hand-optimized unmanaged code and is an order of magnitude faster for longer transforms.

In order to use the native provider, the assembly containing the native FFT code for the current processor architecture must be present. This assembly is called Extreme.NativeFft.x86.20.dll on 32 bit systems and Extreme.NativeFft.x64.20.dll on 64 bit systems. If this assembly cannot be found, the managed provider is used instead.

You can access the two providers through the ManagedProvider()()()() and NativeProvider()()()() properties.

The managed provider has two additional properties that indicate when to switch to the native provider (if it is present). The RealManagedThresholdLength property specifies the shortest length of a real FFT for which the native FFT provider will be used. The default is 64. The ComplexManagedThresholdLength property specifies the shortest length of a complex FFT for which the native FFT provider will be used. The default is 32.

Using FFT providers, you can obtain Fft objects for one-dimensional transforms and Fft2D objects for two-dimensional transforms. The Fft and Fft classes implement System..::..IDisposable, so you should always use a using statement or call Dispose()()()() once you are done using the object.

Send comments on this topic to support@extremeoptimization.com

Copyright (c) 2004-2011 ExoAnalytics Inc.

Copyright © 2003-2013, Extreme Optimization. All rights reserved.
Extreme Optimization, Complexity made simple, M#, and M Sharp are trademarks of ExoAnalytics Inc.
Microsoft, Visual C#, Visual Basic, Visual Studio, Visual Studio.NET, and the Optimized for Visual Studio logo
are registered trademarks of Microsoft Corporation.