Salta al contenuto
Note per Studenti Discrete Fourier Transform Report

Discrete Fourier Transform

In questa pagina 5

Where the DFT fits

So far the four cases of Fourier analysis are organized as follows.

periodic aperiodic
continuous time Fourier series: an=1T∫[T]x(t)e−jω0ntdta_n=\frac1T\int_{[T]}x(t)e^{-j\omega_0nt}dt Fourier transform: X(jω)=∫−∞+∞x(t)e−jωtdt\mathcal X(j\omega)=\int_{-\infty}^{+\infty}x(t)e^{-j\omega t}dt
discrete time discrete Fourier transform (DFT), i.e. the discrete-time Fourier series not in this lecture

See Fourier TransformThe Fourier transform extends the Fourier series to aperiodic signals: intuitive derivation from a periodic square wave with growing period, definition of the transform and of its inverse, convergence results in L1 and L2 and the Plancherel and Parseval relation.Fourier Transform → for the continuous-time aperiodic case.

Periodic complex exponentials in discrete time

A complex exponential in discrete time is x(k)=ejθkx(k)=e^{j\theta k}. If we want it periodic of period NN we must enforce x(k+N)=x(k)x(k+N)=x(k):

ejθkejθN=ejθk ⟹ ejθN=1=ej2πn, ∀n∈Z ⟹ θN=2πn ⟹ θ=2πnN.e^{j\theta k}e^{j\theta N}=e^{j\theta k}\ \Longrightarrow\ e^{j\theta N}=1=e^{j2\pi n},\ \forall n\in\mathbb Z\ \Longrightarrow\ \theta N=2\pi n\ \Longrightarrow\ \boxed{\theta=\frac{2\pi n}N}.

So θ\theta cannot be an arbitrary frequency: θ/π∈Q\theta/\pi\in\mathbb Q.

How many distinct signals x(k)=ej2πnNkx(k)=e^{j\frac{2\pi n}Nk} exist? Taking n=0,1,…n=0,1,\dots:

  • n=0n=0: x(k)=1x(k)=1 for all kk;
  • n=1n=1: x(k)=ej2πNkx(k)=e^{j\frac{2\pi}Nk};
  • ⋮\vdots
  • n=N−1n=N-1: x(k)=ej2π(N−1)Nkx(k)=e^{j\frac{2\pi(N-1)}Nk};
  • n=Nn=N: x(k)=ej2πNNk=1x(k)=e^{j\frac{2\pi N}Nk}=1 for all kk (same as n=0n=0);
  • n=N+1n=N+1: x(k)=ej2π(N+1)Nk=ej2πNkx(k)=e^{j\frac{2\pi(N+1)}Nk}=e^{j\frac{2\pi}Nk} (same as n=1n=1);
  • and so on.

Only NN distinct signals ej2πnNke^{j\frac{2\pi n}Nk} exist. This is a finite-dimensional basis of complex exponentials. A discrete-time signal over one period can be written as a vector with finite components in CN\mathbb C^N: x⃗=[x(0)x(1)⋯x(N−1)]T.\vec x=\begin{bmatrix}x(0)&x(1)&\cdots&x(N-1)\end{bmatrix}^T . Define ψn(k):=ej2πnNk(n: frequency, k: time),ψ⃗n=[ψn(0)ψn(1)⋯ψn(N−1)]T.\psi_n(k):=e^{j\frac{2\pi n}Nk}\qquad(n:\text{ frequency},\ k:\text{ time}),\qquad\vec\psi_n=\begin{bmatrix}\psi_n(0)&\psi_n(1)&\cdots&\psi_n(N-1)\end{bmatrix}^T .

Can an NN-periodic signal be written with the ψn\psi_n?

Let x(k)x(k) be periodic of period NN. To answer, use linear difference equations: x(k)−x(k−N)=0(Δ).x(k)-x(k-N)=0\qquad(\Delta). Its characteristic polynomial is obtained through the delay operator z−1z^{-1}: 1−z−N=01-z^{-N}=0; multiplying by zNz^N: zN−1=0z^N-1=0, i.e. λN=1\lambda^N=1. Equations of the type λN=q\lambda^N=q, q∈Cq\in\mathbb C, are solved by writing q=ρejφq=\rho e^{j\varphi} and λN=ρ ej(φ+2πn) ⟹ λn=ρN ejφ+2πnN=ρ1/Nejφ/Nej2πnN.\lambda^N=\rho\,e^{j(\varphi+2\pi n)}\ \Longrightarrow\ \lambda_n=\sqrt[N]\rho\,e^{j\frac{\varphi+2\pi n}N}=\rho^{1/N}e^{j\varphi/N}e^{j\frac{2\pi n}N}. In our case q=1q=1, so ρ=1\rho=1, φ=0\varphi=0, and the roots are the NN-th roots of unity, equally spaced on the unit circle:

