
Understanding DFT and Its Applications - Week 6 Lecture Highlights
Explore the essential facts of Discrete Fourier Transform (DFT) and its practical application through examples. Learn how to work out DFT for a given data vector and understand the matrix form representation. Dive into signal processing concepts with explanations and visual aids from the online lecture.
Download Presentation

Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.
E N D
Presentation Transcript
Do you have any question about the video of week-6? We have talked about DFT and its applications
DFT I (Essential facts) N-1 x[n+1]exp(-j2pk X(k)= X(2pk / N)= n) N n=0 Rewritten it in matrix form, assume the data is x[0], x[1], , x[N-1] 1 1 ... 1 X[0] X[1] .. X[N -1] x[0] x[1] .. x[N -1] exp -2p j exp -2p j (N -1) 1 ... N N = ... ... exp -2p j(N -1) 1exp -2p j(N -1) (N -1) N N DFT DATA
Example Let (x[0], x[1], x[2], x[3]) = (1 2 -1 -1) be a data vector of length N=4. Work out its DFT (X[0], X[1], X[2], X[3]) N-1 x[n+1]exp(-j2pk X(k)= X(2pk / N)= n) N n=0 X[0] = 1+2 -1-1=1 X[1] = exp(-0j2pi/4) + 2 exp(-1 j 2 pi/4) -1 exp(-2 j 2 pi/4) -1 exp(-3 j 2 pi/4 = 1 + 2 exp(-j pi /2) (exp(-j pi/2 ))^2 (exp(-j pi/2)) ^3 = 1 + 2 (-j)-(-j)^2-(-j)^3 = 1-2j+1+(-j)=2-3j exp(-j pi /2) = cos( pi/2) j sin(pi/2) = 0 j 1 Any question?
Example Let (x[0], x[1], x[2], x[3]) = (1 2 -1 -1) be a data vector of length N=4. Work out its DFT (X[0], X[1], X[2], X[3]) 3 2pk N X[k]= x[n]exp(-j n) n=0 X[0]=1+2-1-1=1 3 2p1 4 n)= exp(-j2p1 0)+2exp(-j2p1 1)-1exp(-j2p1 2)-12exp(-j2p1 X[1]= x[n]exp(-j 3) 4 4 4 4 n=0 =1+2exp(-jp 2)-exp(-jp 2)-[exp(-jp 22)-exp(-jp 2)]2- [exp(-jp 23) =1+2exp(-jp 2)]3 =1+2(-j)-(-j)2-(-j)3=1-2j+1- j = 2-3j 3 2p2 4 X[2]= x[n]exp(-j n)=1+2(-j)2-((-j)2)2-((-j)3)2=1-2-1+1=-1 n=0 3 2p3 4 X[3]= x[n]exp(-j n)=1+2(-j)3-((-j)2)3-((-j)3)3=1+2j+1+ j = 2+3j n=0
x = [1 2 -1 -1] fft (x)
clear all close all sampling_rate=100;%Hz omega=30; %signal frequecy Hz N=20000; %total number of samples for i=1:N x_sound(i)=cos(2*pi*omega*i/sampling_rate); %signal x(i)=x_sound(i)+2*randn(1,1); %signal+noise axis(i)=sampling_rate*i/N; % for psd time(i)=i/sampling_rate; % for time trace end subplot(1,2,1) plot(time,x); %signal + noise, time trace xlabel('second') ylabel('x') subplot(1,2,2) plot(axis,abs(fft(x)),'r'); % magnitude of signal xlabel('Hz'); ylabel('Amplitude') sound(x_sound)
t=0:0.001:2; % 2 secs @ 1kHz sample rate y=chirp(t,100,1,200,'q'); % Start @ 100Hz, cross 200Hz at t=1sec spectrogram(y,128,120,128,1E3); % Display the spectrogram title('Quadratic Chirp: start at 100Hz and cross 200Hz at t=1sec'); sound(y) y=chirp(t,100,1,200,'q'); % Start @ Fs=5000; filename = 'h.wav'; audiowrite(filename,y,Fs); The first one is in theory, it is ideal. The second one is dealing with our daily life example.
for i=1:T(1,1); zn(i,1)=y(i,1)+.3*randn(1,1); end figure(8) plot(zn); xlabel('time') figure(9) plot(fre_x,abs(fft(zn))) xlabel('Hz') figure(10) spectrogram(zn,128,120,[],Fs); close all clear all load handel; figure(1) plot(y); xlabel('time') T=size(y); for i=1:T(1,1) fre_x(i)=i*Fs/T(1,1); end figure(2) plot(fre_x, abs(fft(y))) xlabel('Hz') figure(3) spectrogram(y,128,120,[],Fs); T1=floor(T(1,1)/2); omega1=1000; for i=1:T(1,1)-T1; z(i,1)=y(i,1)+.3*cos(2*pi*omega 1*i/Fs); end omega2=2000; for i=T-T1+1:T(1,1); z(i,1)=y(i,1)+.3*cos(2*pi*omega 2*i/Fs); end figure(5) plot(z); xlabel('time') figure(6) plot(fre_x,abs(fft(z))) xlabel('Hz') figure(7) spectrogram(z,128,120,[],Fs); ;
Power spectrum of white noise Can you prove that the power spectrum of white noise is flat? = 1 2 exp( ] 1 [ ( | x[k] | n k j m x N 1 2 k = = + X ( k ) X ( 2 k / N ) x [ n 1 ] exp( j n ) N n 0 N 2 k = = + x n j n )) N 0 N 1 2 = N + * ( [ 1 ] exp( m )) N m 0 1 2 k 2 k = 0 n = + + x [ m 1 ] exp( j m ) x [ n 1 ] exp( j n ) N N m Do you have any question here? E x[n]x[m] = 0 if n neq m
N 1 2 k = n = + 2 E | x[k] | E ( x [ n 1 ] exp( j n )) N 0 N 1 2 k = N + * ( x [ m 1 ] exp( j m )) N m 0 1 2 k 2 k = N = + + E x [ m 1 ] exp( j m ) x [ n 1 ] exp( j n ) N N n 0 m 1 = n = + = [ 2 E x n 1 ] N 0