1

I'm working through examples in Oppenheim and Willsky's Signals and Systems 2nd Edition, and I'm having trouble with taking the Discrete Time Inverse Fourier Transform of a periodic impulse train being used as a Discrete Time Fourier Transform (DTFT) of a Discrete Time periodic signal to get back to the original signal. I reasoned that the Inverse DTFT should be able to get back to the original signal which the book shows is possible symbolically which I will show a bit later on, but first let me lay out some of the groundwork that was used to get to the problem. I shall post equations, images, and code below:

  1. IDTFT = $x[n] = \frac{1}{2\pi} \int_{2\pi}X(e^{j\omega})e^{j\omega n}d\omega$
  2. DTFT = $X(e^{j\omega}) = \sum_{n=-\infty}^{n = +\infty}x[n]e^{-j\omega n}$

We are presented with the periodic signal:

$x[n] = e^{j\omega_0 n}$

Which when plugged into the Discrete Time Fourier Transform equation in equation 2 above we get:

$X(e^{j\omega}) = \sum_{n=-\infty}^{n = +\infty}e^{j\omega_0 n}e^{-j\omega n} = \sum_{n=-\infty}^{n = +\infty}e^{j(\omega_0-\omega)n} = \sum_{l=-\infty}^{l = +\infty}2\pi\delta{(\omega-\omega_0-2\pi l)}$(Eqn. 5.18)

The following code was used to replicate the Fourier Transform representation of the function as an impulse train:

L = 5; len_ninf = 101;

n_inf = linspace(-L,L,len_ninf);

omega = 2*pi .* n_inf; omega_o = 2*pi/((length(n_inf)-1)/10);

x = exp(1j.*omega_o.*n_inf);

scatter(n,real(x)); stem(n,real(x));

enter image description here

l = -500:1:500;% some harmonic

impulsetrain = zeros(1,length(omega));

for i = 1:length(omega)

for j =1:length(l)

if round(((round(omega(i),2)- round(omega_o,2)) -2*round(pi,2)*l(j))/1000,4)==0

impulsetrain(i) = 2*pi*1;

end

end

end

scatter(omega,impulsetrain); stem(omega,impulsetrain);

Impulse Train representation of DTFT of x[n] Where we can see each impulse at $\omega = \omega_0 +/- 2n\pi$

So we've created the impulse train (being a DTFT representation of x[n]) and a reference image of x[n]. Going back to the book showing that the IDTFT can be used to get back to original signal, according to the said source, x[n] was run through equation 1 to get:

$x[n] = \frac{1}{2\pi} \int_{2\pi}X(e^{j\omega})e^{j\omega n}d\omega = \frac{1}{2\pi} \int_{2\pi}\sum_{l=-\infty}^{l = +\infty}2\pi\delta{(\omega-\omega_0-2\pi l)}e^{j\omega n}d\omega$

And following from the textbook it states, "Note that any interval of length $2\pi$ includes exactly one impulse in the summation given from eq. (5.18). Therefore, if the interval of integration chosen includes the impulse located at $\omega_0 + 2\pi r$, then"

$\frac{1}{2\pi} \int_{2\pi}X(e^{j\omega})e^{j\omega n}d\omega = e^{j(\omega_0+2\pi r)n} = e^{j\omega_0 n}$

and that is exactly what I would like to show by running the impulse train through the IDTFT equation in equation 1, to prove this result. The following code below was used to do this:

del_omega = (omega(length(omega))-omega(1))/(length(omega)-1);

LeftBound = 0; RightBound = 2*pi + LeftBound; %Set Left bound to whatever multiple of del_omega you'd like

range = find(round(omega,2) == round(LeftBound,2)):find(round(omega,2) == round(RightBound,2));

x_dift = zeros(1,length(n_inf(range)));

for i = 1:length(n_inf(range))

x_dift(i) = 1/(2*pi) * trapz(omega(range),impulsetrain(range).*exp(1j*n_inf(range(i)).*omega(range))); % performs integration over range of 2 pi

end

scatter(n_inf(range),real(x(range)));stem(n_inf(range),real(x(range)));hold on

scatter(n_inf(range),real(x_dift));stem(n_inf(range),real(x_dift));xlabel('n');ylabel('x[n]');title('x[n]_1 and x[n]_2 vs n');legend x[n]_{original} x[n]_{DTIFT}

plot of x[n] original in blue vs x[n]_IDTFT in orange

Doing a quick calculation just to verify the results from the for x[n] after the DTIFT, I got:

