Mirroring signal before fft

I have inherited some code that mirrors a signal before taking the discrete Fourier transform of it, essentially like this:

signal = vcat(reverse(signal), signal)
# windowing and padding operations ...
sig = fft(signal)

I can imagine that this would have no effect on a perfect sinusoidal signal that is sampled at exactly one period. How might this affect other kinds of signals, such as high frequency components modulated on an exponential decay? Is there a reason to do this kind of mirroring before taking the discrete Fourier transform?

It’s equivalent to a discrete cosine transform, or at least similar (depending on what kind of padding etc you do).

1 Like

Also of interest this abstract on FFT input data flipping

Thanks stevengj and rafael.guerra for the responses. This has opened up some lines of inquiries.