2016 | H | M | S | Miles | Calories | Days | Miles/day | Hours/day | |
January | 22 | 11 | 11 | 29.85 | 17,081 | 10 | 2.99 | 2.2 | |
February | 14 | 11 | 1 | 27.5 | 11,676 | 6 | 4.58 | 2.4 | |
March | 25 | 28 | 22 | 202.38 | 20,444 | 14 | 14.46 | 1.8 | |
April | 45 | 47 | 25 | 362.92 | 31,917 | 23 | 15.78 | 2.0 | |
May | 45 | 20 | 47 | 410.48 | 30,483 | 19 | 21.60 | 2.4 | |
June | 49 | 13 | 55 | 469.25 | 33,775 | 16 | 29.33 | 3.1 | |
July | 36 | 47 | 42 | 459.97 | 28,057 | 16 | 28.75 | 2.3 | |
August | 10 | 50 | 14 | 108.98 | 9,035 | 4 | 27.25 | 2.7 | |
September | 34 | 17 | 4 | 460.67 | 26,268 | 16 | 28.79 | 2.1 | |
October | 29 | 24 | 8 | 400.69 | 22,556 | 16 | 25.04 | 1.8 | |
November | 29 | 28 | 54 | 318.62 | 22,130 | 14 | 22.76 | 2.1 | |
December | 24 | 23 | 38 | 254.59 | 19,597 | 10 | 25.46 | 2.4 | |
367 | 24 | 21 | 3,506 | 273,019 | 164 | 21.38 | 2.2 |
A few days ago I posted a ooBasic script that can be used in LibreOffice to do a Discrete Fourier Transform (DFT) on a set of cells. While it works, it is slow. This is because the a raw implementation of a discrete Fourier transform runs at a complexity of O( n^{2} ). That is, the number of operations required to compute is the square of the number of data points. Since this grows exponentially, slightly larger data sets take significantly longer to compute.
Naturally, the solution is to switch to a Fast Fourier Transform (FFT). These can generally reduce the complexity down to O( n log_{2} n ). I knew this when implementing a DFT, but implementing an FFT is a bit more complected. ooBasic kinda...well, pretty much sucks as a programing language. So to do an FFT implementation I wanted an algorithm fairly straight forward to translate. I surveyed several libraries but ultimately decided on Free small FFT. It included a fairly clean radix-2 Cooley–Tukey FFT algorithm but also had Bluestein's algorithm for data not in powers-of-two. The complexity looks to be something around:
I am judging this based on the fact it does three radix-2 transforms on a four times the rounded up power-of-two.
Why does anyone need an FFT in a spreadsheet? I’m not the only person who has searched for such a function, but the primary reason I want one is to do a spectrum plot of a sampled signal. It doesn’t happen often that I need one, but when I want it, I want it in the spreadsheet and would rather not have to go to an external tool.
Today I finished making a simple project page to host the script. Installing it in LibreOffice isn’t easy, but the steps outline in the manual section seem to work. They don’t make it easy, but should anyone else ever want LibreOffice Calc to do an FFT, this should work.