Fast Hartley Transform (similar to FFT, but 2x faster) - Page 1
Forum section: electronics / general

author: legacy
author_rank: Super Contributor
timestamp: January 26, 2016, 12:40:22 pm
content: hi guysDiscrete Hartley transform is an analogue of discrete Fourier transform for real data, but it takesONLYa real sequence as an input.Do you happen to have on hand a good good implementation in C ?I have to port it to different machinesthank you in advance

author: coppice
author_rank: Super Contributor
timestamp: January 26, 2016, 02:30:57 pm
content: Googling "FHT in C" get you some code, but if you are concerned about the highest speed you might need something more tailored to the qualities of your platform. Depending how you implement things, the FHT may actually be slower than a well tuned FFT.

author: andre_teprom
author_rank: Regular Contributor
timestamp: January 26, 2016, 02:40:49 pm
content: Taking a quick search on the web, could find something.Quote

author: legacy
author_rank: Super Contributor
timestamp: January 26, 2016, 03:02:56 pm
content: Quote from: legacy on January 26, 2016, 12:40:22 pm"happen to have on hand" should mean: do youalready have(at least have seen) a pretty chunk oftested good C implementation?google doesn't tell you about that, google just reports whatever comes into the search key (which means, up to the 90% is … useless)and I have no time, at least not now, to implement/test/check thingsI am late, deadline coming, because my job-colleagues haven't done their homeworkthank you the same

author: larsdenmark
author_rank: Regular Contributor
timestamp: January 27, 2016, 11:57:47 pm
content: If you are in a hurry then you most likely best off using an implementation of the FFT where you most likely will be able to find a fast generic implementation or specific optimized versions for your particular hardware. You can calculate the Hartley transform from a FFT. Note that the memory requirement of the FFT is twice as high, though.Even if you do find an implementation of the Fast Hartley Transform that suits you, you will need to verfify that it works and then you'll need a method based on the FFT.

author: KE5FX
author_rank: Super Contributor
timestamp: January 28, 2016, 12:38:47 am
content: One important point that people seem to overlook in the FHT articles is thatyou don't have to zero out the complex elements when passing real input to an FFT. You can stuff the next buffer full of real samples into the imaginary fields. I've never needed to do this, but I'd probably look at it before resorting to a nonstandard transform.

author: krapht
author_rank: Contributor
timestamp: January 29, 2016, 08:15:15 pm
content: A well optimized FFT implementation is equally as fast as the FHT, even with purely real inputs. There are optimization tricks you can do so that the complex computation is not wasted. I don't remember exactly how, though, but I know there is literature out there about it.

author: confusedElectron
author_rank: Newbie
timestamp: February 03, 2016, 09:29:37 pm
content: Some time ago I used this code:http://vtchl.uiuc.edu/node/557,which is based on this library:http://wiki.openmusiclabs.com/wiki/ArduinoFHT,in order to implement a simple spectrum analyser on an Arduino board.At the time I was just looking for something that worked, but as the guy above me noted, the FHT is not necessarily faster than a FFT specialized in processing real inputs. Take a look at this link:http://www.fftw.org/doc/The-Discrete-Hartley-Transform.html

author: Marco
author_rank: Super Contributor
timestamp: February 07, 2016, 07:26:32 pm
content: There are ways to use a normal FFT for real Fourier transform as well, you can efficiently do two transforms at the same time or do a 2N point real transform with a N point FFT.TI has a lot of code (which I did use, around 2 decades ago).

author: legacy
author_rank: Super Contributor
timestamp: February 07, 2016, 07:35:22 pm
content: thank you, guys, at the end of the week (friday and saturday, a few days ago), I have git-pulled a cool FFT implementationI have recycled my old code, and spent my time trying to optimize and adapt it: luckily with great results at the endthis, after I explained to my colleagues that FFT is as fast as the Fast Hartley Transformthank you to have pointed it out