wo80 / sharpfftw Goto Github PK
View Code? Open in Web Editor NEWSharpFFTW - A lightweight C# wrapper for native FFTW.
License: MIT License
SharpFFTW - A lightweight C# wrapper for native FFTW.
License: MIT License
Hello there.
My question do not relate to FFTW directly, I would be thankful if you give me your opinion.
I have a harmonic signal (same shape repeats over and over), in form of short[]
array. lets say it have 1M members. What i need to find out is Auto Correlation of this signal. In other words I want to find the frequency, of signal to find out how much it takes for signal to repeat itself. I know there is some method with FFT, which does this. but have no chance to made it.
Do you know how can i use FFT or particularly SharpFFTW to do such?
Here is my non working code:
https://github.com/epsi1on/SimpleOscilloscope/blob/main/src/POC/SimpleOsciloscope.UI/FftFrequencyDetector.cs
and here is how I feed it (line 46 to 80)
https://github.com/epsi1on/SimpleOscilloscope/blob/1a9132965a414055fe3aac3a77c6a8dc022c9f72/src/POC/SimpleOsciloscope.TestConsole/Program.cs#L46
Cheers
Hello. Following code falls randomly at lines #1 or #2 with AccessViolationException only when debugger is not attached. Commenting out line #3 prevents code to fail.
var N = 4096;
var input = new RealArray(N);
var spectrum = new ComplexArray(N);
var output = new RealArray(N);
var fft = Plan.Create1(N, input, spectrum, Options.Measure);
var ifft = Plan.Create1(N, spectrum, output, Options.Measure);
while (true)
{
Console.WriteLine("converting");
fft.Execute(); // #1
Console.WriteLine("converting back");
ifft.Execute(); // #2
Console.WriteLine("getting result");
var result = output.ToArray(); // #3
}
Hi, sorry for the N00b issue, but I'm having trouble getting the FFTW implementations to work, I've downloaded the dlls and put them in the root directory, and it seems that this code
public static bool LibraryExists()
{
try
{
var ptr = NativeMethods.fftwf_malloc(8);
NativeMethods.fftwf_free(ptr);
return true;
}
catch
{
}
return false;
}
is where the dll is attempting to be found/added, but I can't find any reference in the project how/where to put this dll so it is actually imported and used.
Thanks!
Josh
Nice work btw :)
Hi
Sometimes i got thus error on code:
var real = new float[points.Length];
using var input = new RealArray(real);
using var output = new ComplexArray(points.Length / 2 + 1);
using var plan = Plan.Create1(points.Length, input, output, Options.Estimate);
plan.Execute();
Thanks a lot for this library. The call to NativeMethods.fftwf_sprint_plan(handle);
crashes however. Any chance you could fix this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.