# Goertzel Reverse

• November 25th 2009, 12:22 AM
Andrew007
Goertzel Reverse
Hi guys. This is probably a stupid question. If so, I guess at least it will be easy to answer quickly (Happy)

I have created a discrete power spectrum by running a Goertzel algorithm repeatedly. It does not have a window function. The algorithm was run over the normalised frequency range [0.01, 0.99]. The input sample only has 5 values.

The implementation is standard, from here:
Frequency Detection

However I am scratching my head trying to figure out a way to calculate the reverse DFT using a similar algorithm. IE. I want to go from the spectrum back to the time domain.

Intuitively it seems that it should be possible to construct a 'reverse Goertzel', but I can't see an obvious way. What do you think?

P.S. I can provide source code and output info if it helps. I'm guessing the algorithm is irreversible since it discards some info while running (the 'd2' variable in the linked example)..
• November 25th 2009, 05:46 PM
Andrew007
I have tried reconstructing using a formula like:

$1/N \sum r(f) . cos(2 \pi\ f) + i(f) . sin(2 \pi\ f)$

..where r() is the real part and i() is the imaginary part, however I just get garbage back.

Does anyone have ideas regarding how to inverse a power spectrum?