PetterPet.FFTSSharp
0.0.1
dotnet add package PetterPet.FFTSSharp --version 0.0.1
NuGet\Install-Package PetterPet.FFTSSharp -Version 0.0.1
<PackageReference Include="PetterPet.FFTSSharp" Version="0.0.1" />
paket add PetterPet.FFTSSharp --version 0.0.1
#r "nuget: PetterPet.FFTSSharp, 0.0.1"
// Install PetterPet.FFTSSharp as a Cake Addin #addin nuget:?package=PetterPet.FFTSSharp&version=0.0.1 // Install PetterPet.FFTSSharp as a Cake Tool #tool nuget:?package=PetterPet.FFTSSharp&version=0.0.1
A basic C# wrapper for FFTS (The Fastest Fourier Transform in the South).
FFTSSharp is MIT Licensed, so personal and commmercial use alike is allowed. For further details, see the LICENSE file.
The dynamically linked libraries (DLLs) used for the wrapper are custom built with CMake and should work normally for Windows users. The DLLs are included in the package and the folder "ffts-dlls" is to be put at the application's startup path.
Features
- Full support over all 3 types of SSE (SSE1, SSE2, SSE3) and even without SSE (nonSSE). A built-in SSE availability detector takes care of this.
- Full managed function calls to FFTS unmanaged functions
- Easy-to-use wrapper around FFTS with high performance
- Test programs for basic usage and benchmark code
Benchmark
This is a benchmark comparing FFTSSharp against Intel's MKL C# implementation (https://software.intel.com/content/www/us/en/develop/articles/using-intel-mkl-in-your-c-program.html).
Tests on sizes of power of 2 with complex-to-complex transforms. Transforms for each sizes are run 100000 times and the results are averaged out.
The benchmark is carried out on i7-2640M CPU; SSE3 for FFTSSharp.
Length | FFTS | MKL |
---|---|---|
256 | 356ns | 376ns |
512 | 1551ns | 1555ns |
1024 | 1551ns | 1555ns |
2048 | 3949ns | 12520ns |
4096 | 8342ns | 22965ns |
8192 | 20423ns | 45957ns |
16384 | 46817ns | 89313ns |
32768 | 90406ns | 188335ns |
Target
.NET Framework 4.5 (or .NET Standard 2.0) and above
For target of .NET Framework 2.0 - 3.5 please refer to FFTSSharpLegacy
Get FFTSSharp
For ease of installation, you can add the lastest release of FFTSSharp into your project using Nuget
Usage
- Include the library
using FFTSSharp;
- Initial loading of FFTS DLLs
FFTSManager.LoadAppropriateDll(FFTSManager.InstructionType.Auto);
There consists of 4 enums in FFTSManager.InstructionType: nonSSE, SSE, SSE2, SSE3, Auto
(Choose "Auto" for generic loading)
- Create an instance of FFTS (think of it like creating a plan)
var ffts = FFTS.Real(FFTS.FORWARD, 16);
- Declare the input and output array (length of the input and output must be known beforehand)
float[] input = new float[16];
float[] output = new float[18];
- Compute the result
ffts.Execute(input, output);
- Free the plan
ffts.Free();
Current problems
- For now, only 1D real and complex, forward and inverse tranforms are supported. FFTS support for 2D and above is insufficiently documented and is incomplete.
Credits
Much thanks to the author, anthonix for creating FFTS with a very permissive license.
Thanks to DllImportX made available by rodrigo-speller.
Thoughts
Contributions and issue reports are welcomed.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- System.Reflection.Emit (>= 4.3.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
0.0.1 | 845 | 7/5/2021 |
Initial release