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 andnp.abs(A)**2
is its power spectrum. The phase spectrum is obtained bynp.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?