Using Fast Hartley Transform with Nyquist?

Hi Steve,

You have often commented on this forum that doing FFT in Nyquist is a pain.
Would FHT make it any easier/quicker?

FHT is similar to FFT, however it only uses real numbers (no phase) thus cutting down on complexity and compute time.

Not using phase information, may be limiting in some situations, but in others it 's OK.

Your thoughts?

Thanks.

It may be slightly simpler (if you understand enough of the maths to write it in Lisp), but it is likely to be much slower. Nyquist has FFT and IFFT functions built in, written in C (programming language), but does not have FHT built in. Having FFT and IFFT built in means that most of the number crunching is done much more efficiently. Whichever you used, you would probably need to write DSP classes, which is a lot more complex than simple LISP loops.

There’s a section in the XLISP manual about Object Oriented Programming here: https://www.audacity-forum.de/download/edgar/nyquist/nyquist-doc/xlisp/xlisp-obj/xlisp-obj-001.htm

and there’s an FFT tutorial in the documentation for the stand-alone version of Nyquist “demos/fft_tutorial.htm”

Hi Steve.

The idea of using classes at the moment is like starting to learn Xlisp all over again.
Maybe in time.

What you say about the built in C code for FFT and it’s speed, makes perfect sense.
I suspect then, that implementing some form of FHT is better suited for small embedded devices that may for example
need to show a spectrum analysis or do filtering but have limited resources.
Found an interesting library for the Arduino.

http://wiki.openmusiclabs.com/wiki/ArduinoFHT
and here:
https://www.instructables.com/Fast-Hartley-Transform-Spectral-Stethoscope/

Have downloaded “fft_tutorial.htm” and will go over it.

Thanks for your input.

I suspect then, that implementing some form of FHT is better suited for small embedded devices that may for example
need to show a spectrum analysis or do filtering but have limited resources.

Yes, from what I understand that’s why it’s preferred on the Arduino.

But I assume FHT would also be faster/easier than FFT on a computer if implemented in C/C++ (or other compiled language).

But I assume FHT would also be faster/easier than FFT on a computer if implemented in C/C++ (or other compiled language).

That would be my guess as well, compiled will always be orders of magnitude faster.
However, came across something quite interesting, a html5 based spectrum analyzer.
No doubt it’s also using javascript, but that is not compiled either, at least not from my understanding.

I didn’t check what transform it’s using, but based on it’s popularity, I would guess it’s FFT.
So assuming that FHT is quicker than FFT, wondering just how much slower a FHT implementation (especially on short sections)
using an interpreted language would actually be.

https://audiomotion.dev/demo/minimal.html

EDIT:

Also just found this:

Looks very interesting, especially since it can be done in a web browser.