$x[0] = \frac{1}{2\pi} \int_0^{2\pi} \sum_{l=-\infty}^{l = +\infty}2\pi\delta{(\omega-\omega_0-2\pi l)}[range]*e^{j\omega * 0}d\omega = \int_0^{2\pi} [0,2\pi,0,0,0,0,0,0,0,0,0] * 1 d\omega$ with the $\omega$ values that we are integrating over are: $\omega = $[0,$\frac{\pi}{5}$,$\frac{2\pi}{5}$,$\frac{3\pi}{5}$,$\frac{4\pi}{5}$,$\pi$,$\frac{6\pi}{5}$,$\frac{7\pi}{5}$,$\frac{8\pi}{5}$,$\frac{9\pi}{5}$,$2\pi$] and where the bracketed list inside the equation above is the values of the impulse train over the range from 0 to $2\pi$.

and writing this computation using Matlab's build in Trapezoidal Rule algorithm we get:

Trapezoidal Rule: $\int_a^b f(x)dx \approx \frac{b-a}{2N} \sum^N_{n=1}(f(x_n) + f(x_{n+1}))$

where $\frac{b-a}{2N}$ is 1/2 spacing between each point. In our case, this constant is $\frac{2\pi - 0}{2*(11-1)} = \frac{\pi}{10}$.

$x[0] =\frac{1}{2\pi}*\frac{\pi}{10}(((0*1) + (2\pi*1)) + ((2\pi*1) + (0*1)) + 0 + 0 + 0 + 0 + 0 + 0 + 0) = \frac{4\pi^2}{10\pi} = \frac{\pi}{5} = .628$

This matches up with the first result seen in the plot at the first indice. Any further sample calculations would be a replication of the first computation seen above, but with the exponential which the impulsetrain values are being multiplied by would no longer be 1, and instead be relatively close to, and smaller than 1 and also decay at a slow rate as the index, n, increases which would replicate the results seen in the plot.

Overall, we can see that the resulting values from the IDTFT in orange are under where they are supposed to be and I've verified the results, so unless there is some special step that needs to be performed for certain signals like this impulse train, I'm not sure what it is that went wrong. Just out of curiosity, I tried increasing the number of values inside the range of the interval of $2\pi$ by reducing the $\Delta\omega$ because, from experience, the more values being input for a Fourier Transform, the more accurate the results, but it didn't work in this Discrete Time example like it did with Continuous Time Fourier Transforms and its inverse counterpart. In fact, the values actually decreased by a factor equal to the factor that I increased the number of values by. Specifically, I went from having 101 omegas to 1001 omegas, and the results were the exact same but divided by 10 i.e. the value at x[0] went from $\frac{\pi}{5}$ to $\frac{\pi}{50}$ and so on. I'd like to know why I am unable to get to the same amplitude using the methodology laid out in the textbook, but am at a loss.

Hopefully, someone has some insights into working with an impulse train and can perhaps help me out. Also, I apologize for the not so great formatting of the summation and integrals in LaTeX.

EDIT: I made a mistake in the summation for the formula for x[n] and x[0]. I meant to iterate by l, and not n. The correction was added.

EDIT 2: I found that I made another mistake in the calculation for x[0]. Where I plugged in for $\frac{b-a}{2N} = \frac{\pi}{10}$ I accidentally used $\frac{\pi}{5}$. I have corrected the mistake and now the result for x[0] is correct. I have also made a few other grammatical fixes.

EDIT 3: Saw I made another mistake in writing out the formula for x[n]. It was where I put n as the term for iteration in the summation for the impulse train term instead of l. The mistake has been fixed. Also the computation that I performed by hand for x[0] was very likely an incorrect methodology of computation, however it coincidentally worked here. Did not work for x1 and so on.

EDIT 4: Fixed a mistake in the coding. Also the plot should have more points than the one shown for x

  • I think I have made an important discovery on this problem. I've been thinking about what would need to happen to get x[0] to be 1 as a start for thinking of what to try next, but it appears to be impossible on the face of it due to the formula for a finite integral always resulting in some multiple of pi which therefore cannot = 1 which is the correct value at x[0]. The result at n=0 for x[n] is therefore constrained to this which is essentially 1/2 of the delta between each omega which cannot be manipulated to obtain the desired result in a finite scheme. – Researcher R Jan 21 '23 at 04:10
  • I'm thinking of answering my own question and qualifying the idea that it's impossible to do this in a finite scheme unless anyone has anything else to add? Either that or I'll be making another post asking if it's possible to do this in a more open-ended manner. – Researcher R Jan 21 '23 at 04:11

0 Answers0