Hello there, I'm working on a project regarding a stream of audio, and I'm looking for a way to convert the time domain array to the frequency domain.
Input = [0.1,0.2,0.3,0.4,0.5 ...] (array representing amplitudes of an audio stream) (increasing amplitude audio)
output = [200,500,4000,8000,9000 ...] (array representing frequency components of that audio stream) (frequency components)
Is there any implementation of FFT in the AHK language? I'm running low on options and I'm not in favor of re-implementing the algorithm from the ground up.
Thanks for your time.
Is there a way to compute FFT in AHK?
-
- Posts: 6
- Joined: 25 Apr 2022, 05:56
Re: Is there a way to compute FFT in AHK?
Why choose AHK? What is the logic?
You did not search deeply.
AHK is not on this list ..
https://rosettacode.org/wiki/Fast_Fourier_transform
Here is a general purpose maths engine.
https://www.wolframalpha.com/input/?i=Fast+Fourier+Transform&assumption=%7B%22C%22%2C+%22Fast+Fourier+Transform%22%7D+-%3E+%7B%22MathWorld%22%7D
But there is Python.
You did not search deeply.
AHK is not on this list ..
https://rosettacode.org/wiki/Fast_Fourier_transform
Here is a general purpose maths engine.
https://www.wolframalpha.com/input/?i=Fast+Fourier+Transform&assumption=%7B%22C%22%2C+%22Fast+Fourier+Transform%22%7D+-%3E+%7B%22MathWorld%22%7D
But there is Python.
Re: Is there a way to compute FFT in AHK?
I searched Google and best I could find was in the German forum: viewtopic.php?p=440669&sid=1cc29100ca0e8a5c968af9c76f131202#p440669
If there is a simple math equation to do; you can apply it to every element in the array with https://biga-ahk.github.io/biga.ahk/#/?id=map
If there is a simple math equation to do; you can apply it to every element in the array with https://biga-ahk.github.io/biga.ahk/#/?id=map
Re: Is there a way to compute FFT in AHK?
Hallo, the mathematical method requires calculating with complex numbers!
With Excel it is easier and certainly faster.Re: Is there a way to compute FFT in AHK?
Thanks for your reply, as I said earlier, I'm working on a project in AHK, and I want it to stay in one script and in one language, I'm not in favor of calling python from inside AHK just to apply a function.datavectors wrote: ↑03 May 2022, 15:40Why choose AHK? What is the logic?
You did not search deeply.
AHK is not on this list ..
https://rosettacode.org/wiki/Fast_Fourier_transform
Here is a general purpose maths engine.
https://www.wolframalpha.com/input/?i=Fast+Fourier+Transform&assumption=%7B%22C%22%2C+%22Fast+Fourier+Transform%22%7D+-%3E+%7B%22MathWorld%22%7D
But there is Python.
You might ask why not do the whole project in python, this is because it involves contact with windows APIs which AHK excels at.
Re: Is there a way to compute FFT in AHK?
Thanks! your input is highly appreciated, both links are good resources.Chunjee wrote: ↑03 May 2022, 15:41I searched Google and best I could find was in the German forum: viewtopic.php?p=440669&sid=1cc29100ca0e8a5c968af9c76f131202#p440669
If there is a simple math equation to do; you can apply it to every element in the array with https://biga-ahk.github.io/biga.ahk/#/?id=map
I will dig into that forum and if I didn't find anything useful, then I'll implement a simple FT myself.
Re: Is there a way to compute FFT in AHK?
Thanks for your reply, as I said earlier, I'm working on a project in AHK, and I want it to stay in one script and in one language, that's why I'm sticking with AHK.
You might ask why not do the whole project in python, this is because it involves contact with windows APIs which AHK excels at.
Re: Is there a way to compute FFT in AHK?
I strongly disagree with your reasoning that suggests "hey here is this thing that works perfectly as-is, lets throw it away and start over"
There is a .NET DLL to handle Complex numbers. there are scripting libraries... but none of them are windows API per se`
I would have expected that you google the subject of "autohotkey and complex numbers".
viewtopic.php?t=35809
(edited)
And this.
The fact that you can use API's from other interpreters including JavaScript, .NET within AHK makes the whole thing moot, in my opinion.
WHERE
There is a .NET DLL to handle Complex numbers. there are scripting libraries... but none of them are windows API per se`
I would have expected that you google the subject of "autohotkey and complex numbers".
viewtopic.php?t=35809
(edited)
We are troubled on every side‚ yet not distressed; we are perplexed‚
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed;
Telegram is the best way to reach me
https://t.me/ttnnkkrr
If you have forum suggestions please submit a
Check Out WebWriter
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed;
Telegram is the best way to reach me
https://t.me/ttnnkkrr
If you have forum suggestions please submit a
Check Out WebWriter
Re: Is there a way to compute FFT in AHK?
Thanks for your reply, I stated previously in my post that I'm against the idea of reimplementing the algorithm or neglecting any resource on that subject (that is why I'm asking for help in the first place), I'm totally cool with calling APIs from other interpreters, as long as they don't require adding any additional files or require some installations on the end-users side, I would like to keep it simple for the user, that is all.tank wrote: ↑05 May 2022, 11:53I strongly disagree with your reasoning that suggests "hey here is this thing that works perfectly as-is, lets throw it away and start over"And this.
The fact that you can use API's from other interpreters including JavaScript, .NET within AHK makes the whole thing moot, in my opinion.
WHERE
There is a .NET DLL to handle Complex numbers. there are scripting libraries... but none of them are windows API per se`
I would have expected that you google the subject of "autohotkey and complex numbers".
viewtopic.php?t=35809
(edited)
I did already searched for complex numbers implementation in AHK and found the link you pointed me to previously. My last option is to reimplement the algorithm using the help of existing AHK libraries, but first I said to myself "why not ask if someone has a better way", but it looks like there isn't.