Do DCT results contain phase spectrum?

I've been working much with numpy.fft lately where just like the documentation says:

When the input a is a time-domain signal and A = fft(a), np.abs(A) is its amplitude spectrum and np.abs(A)**2 is its power spectrum. The phase spectrum is obtained by np.angle(A).

Then I took a look at DCT, but I could not figure out how to derive the phase from the results, because only real values are contained, so the np.angle() will be $0$. From the FFT results I can take out interesting elements, calculate amplitude, phase and plot them as cosines:

[A*np.cos(2*np.pi*f*t + ph) for t in range(N)]


where A is the amplitude, f is the frequency, ph is the phase-shift and t is the variable, i.e. time. So my question is: can the same be derived from DCT results and how?

• Delta = p1 ~p2 - (p<--i -1) In same place May 7, 2017 at 18:32
• @hassani What exactly are trying to suggest here? Please explain what you wrote. May 8, 2017 at 20:47
• @hassani Sounds cryptic May 8, 2017 at 21:23

2 Answers

A DCT is equivalent to a DFT of real data that is doubled and mirrored, thus rendering it symmetric. The DFT of any symmetric real signal has a phase of zero (its all cosines, no antisymmetric sine components).

• Does this mean that DCT assumes that all cosines start at (0, Ak) where Ak is the component's amplitude? May 7, 2017 at 18:38
• Only cosine that starts at 0 with a phase of 0 (or Pi) is symmetric around 0. Sep 6, 2017 at 20:50

Not really, as the transform is real. However, one could interpret the sign as a poor man's phase, being "quantized" or restricted to values $0$ or $\pi$. In other words, $1 = 1.e^{0.\imath}$ and $-1 = 1.e^{\pi.\imath}$.

[EDIT] There are some instances where people use the sign of DCT or (real) wavelet coefficients, for subpixel image registration or matching, as alluded to in DCT Sign Only Correlation and Its Application to Image Registration:

In the DCT case, all DCT coefficients are real values, as a result, the phase information corresponds to the sign of DCT coefficients.