λn=ej2πNn,n=0,1,…,N−1:λ0=1, λ1=ej2πN, …, λN−1=ej2π(N−1)N.\lambda_n=e^{j\frac{2\pi}Nn},\quad n=0,1,\dots,N-1:\qquad\lambda_0=1,\ \lambda_1=e^{j\frac{2\pi}N},\ \dots,\ \lambda_{N-1}=e^{j\frac{2\pi(N-1)}N}.

         Im(lambda)
            |   . n=1
       .    |        
 ------+----+----o-----> Re(lambda)    (n=0 at lambda=1)
       .    |        
            |   . n=N-1
        unit circle, N equally spaced points

The solution of (Δ)(\Delta) is x(k)=c0λ0k+c1λ1k+⋯+cN−1λN−1kx(k)=c_0\lambda_0^k+c_1\lambda_1^k+\dots+c_{N-1}\lambda_{N-1}^k. The modes associated with (Δ)(\Delta) are exactly ψn(k)=λnk\psi_n(k)=\lambda_n^k, n=0,…,N−1n=0,\dots,N-1. A linear combination of the ψn(k)\psi_n(k) is a discrete-time signal that is periodic of period NN, so every NN-periodic signal is

x(k)=∑n=0N−1cnψn(k).x(k)=\sum_{n=0}^{N-1}c_n\psi_n(k).

The coefficients are found with linear algebra.

Linear-algebra setting

Let SNdtS_N^{dt} be the set of discrete-time signals that are periodic of period NN. There is an isomorphism (one-to-one bijection) SNdt↔CNS_N^{dt}\leftrightarrow\mathbb C^N. In this setting:

  • energy in SNdtS_N^{dt}: E[N][x]=∑k=0N−1∣x(k)∣2E_{[N]}[x]=\sum_{k=0}^{N-1}|x(k)|^2, which in CN\mathbb C^N is ∥x⃗∥2\|\vec x\|^2;
  • mutual energy: E[N][x1,x2]=∑k=0N−1x1(k)x2(k)‾E_{[N]}[x_1,x_2]=\sum_{k=0}^{N-1}x_1(k)\overline{x_2(k)}, which in CN\mathbb C^N is ⟨x⃗1,x⃗2⟩=x⃗2 ∗x⃗1\langle\vec x_1,\vec x_2\rangle=\vec x_2^{\,*}\vec x_1.

Orthogonality of the harmonic exponentials

The set of discrete-time complex exponentials in harmonic relation {ψn(k)}n=0N−1\{\psi_n(k)\}_{n=0}^{N-1} is orthogonal and can form an orthogonal basis of SNdt↔CNS_N^{dt}\leftrightarrow\mathbb C^N:

