Why do you do not pre-calculated consts?
(And why do you count from 1, but that's another matter)
(And why do you count from 1, but that's another matter)
The compiler should be calculating the constants and substituting the result.Although the compiler can often do such things - nowadays - it also shows the capability of the programmer...
Although the compiler can often do such things - nowadays - it also shows the capability of the programmer...A "real" programmer wouldn't have screwed up refactoring a function either, so let's leave fallacies and ad hominems out of it and stick to the matter at hand.
A real programmer would have analyzed the issue and - using whatever language at hand - optimized it by improving the algorithm.
That does not mean your code becomes faster, it means that you understand your code.
I've been translating a FFT routine to assembler in lost moments the last few weeks. Looks a bit like this code. Though this code makes no sense since it assigns values to w1[j] that are provenly never used?It's just heavily stripped down from my codebase, so none of it will probably make sense to anybody. I chose at random one of ~75 procedures that stuff an array to be used to generate the final audio. The C-code test is uglier since there's no native signum function. C has a couple of really weird insufficiencies.
Still getting the hang of things...
Still getting the hang of things...
One tip for reducing the overhead of the milliseconds:
T1: QWord; …... T1 := GetTickCount64; ...... writeln (GetTickCount64 - T1);
Winni
Hi!
GetTickCount64 is defined as milliseconds since systemstart.
It relies on the OS ticks.
It is the same 'exact' as now is.
Winni
PS: After 5.8E14 years it will wrap to 0!! Take care!
Does your FFT routine use complex numbers? I have a routine that does it in place in a 1024 sample window, no complex numbers needed.
In old days a lot of companies were happy that they had Windows NT 3.5 - a "stable" Windows. But from time to time NT crashed. Nobody knew why. Then the logic appeared: MaxDWord Milliseconds are 49.xx days - and then the server crashed. So you had to reboot the system after 48 days. And the GetTickCount64 came around and everybody was computing, when the overfow will happen ....I completely forgot about that! When that was happening, the company I was working for was running Novell. Rock solid, but don't accidentally print 500 pages as my sysadmin couldn't find a way to kill a print job.
Winni
Oh, cool! The docs said: "It is useful for time measurements, but no assumptions should be made as to the interval between the ticks."
GetTickCount64 returns an increasing clock tick count in milliseconds.
It is useful for time measurements, but no assumptions should be made as to the interval between the ticks.
How trustworthy are the docs? Apple's are pretty awful, even to the point of just being flat out wrong, and not because they're outdated.As everything in FPC and Lazarus they are done by volunteers. So they can either be incomplete or could be improved, but they shouldn't be wrong. However unlike with Apple you can post a bug report and more often than not they are fixed rather quickly (though the changes will only be visible in the next release).
Here's my code in C/C++. I just use it as static methods. It's been specifically stripped down to only work on 1024 sample windows. Unfortunately, the original has no attribution.
40 seems an odd number for video, though. I'm used to the usual suspects when it comes to frame rates. Also, I'm assuming that FFT is used to transform luminance and color channels to the frequency domain? So much interesting stuff out there, so little time to look at it all!Here's my code in C/C++. I just use it as static methods. It's been specifically stripped down to only work on 1024 sample windows. Unfortunately, the original has no attribution.
Thanks. I filed it for future reference. But yeah, it is really power of 2 only, not mixed radix.
Currently the 400 samples are related to camera and lighting, (400/10s = 40/s), but while it would be a whale to change, you never know long term. But in general the various physical factors get priority over the samplesize.
I got my mixed radix from this page https://www.simdesign.nl/components.html (https://www.simdesign.nl/components.html) but originally I did only 10/frame, so performance was not THAT important.
Meanwhile I tripled the number of cameras and it is going in the direction of hundreds/frame.
40 seems an odd number for video, though.
I'm used to the usual suspects when it comes to frame rates. Also, I'm assuming that FFT is used to transform luminance and color channels to the frequency domain? So much interesting stuff out there, so little time to look at it all!