1

It is known that the discrete-time Fourier transform (DTFT) of a complex exponential $$ x[n] = e^{j\omega_0 n} $$ is $$ X(e^{j\omega}) = 2\pi \sum_{k = -\infty}^{\infty} \delta(\omega - \omega_0 + 2\pi k) $$

but what about the phase $\angle{X(e^{j\omega})}$?

Matt L.
  • 89,963
  • 9
  • 79
  • 179
  • 1
    $X(e^{j\omega})$ is not just the magnitude, it is the complete Fourier transform, so it has a magnitude and a phase. What exactly is your problem when trying to determine the phase? – Matt L. Dec 12 '23 at 19:37
  • It's actually sorta a subtle thing. The OP never said anything about phasors. I know that the magnitude of $0$ is 0 and the phase is undefined and so also is the magnitude of $\delta(0)$ is undefined. I suspect the phase is undefined, but it might be 0. – robert bristow-johnson Dec 12 '23 at 20:33
  • @MattL. I want to find the phase, since it is defined as the $$tan^{-1}(Im{X}/Re{X}))$$ the problem seems to be with the dirac function. What is also intriguing is that MATLAB also seems not to get it right. – Sami Al-Dalahmah Dec 12 '23 at 21:59
  • Sami, you should consider the phase of a nascent delta function. Then see how much the phase changes as the width of the nascent delta function goes to zero. – robert bristow-johnson Dec 12 '23 at 23:16

3 Answers3

2

Let's not overcomplicate things here. There's nothing imaginary about a Dirac delta impulse. If $\phi(x)$ is a real-valued test function, continuous at $x=x_0$, we have

$$\int_{-\infty}^{\infty}\delta(x-x_0)\phi(x)dx=\phi(x_0)\tag{1}$$

which is still real-valued.

Also, note that $x[n]$ is conjugate symmetric:

$$x[n]=e^{j\omega_0 n}=x^*[-n]\tag{2}$$

which implies that its DTFT must be real-valued.

Matt L.
  • 89,963
  • 9
  • 79
  • 179
1

I think I got the answer. As stated before, the DTFT for $x(n) = e^{j\omega_0 n}$ is $X(\omega) = \delta(\omega - \omega_0)$ ofr $\omega \in [-\pi,\pi]$. For the sake of discussion let the signal be $y(n) = e^{j\omega_0 n+\theta}$ which has the DTFT of $Y(\omega) = e^{j\theta}\delta(\omega - \omega_0)$ when restricted infor $\omega \in [-\pi,\pi]$. Following the definition of the phase we arrive at

$$ \angle{Y(\omega)} = \angle{e^{j\theta}\delta(\omega - \omega_0)} = \theta \delta(\omega - \omega_0) \\ = \begin{cases} \theta,& \omega = \omega_0 \\ 0,&\omega \neq \omega_0 \end{cases}$$ where $\omega \in [-\pi,\pi]$.

Now for our original signal, $x(n)$ the DTFT phase is zero everywhere since $\theta = 0$.

-2

Let's work out the Fourier transform. If I have a complex exponential in the time domain, as you noted, after this is

\begin{equation}x[n] = e^{j2\pi \frac{k_{0}n}{N}}\end{equation}

The Fourier transform of this complex exponential is

\begin{equation}X[k] = \sum_{n=0}^{N-1}e^{j2\pi \frac{k_{0}n}{N}}e^{-j2\pi \frac{kn}{N}} = \sum_{n=0}^{N-1}e^{j2\pi \frac{(k_{0}-k)n}{N}} \propto \delta(\frac{k_{0}-k}{N})\end{equation}

Now, let's apply a phase shift to the time domain signal. We get

\begin{equation}x'[n] = e^{j(2\pi \frac{k_{0}n}{N} + \phi)} = e^{j\phi}e^{j2\pi \frac{k_{0}n}{N}}\end{equation}

The DFT of this is

\begin{equation}X'[k] = \sum_{n=0}^{N-1}e^{j\phi}e^{j2\pi \frac{k_{0}n}{N}}e^{-j2\pi \frac{kn}{N}}\end{equation}

Because $e^{j\phi}$ is constant, we get

\begin{equation}X'[k] = e^{j\phi}\sum_{n=0}^{N-1}e^{j2\pi \frac{k_{0}n}{N}}e^{-j2\pi \frac{kn}{N}} \propto e^{j\phi}\delta(\frac{k_{0}-k}{N})\end{equation}

So, we get that the phase in the Fourier domain is the same as the phase offset in the time domain.