⟨ψ⃗n,ψ⃗m⟩=∑k=0N−1ψn(k)ψm(k)‾=∑k=0N−1ej2πnNke−j2πmNk=∑k=0N−1ej2πN(n−m)k={0,n≠mN,n=m.\langle\vec\psi_n,\vec\psi_m\rangle=\sum_{k=0}^{N-1}\psi_n(k)\overline{\psi_m(k)}=\sum_{k=0}^{N-1}e^{j\frac{2\pi n}Nk}e^{-j\frac{2\pi m}Nk}=\sum_{k=0}^{N-1}e^{j\frac{2\pi}N(n-m)k}=\begin{cases}0,&n\ne m\\N,&n=m.\end{cases}

Case n≠mn\ne m. Let i:=n−mi:=n-m. With the finite geometric sum ∑ℓ=0Mqℓ=1−qM+11−q\sum_{\ell=0}^{M}q^\ell=\frac{1-q^{M+1}}{1-q} for all q≠1q\ne1 (here q=ej2πNi≠1q=e^{j\frac{2\pi}Ni}\ne1, M+1=NM+1=N): ∑k=0N−1ej2πNik=1−ej2πNi N1−ej2πiN=0.\sum_{k=0}^{N-1}e^{j\frac{2\pi}Nik}=\frac{1-e^{j\frac{2\pi}Ni\,N}}{1-e^{j\frac{2\pi i}N}}=0 . Case n=mn=m: each term is ej2πnNke−j2πnNk=1e^{j\frac{2\pi n}Nk}e^{-j\frac{2\pi n}Nk}=1, so the sum is NN. #\#

Therefore ⟨ψ⃗n,ψ⃗m⟩=N δ(n−m)\langle\vec\psi_n,\vec\psi_m\rangle=N\,\delta(n-m) (orthogonality condition ψ⃗n⊥ψ⃗m\vec\psi_n\perp\vec\psi_m for n≠mn\ne m).

By the representation lemma the coefficients are cn=⟨x⃗,ψ⃗n⟩⟨ψ⃗n,ψ⃗n⟩=1N∑k=0N−1x(k) e−j2πnNk,c_n=\frac{\langle\vec x,\vec\psi_n\rangle}{\langle\vec\psi_n,\vec\psi_n\rangle}=\frac1N\sum_{k=0}^{N-1}x(k)\,e^{-j\frac{2\pi n}Nk}, where the denominator is NN.

Definition of the DFT

This was a heuristic derivation of the discrete Fourier transform.

Definition (DFT). Given a discrete-time signal x(k):Z→Cx(k):\mathbb Z\to\mathbb C periodic of period NN, the DFT of x(k)x(k) is

X(n)=1N∑k=0N−1x(k) e−j2πnNk\boxed{X(n)=\frac1N\sum_{k=0}^{N-1}x(k)\,e^{-j\frac{2\pi n}Nk}}

Notation: X(n)=FD[x(k)]X(n)=\mathcal F_D[x(k)]. The values X(n)X(n) are exactly the coefficients cnc_n, so that x(k)=∑n=0N−1X(n) ej2πnNkx(k)=\sum_{n=0}^{N-1}X(n)\,e^{j\frac{2\pi n}Nk}.

Periodicity of X(n)X(n). X(n+N)=1N∑k=0N−1x(k)e−j2π(n+N)Nk=1N∑k=0N−1x(k)e−j2πnNke−j2πNNk⏟1=X(n).X(n+N)=\frac1N\sum_{k=0}^{N-1}x(k)e^{-j\frac{2\pi(n+N)}Nk}=\frac1N\sum_{k=0}^{N-1}x(k)e^{-j\frac{2\pi n}Nk}\underbrace{e^{-j\frac{2\pi N}Nk}}_{1}=X(n). So X(n)X(n) is periodic of period NN, exactly as x(k)x(k). Hence X(n)X(n) can also be represented in CN\mathbb C^N: X⃗=[X(0)X(1)⋯X(N−1)]T\vec X=\begin{bmatrix}X(0)&X(1)&\cdots&X(N-1)\end{bmatrix}^T.

DFT operator. F:CN→CNF:\mathbb C^N\to\mathbb C^N, X⃗=Fx⃗\vec X=F\vec x, with FF an N×NN\times N matrix whose rows are the transposed conjugated vectors ψ⃗n‾ T\overline{\vec\psi_n}^{\,T} (row nn has entries ψn(k)‾=e−j2πnNk\overline{\psi_n(k)}=e^{-j\frac{2\pi n}Nk}, k=0,1,…,N−1k=0,1,\dots,N-1 across the columns), the factor 1N\frac1N of the definition being included in FF. (The scan draws the rows as conjugated ψn(k)T\psi_n(k)^T and does not write the factor 1N\frac1N explicitly in the matrix.)

Versione ripasso

Periodic exponentials: ejθke^{j\theta k} is NN-periodic iff θ=2πnN\theta=\frac{2\pi n}N (so θ/π∈Q\theta/\pi\in\mathbb Q). Only NN distinct ones: ψn(k)=ej2πnNk\psi_n(k)=e^{j\frac{2\pi n}Nk}, n=0,…,N−1n=0,\dots,N-1 (index n+Nn+N repeats index nn).

Why they suffice: an NN-periodic xx solves x(k)−x(k−N)=0x(k)-x(k-N)=0; characteristic equation λN=1\lambda^N=1 with roots λn=ej2πnN\lambda_n=e^{j\frac{2\pi n}N} (roots of unity); the modes are ψn(k)=λnk\psi_n(k)=\lambda_n^k, so x(k)=∑n=0N−1cnψn(k)x(k)=\sum_{n=0}^{N-1}c_n\psi_n(k).

Setting: SNdt↔CNS_N^{dt}\leftrightarrow\mathbb C^N (isomorphism); energy ∑∣x(k)∣2=∥x⃗∥2\sum|x(k)|^2=\|\vec x\|^2; mutual energy ∑x1x2‾=⟨x⃗1,x⃗2⟩\sum x_1\overline{x_2}=\langle\vec x_1,\vec x_2\rangle.

Orthogonality: ⟨ψ⃗n,ψ⃗m⟩=Nδ(n−m)\langle\vec\psi_n,\vec\psi_m\rangle=N\delta(n-m) (finite geometric sum 1−qM+11−q\frac{1-q^{M+1}}{1-q}, q≠1q\ne1, with qN=1q^N=1).

Coefficients and definition: X(n)=cn=1N∑k=0N−1x(k)e−j2πnNk,x(k)=∑n=0N−1X(n)ej2πnNk.X(n)=c_n=\frac1N\sum_{k=0}^{N-1}x(k)e^{-j\frac{2\pi n}Nk},\qquad x(k)=\sum_{n=0}^{N-1}X(n)e^{j\frac{2\pi n}Nk}. X(n)X(n) is NN-periodic like x(k)x(k), so X⃗=Fx⃗\vec X=F\vec x with FF an N×NN\times N matrix built from conjugated ψn\psi_n (factor 1N\frac1N as in the definition).

Typical mistakes: forgetting that only NN exponentials are distinct (index mod NN); putting the 1N\frac1N in the wrong place (here it is in the analysis formula for X(n)X(n)); omitting the conjugate (minus sign in the exponent) when computing the coefficients.

Teoria collegata