Remember that we defined the Fourier transform as the limit of the Fourier series of periodic signal, when the period tends to infinity. A periodic signal can also be viewed as the repetition of a basic pattern. This enables to give a link between Fourier series and transform. Let x(n) be a periodic function with period L0. Then
x(n)=+∞∑m=−∞xL0(n−mL0),where xL0(n) is the basic pattern with length L0. x(n) being periodic, it can be expressed using a Fourier series, as x(n)=L0−1∑n=0ckej2πkf0n, where f0=1/L0 and ck=1L0∑[L0]xL0(n)e−j2πkf0n. From this relation, we immediately have
ck=1L0XL0(kf0),where XL0(f) is the Fourier transform of the pattern xL0(n). Hence
x(n)=+∞∑m=−∞xL0(n−mL0)=1L0L0−1∑k=0XL0(kf0)ej2πkf0n.From that, we deduce that the Fourier transform of x(n) writes FT{x(n)}=1L0L0−1∑k=0XL0(kf0)FT{ej2πkf0n}, that is
X(f)=FT{x(n)}=1L0L0−1∑k=0XL0(kf0)δ(f−kf0).Hence, we see that the Fourier transform of a periodic signal with period L0 is constituted of a series of Dirac impulse, spaced by f0, and whose weights are the Fourier transform of the initial pattern, taken at the respective frequencies.
Taking xL0(n)=δ(n), we obtain the first Poisson's formula:
+∞∑m=−∞δ(n−mL0)=1L0L0−1∑k=0ej2πkf0n.The series of delayed Dirac impulses is called a Dirac comb. It is often denoted
шL0(n)=+∞∑m=−∞δ(n−mL0).Taking the Fourier transforms of the two sides of (8), we obtain
+∞∑m=−∞ej2πfmL0n=1L0L0−1∑k=0δ(f−kf0);that is the second Poisson's formula:
+∞∑m=−∞δ(n−mL0)⇌1L0L0−1∑k=0δ(f−kf0).This last relation shows that the Fourier transform of a Dirac comb is also a Dirac comb, these two combs having an inverse spacing.
## DO IT YOURSELF...
#DiracComb=
#DiracComb_f=fft(DiracComb)
#etc
N = 200
L0 = 5
DiracComb = np.zeros(N)
DiracComb[::L0] = 1
DiracComb_f = fft(DiracComb)
plt.stem(DiracComb)
plt.ylim([0, 1.1])
plt.xlabel("Time")
plt.figure()
f = np.linspace(0, 1, N)
plt.stem(f, 1 / N *
abs(DiracComb_f)) # Actually there is a factor N in the fft
_ = plt.ylim([0, 1.1 * 1 / L0])
plt.xlabel("Frequency")
We may now go back to the exploration of the links between Fourier series and transform, using the second Poisson formula (11).
Convolution with a delayed Dirac impulse - Let us first look at the result of the convolution of any function with a delayed Dirac impulse: let us denote δn0(n)=δ(n−n0). The convolution [x∗δn0](n) is eq given by
[x∗δn0](n)=∑mx(m)δn0(n−m)=∑mx(m)δ(n−m−n0)=x(n−n0)where the last relation follows by the representation formula. Hence
# DO IT YOURSELF!
#DiracComb=
#pulse=
#...
#z=np.convolve(DiracComb,pulse)
#plt.stem(...)
N=400; L0=20; L=6 # L is the length of the pulse
DiracComb=np.zeros(N)
DiracComb[::L0]=1
pulse=np.zeros(40); pulse[0:L]=1 #or range(L) # <<--
z=np.convolve(DiracComb,pulse)
plt.stem(z[0:100])
plt.title('Convolution with a Dirac comb')
plt.xlabel('Time')
We see that the convolution with the Dirac comb effectively periodizes the initial pattern. In the case where the support L of the pulse if larger than the period L0 of the comb, then the result presents aliasing between consecutive patterns (but the resulting signal is still periodic).
Effect in the frequency domain - In the frequency domain, we know, by the Plancherel theorem, that the product of signals results in the convolution of their Fourier transforms (and vice versa). As a consequence, x(n)=[xL∗шL0](n)⇌XL(f).FT{шL0(n)}. Since the Fourier transform of a Dirac comb is also a Dirac comb, we obtain that x(n)=[xL∗шL0](n)⇌XL(f).1L0ш1L0(f), or X(f)=XL(f).1L0ш1L0(f)=1L0∑kXL(kf0)δ(f−kf0), with f0=1/L0. We see that the Fourier transform of the periodized signal is the product of the Fourier transform of the initial pattern with a Dirac comb in frequency. Hence, periodization in the time domain results in a discretization of the frequency axis, yielding a Fourier transform constituted of spectral lines. Observe that the amplitudes of the spectral lines coincide with the Fourier series coefficients. hence it is immediate to find the Fourier series coefficients from the Fourier transform of the periodized pattern.
Continue the exercise 2 by an analysis of what happens in the Fourier domain: compute the Fourier transforms of the original and periodized signals and compare them on the same plot. The Fourier transform of the periodized signal should be computed without zero padding, ie exactly on N points.
You will have to introduce a factor to account for the fact that there is more signal in the periodized one yan in the initial - the factor to consider is simply the number of periods.
#
N = 200
MM = 2000 #for zero padding
plt.figure()
f = np.linspace(0, 1, MM)
fn = np.linspace(0, 1, N)
#
# FILL IN HERE
#
plt.title('Fourier transform of original and periodized pulses')
_ = xlabel('Frequency')
%matplotlib inline
N = 200
L0 = 20
L = 12 # L is the length of the pulse
DiracComb = np.zeros(N)
DiracComb[::L0] = 1
pulse = np.zeros(40)
pulse[0:L] = 1 #exp(-0.3*arange(L))
z = np.convolve(DiracComb, pulse)
plt.stem(z[0:200])
plt.title('Periodized signal')
plt.xlabel('Time')
#
MM = 1000
plt.figure()
f = np.linspace(0, 1, MM)
fn = np.linspace(0, 1, N)
plt.plot(f, 10 * abs(fft(pulse, MM)), label="FT original signal")
plt.stem(fn, abs(fft(z, N)), '-or', label="FT periodized signal")
plt.legend()
plt.title('Fourier transform of original and periodized pulses')
_ = xlabel('Frequency')