{"push_id":2821478990,"size":2,"distinct_size":2,"ref":"refs/heads/master","head":"f88537431e25338cec06f6bf29c371ca3ca72748","before":"b1123bc898a2db97984c43600d66832cf91df1c3","commits":[{"sha":"ba2760450f52a5ebb811f30739402bfeff06a6fc","author":{"name":"Benjamin San Souci","email":"885e936e0021e80fbdfbfc35850437400e7a36ba@gmail.com"},"message":"Bump version number","distinct":true,"url":"https://api.github.com/repos/bsansouci/fft.re/commits/ba2760450f52a5ebb811f30739402bfeff06a6fc"},{"sha":"f88537431e25338cec06f6bf29c371ca3ca72748","author":{"name":"Benjamin San Souci","email":"885e936e0021e80fbdfbfc35850437400e7a36ba@gmail.com"},"message":"Change interpolation to take max freq instead of average.\n\nOk so, as far as I can tell the fourier transform we are doing is\ncalled a DFT (Discrete Fourier Transform). The algorithm itself is\ncalled FFT (Fast Fourier Transform) and is a way to compute the DFT.\nThe DFT is imprecise on two axis:\n- time axis (you have to take a rectangular window of data from the\n  signal, which has implications because the fourier transform is\n  only correct on an infinite signal)\n- frequency axis (you're limited by the sampling rate and the size of\n  the window of data given)\n\nOn top of that, both of these precision problems are inversely related.\nThis is the eisenberg uncertainty principle: you cannot measure both the\nposition of a peak precisely (in time) and the frequencies composing\nthe signal. To increase the precision of the fourier transform, you\nneed to get an infinite signal. To increase the precision of finding\nwhere a peak is, you need to narrow down the window to a very finite\nchunk.\n\nSo that means there's theory that proves that we can't do very well.\nON TOP OF THAT, we are in a finite and digital world, which means we\nhave to deal with a sampling rate which will limit the precision of our\nfourier analysis to anything above samplingRate / 2 (but it's not a\nstep function, the error rate increase as we approach samplingRate / 2).\nON TOP OF _THAT_ the frequencies buckets themselves depend on the\namount of data processed. The more data (compared to the sampling rate)\nthe more \"precision\" in the frequency domain you have, BUT humans mostly\ncare about whole-step Hz and not 1.33333333333...332Hz. So if you give\nthe algorithm a sample that is 3s (which means the number of points it\ncontains is 3x the sampling rate), the FFT algorithm will put the\nenergy into 3 buckets for each whole Hz (0.33333Hz, 0.66666Hz,\n0.99999Hz). This is annoying because I don't think you can simply get\nthe amount of energy at 1Hz by looking at these other buckets. 1Hz is\nnot the same as 1.3Hz, nor is it the average over 0.9Hz and 1.3Hz as\nfar as I can tell.\n\nSo I simply went with the approach of taking all of these imperfect\nbuckets (which depend on the size of the signal given) and found the\nmax amplitude within each whole-Hz bucket. This allows me to say that\nat least if there's a peak somewhere, the amount of energy that you\nsee in the time domain will be \"conserved\" in the frequency domain\n(I think).\n\nThere is something called a DTFT (Discrete Time Fourier Transform)\nwhich allows representing the frequency graph in a continuous way that\ncan be sampled (at exactly the frequencies you care about). This would\nbe the better way to do this analysis when you actually care about\nsub-Hz amplitudes for equipment of sorts. Otherwise this should be fine.","distinct":true,"url":"https://api.github.com/repos/bsansouci/fft.re/commits/f88537431e25338cec06f6bf29c371ca3ca72748"}]}
{"actor":{"display_login":"bsansouci"}}