630 likes | 1.06k Views
ELEN E4810: Digital Signal Processing Topic 3: Fourier domain. The Fourier domain Discrete-Time Fourier Transform (DTFT) Discrete Fourier Transform (DFT) Convolution with the DFT. 1. The Fourier Transform.
E N D
ELEN E4810: Digital Signal ProcessingTopic 3: Fourier domain • The Fourier domain • Discrete-Time Fourier Transform (DTFT) • Discrete Fourier Transform (DFT) • Convolution with the DFT Dan Ellis
1. The Fourier Transform • Basic observation (continuous time):A periodic signal can be decomposed into sinusoids at integer multiples of the fundamental frequency • i.e. if we can approach with Harmonics of the fundamental Dan Ellis
Fourier Series • For a square wave, i.e. Dan Ellis
fk π ak 1.0 k 1 2 3 4 5 6 7 k 1 2 3 4 5 6 7 Fourier domain • xis equivalently described by its Fourier Series parameters: • Complex form: Negative ak is equivalent to phase of p Dan Ellis
Fourier analysis • How to find {|ck|}, {arg[ck]}?Inner product with complex sinusoids: Dan Ellis
Fourier analysis • Works if k1, k2 are positive integers, Dan Ellis
∆ sinc • = 1 when x = 0= 0 when x = r·p, r ≠ 0, r = ±1, ±2, ±3,... Dan Ellis
Fourier Analysis • Thus,because real & imag sinusoids in pick out corresponding sinusoidal components linearly combined in Dan Ellis
Fourier Transform • Fourier series for periodic signals extends naturally to Fourier Transform for any (CT) signal (not just periodic): • Discrete index kcontinuous freq. W FourierTransform (FT) Inverse FourierTransform (IFT) Dan Ellis
Fourier Transform • Mapping between two continuous functions: 2π ambiguity Dan Ellis
d(x-x0) f(x) x x0 Fourier Transform of a sine • Assume Now, since ...we know ...where d(x) is the Dirac delta function (continuous time) i.e. • Dan Ellis
Fourier Transforms ~ ~ Dan Ellis
2. Discrete Time FT (DTFT) • FT defined for discrete sequences: • Summation (not integral) • Discrete (normalized) frequency variable w • Argument is ejw, not plain w DTFT Dan Ellis
n -1 1 2 3 4 5 6 7 DTFT example • e.g. x[n] = an·m[n], |a| < 1 Dan Ellis
Periodicity of X(ejw) • X(ejw) has periodicity 2p in w : • Phase ambiguity of ejwmakes it implicit Dan Ellis
Inverse DTFT (IDTFT) • Same basic form as other IFTs: • Note: continuous, periodic X(ejw) discrete, infinite x[n] ... • IDTFT is actually forward Fourier Series (except for sign of w) IDTFT Dan Ellis
IDTFT • Verify by substituting in DTFT: = 0 unlessn = l Dan Ellis
sinc again • Same as cos imag jsin part cancels Dan Ellis
n w -3 -2 -1 1 2 3 -p p DTFTs of simple sequences • x[n] = d[n] • i.e. x[n] X(ejw) d[n] 1 (for all w) x[n] X(ejw) Dan Ellis
DTFTs of simple sequences IDTFT • : over -p < w < p but X(ejw) must be periodic in w • If w0 = 0 then x[n] = 1n so Dan Ellis
DTFTs of simple sequences • From before: • m[n]tricky - not finite ( |a| < 1) DTFT of 1/2 Dan Ellis
DTFT properties • Linear: • Time shift: • Frequency shift: ‘delay’in frequency Dan Ellis
DTFT example • x[n] = d[n] + anm[n-1] ? = d[n] + a(an-1m[n-1]) x[n] = anm[n] Dan Ellis
DTFT symmetry • If x[n] X(ejw)then... x[-n] X(e-jw) x*[n] X*(e-jw) Re{x[n]} XCS(ejw) jIm{x[n]} XCA(ejw) xcs[n] Re{X(ejw)} xca[n] jIm{X(ejw)} from summation (e-jw)* = ejw conjugate symmetry cancels Im parts on IDTFT Dan Ellis
DTFT of real x[n] • When x[n]is pure real, X(ejw) = X*(e-jw) xcs[n] xev[n] = xev[-n] XR(ejw) = XR(e-jw) xca[n] xod[n] = -xod[-n] XI(ejw) = -XI(e-jw) x[n] real, evenX(ejw) even, real Dan Ellis
DTFT and convolution • Convolution: Convolutionbecomesmultiplication Dan Ellis
DTFT modulation • Modulation:Could solve if g[n]was just sinusoids... Dualof convolution in time Dan Ellis
Parseval’s relation • “Energy” in time and frequency domains are equal: • If g = h, theng·g* = |g|2 = energy... Dan Ellis
Energy density spectrum • Energy of sequence • By Parseval • Define Energy Density Spectrum (EDS) Dan Ellis
EDS and autocorrelation • Autocorrelation of g[n]: • If g[n] is real, G(e-jw) = G*(ejw), so • Mag-sq of spectrum is DTFT of autoco no phaseinfo. Dan Ellis
Convolution with DTFT • Since we can calculate a convolution by: • finding DTFTs of g, hG, H • multiply them: G·H • IDTFT of product is result, g[n] DTFT y[n] IDTFT h[n] DTFT Dan Ellis
DTFT convolution example • x[n] = an·m[n] • h[n] = d[n] - ad[n-1] • y[n] = x[n] *h[n] y[n] = d[n] i.e. ... Dan Ellis
3. Discrete FT (DFT) • A finite or periodic sequence has only N unique values, x[n] for0 ≤ n < N • Spectrum is completely defined by N distinct frequency samples • Divide 0..2p into N equal steps, {wk} = 2pk/N Dan Ellis
DFT and IDFT • Uniform sampling of DTFT spectrum: • DFT: where i.e. 1/Nth of a revolution Dan Ellis
im WN2 re WN IDFT • Inverse DFT IDFT • Check: Sum of complete setof rotated vectors= 0 if l ≠ n; = N if l = n Dan Ellis
DFT examples • Finite impulse • Periodic sinusoid: (r I) Dan Ellis
DFT: Matrix form • as a matrix multiply: • i.e. Dan Ellis
Matrix IDFT • If then • i.e. inverse DFT is also just a matrix, =1/NDN* Dan Ellis
X[k] X(ejw) w k=1... DFT and DTFT • DFT ‘samples’ DTFT at discrete freqs: • continuous freq w• infinite x[n], -<n< DTFT • discrete freq k=Nw/2p• finite x[n], 0≤n<N DFT Dan Ellis
DFT and MATLAB • MATLAB is concerned with sequences not continuous functions like X(ejw) • Instead, we use the DFT to sample X(ejw)on an (arbitrarily-fine) grid: • X = freqz(x,1,w);samples the DTFT of sequence x at angular frequencies in w • X = fft(x);calculates the N-point DFT of an N-point sequence x M Dan Ellis
DTFT from DFT • N-point DFT completely specifies the continuous DTFT of the finite sequence “periodicsinc” interpolation Dan Ellis
Periodic sinc • = N when Dwk = 0; = (-)Nwhen Dwk/2 = p= 0 when Dwk/2 = r·p/N, r = ±1, ± 2, ...other values in-between... Dan Ellis
Periodic sinc Periodicsincinterpolation X[k]X(ejw) Dan Ellis
DFT from overlength DTFT • If x[n] has more than N points, can still form • IDFT of X[k]will give N point • How does relate to x[n] ? Dan Ellis
DTFT sample IDFT x[n] X(ejw) X[k] -A ≤ n < B 0 ≤ n < N DFT from overlength DTFT =1 forn-l = rN, rI= 0 otherwise all values shifted by exact multiples of N ptsto lie in 0 ≤ n < N Dan Ellis
DFT from DTFT example • If x[n] = { 8, 5, 4, 3, 2, 2, 1, 1} (8 point) • We form X[k] for k = 0, 1, 2, 3by sampling X(ejw) at w = 0, p/2, p, 3p/2 • IDFT of X[k] gives 4 pt • Overlap only forr = -1: (N = 4) Dan Ellis
DFT from DTFT example • x[n] • x[n+N] (r = -1) • is the time aliased or ‘folded down’ version of x[n]. n -1 1 2 3 4 5 6 7 8 n -5 -4 -3 -2 -1 1 2 3 4 5 n 1 2 3 Dan Ellis
Properties: Circular time shift • DFT properties mirror DTFT, with twists: • Time shift must stay within N-pt ‘window’ • Modulo-N indexing keeps index between 0 and N-1: 0 ≤ n0 < N Dan Ellis
g[n] g[<n-2>5] n n 1 2 3 4 1 2 3 4 Circular time shift • Points shifted out to the right don’t disappear – they come in from the left • Like a ‘barrel shifter’: ‘delay’ by 2 5-pt sequence Dan Ellis
n -7 -6 -5 -4 -3 -2 -1 1 2 3 4 5 6 7 8 9 10 11 n -7 -6 -5 -4 -3 -2 -1 1 2 3 4 5 6 7 8 9 10 11 Circular time reversal • Time reversal is tricky in ‘modulo-N’ indexing - not reversing the sequence: • Zero point stays fixed; remainder flips 5-pt sequence made periodic Time-reversedperiodic sequence Dan Ellis