EDIT: As pointed out in the comments, I wrote the DTFT on the left hand side and the DFT on the right. This has been fixed.

This is also important, as noted in the comments, for figuring out the phase in the Fourier domain. The phase of the DTFT, and the phase of the DFT in which the signal is periodic within the DFT window, is equal to the phase offset in the time domain. For a signal that is aperiodic within the DFT window, there will be an unknown phase offset due to the assumed frequency content by the aperiodicity. However, the linearity property still applies and will produce an equal phase offset. This can be demonstrated by the Matlab code below:

fs = 10;
f = 1;
N = fs/f;
T = 1/f;
t1 = (0:N-1)*T;
t2 = (0:N+1)*T;
c1 = exp(1i*2*pi*f/fs*t1);
c2 = exp(1i*2*pi*f/fs*t2);
c3 = exp(1i*(2*pi*f/fs*t1 + pi/2));
c4 = exp(1i*(2*pi*f/fs*t2 + pi/2));

Taking the angles of each of the 4 complex exponentials, one will see that when the signal is periodic within the DFT window (c1 and c3), the phase is exactly equal to the phase offset in the time domain (at the frequency of interest, excluding rounding errors in the other values). Taking the angle of c2 and c4, there will be an unknown phase offset applied to the FFT sample of interest, but the phase difference between the two is proportional to the phase difference between the signals in the time domain.

Hope this clarifies some things.

EDIT 2: Adding the DTFT math per OP’s request.

If I have a complex exponential in the time domain, as you noted, it is defined as

\begin{equation}x[n] = e^{j\omega_{0}n}\end{equation}

The Fourier transform of this complex exponential is

\begin{equation}X(\omega)= \sum_{n=-\infty}^{\infty}e^{j\omega_{0}n}e^{-j\omega n} = \sum_{n=-\infty}^{\infty}e^{j(\omega_{0}-\omega)n} \propto \delta(\omega_{0}-\omega)\end{equation}

Now, let's apply a phase shift to the time domain signal. We get

\begin{equation}x'[n] = e^{j(\omega_{0}n+ \phi)} = e^{j\phi}e^{j\omega_{0}n}\end{equation}

The DFT of this is

\begin{equation}X'(\omega) = \sum_{n=-\infty}^{\infty}e^{j\phi}e^{j\omega_{0}n}e^{-j\omega n}\end{equation}

Because $e^{j\phi}$ is constant, we get

\begin{equation}X'(\omega) = e^{j\phi}\sum_{n=-\infty}^{\infty}e^{j\omega_{0}n}e^{-j\omega n} \propto e^{j\phi}\delta(\omega_{0}-\omega)\end{equation}

As you correctly noted, since it is a phase shifted dirac delta function, the phase is zero everywhere except the frequency of the complex exponential. This holds for the DTFT, and the DFT if the signal is periodic within the DFT window.

Baddioes
  • 733
  • 1
  • 6
  • what you shown is that linearity of the DTFT in general applies to the DTFT of the complex exponential. That implies that yes, shifting a time domain signal shifts its frequency domain by the same factor! but it doesn't tell us the phase of the unshifted signal, lest I'm missing something? – Marcus Müller Dec 12 '23 at 22:56
  • And the DFT is not really the same thing as the DTFT. Like you have $X(\omega)$ on one side of the = sign and no $\omega$ on the other side. – robert bristow-johnson Dec 12 '23 at 23:13
  • Both, please see the edits I added to my original answer. Thanks for your responses. – Baddioes Dec 13 '23 at 00:11
  • @Baddioes Thanks for your answer. The issue in not the phase of the complex exponential but its DTFT, which is the $\delta(\omega - \omega_0)$ when restricted in $[-\pi,\pi]$. – Sami Al-Dalahmah Dec 15 '23 at 05:50
  • 1
    @Sami Al-Dalahmah yes, the phase of the DTFT of the complex exponential at the frequency of interest $\omega$ is equal to the phase offset of the complex exponential in the time domain, and zero everywhere else. This was noted at the end of the original part of my answer, the line above the edit. It's important to note that when using the DFT, the periodicity of the complex exponential within the DFT window is crucial for this to hold. – Baddioes Dec 15 '23 at 07:31
  • I think what confused me was using MATLAB for getting the phase. I interpolated the DFT to get the DTFT, as stated in Section 3.3.1 [*]. I will post another question on using the DFT to get the DTFT.

    [*] Mitra, S. K. (2000). Digital signal processing (2nd ed.). New York, NY: McGraw-Hill.

    – Sami Al-Dalahmah Dec 15 '23 at 13:47