I would assume you perform the calculations the same way, but since there would be no imaginary component because the signal is not complex it would be simpler:

magnitude = |x(n)|

power = |x(n)|^2

phase = 0 (for all values of n) - since there's no imaginary portion the phase equation would always result in a 0 value.

I'm trying to fully grasp and internalize some of the basic concepts of signal processing, and while I haven't ever really seen anyone try to use the equation for phase on a time-domain signal I don't see why it wouldn't be valid even if the results don't have much meaning.

  • $\begingroup$ If you're going to downvote my question please provide a comment with some feedback on why it is not a good question. I am still a novice at digital signal processing so sometimes it is hard to even know why a question may be silly to ask. I did search quite a bit on google to try and find the answer to this question with no luck before posting it. $\endgroup$ Aug 11 '19 at 18:17
  • $\begingroup$ I didn't downvote your question, but I have a suggestion: don't try to learn by googling. Get a good textbook (there are many excellent free as pdf online) and read it. If you do that, you'll very quickly see that your questions don't make a lot of sense. $\endgroup$
    – MBaz
    Aug 12 '19 at 1:19
  • $\begingroup$ @MBaz, I have Understanding Digital Signal Processing by Richard G. Lyons. The book is pretty great but this specific kind of question isn't really directly answered. He just shows how to calculate phase in the frequency domain but it's never clear whether you can have some sort of meaningful phase calculation in the time-domain. $\endgroup$ Aug 12 '19 at 2:30
  • $\begingroup$ @MBaz, I guess what I was trying to get at with this question is regardless of whether you are in the time-domain or in the frequency-domain, a signal is still a signal. So to me it just seems to make sense that if magnitude and power can be calculated on any signal regardless of domain, why wouldn't you also be able to calculate phase? $\endgroup$ Aug 12 '19 at 2:39
  • $\begingroup$ Actually after looking at the answer below, it looks like the book may provide this information, but much further than I have gotten. It looks like the chapter on the Hilbert Transform may clarify quite a bit! $\endgroup$ Aug 12 '19 at 3:05

No, this doesn't make much sense. What you can do in the time domain is compute the analytic signal and derive the signal's instantaneous amplitude (envelope) and its instantaneous phase from it.

Take as an example


The corresponding analytic signal is


Its instantaneous amplitude (envelope) is $\big|x_a[n]\big|=A$, and its instantaneous phase is $\arg\{x_a[n]\}=\omega_0n+\theta-\pi/2$.

  • $\begingroup$ Okay this is somewhat over my head, but it seems like what I was looking for. I will read up on analytic signals and see what I can find! $\endgroup$ Aug 12 '19 at 2:37
  • $\begingroup$ is $x_a[n]$ the analytical signal or is it the Hilbert transform of $x[n]$? what, exactly is $x[n]$? is it $x[n]=A \, e^{j (\omega_0 n + \theta)}$ with $\omega_0 > 0$? if $x[n]$ is that, then the analytic signal is twice $x[n]$. not $-j$ times it. $\endgroup$ Aug 12 '19 at 5:06
  • $\begingroup$ perhaps $x[n] = A \cos(\omega_0 n + \theta)$ and $x_a[n] = A \, e^{j(\omega_0 n + \theta)}$ . is that what it should be? $\endgroup$ Aug 12 '19 at 5:16
  • $\begingroup$ @robertbristow-johnson: I understand your confusion. I took $x[n]$ from Stanley's (now deleted) answer, and for some reason I thought it was also given in the question, but it wasn't. I'll add more information to my answer. $\endgroup$
    – Matt L.
    Aug 12 '19 at 6:58
  • $\begingroup$ oh, ick. why would you do $\sin(\cdot)$ and get the $-j$ factor? and that extra $-\pi/2$ phase term? $\endgroup$ Aug 12 '19 at 8:11

If you have a finite-sized window of data whose center is reference to some known time stamp, position, or event (e.g. the center of an image, known delay after some positive zero-crossing of some stimulus, etc.), the phase in the time domain makes sense, and is an easy calculator.

If you decompose your time-domain signal into an even part (symmetric around the window center) and an odd part (anti-symmetric around the window center), and measure the energy of each, then phase is simply atan(odd_energy, even_energy), or atan2(signed_odd_correlation, signed_even_correlation).

If you further decompose your signal into spectral bands, say by bandpass filtering with a Goertzel filter, then each band will be decomposable into an even and odd waveform, thus has a phase. Enough Goertzel filters, and you end up with a DFT. With only time domain filtering and odd/even decomposition.

Exercise for the student: look up how to decompose any (non-pathological) waveform into an even waveform and and odd waveform. Then you have your phase.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.