I'm working on a simple FFT implementation and currently running some unit tests. Long floating point numbers in C and assembly become very hard to keep track of, and this whole thing is error prone. I was able to some up (purely experimentally) with a few 4-tap and 8-tap arrays whose DFT is all whole numbers. I'm only testing DFT arrays of length $2^N$, and I could, of course, repeat my shorter signals several times until I achieve desired length, but this would give me a whole bunch of zeros, and that's not a good thing to test for. In summary, I need to come up with signals that satisfy the following:
- Signals are of length $2^N$
- Coefficients of both the signal and its DFT must be whole numbers
- Signals are real
- Signals must not consist mainly of zeros
Could there be a general way of coming up with such things?
To explain number 4 above, let me demonstrate what I mean with an example. I don't want a situation in that was produced by repeating something that has a known integer DFT several times.DFT of
[1 5 -1 0] is
[5 2-5i -5 2+5i]. If you simply repeat
[1 5 -1 0] four times to get
[1 5 -1 0 1 5 -1 0 1 5 -1 0 1 5 -1 0],
its DFT would be
[20 0 0 0 8-20i 0 0 0 -20 0 0 0 8+20i 0 0 0].
This shows that repeating something many times does not add any new non-zero integer numbers to the DFT. This procedure simply inserts zeros between existing DFT coefficients (and scales them depending on definition of the transform). This isn't of much help. So zeros are welcome, but not the zeros achieved this way.