Comments (2)
Certainly not the most efficient way, but you do know that 2D FFT is just a FFT over all the rows and of this intermediate result all the cols? (or the other way around, doesn't matter)?
So in that case make an Array of Arrays, perform a 1D FFT and then rearrange the contents so the array goes over cols/rows and perform the FFT another time.
If you want a more performant solution I suggest altering the library with variants with an offset and a step paramter to the core functions. Which this you can have a data array of the size rows*cols. Then call it row times with increasing i*rowlength offset, then call it another time of col times with i offset and i*rowlength as step parameter into the data. As far I remember this is how KISS did it. (It didn't need an offset parameter tough, due to C pointer arithmetic).
PS: Which brings me to, @maintainer, have you tried to use typed arrays? like Float64Array? IMO this could possible improve perfmance, @Bobingstern I think this would a way to get good perfomance without changing the library, instead of having it constructing the ComplexArrays itself, just hand it TypedArrays of Float64Array, I think it shouldn't notice, and with these basing on a Buffer you can modify offset and spread aka stepwith.. I doubt you get better performance than that.
from fft.js.
FYI: I experimented a little with typed arrays. fft.js gets ~25% slower simply from using them as dropin replacement for plain Arrays. (node v18.14.0). I don't understand why, has to do with some nifty js optimizations I guess.
from fft.js.
Related Issues (13)
- Benchmark against other libraries HOT 11
- Try Split-Radix FFT
- Window Functions HOT 1
- create complex array HOT 3
- ES5 version HOT 18
- No example of expected output HOT 3
- Real Number FFT HOT 4
- number-theoretic transform? HOT 1
- Entire output is NaN HOT 6
- An example would be nice... HOT 1
- Incorrect output for `realTransform` (size >4) HOT 5
- Incorrect output for `transform` function HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fft.js.