You are on page 1of 24

THE DFT AS A TOOL IN DIGITAL PROCESSING OF DISCRETE-TIME SIGNALS BY DISCRETETIME SYSTEMS

ABSTRACT
The Discrete Fourier transform (DFT) is a specific kind of discrete transform, used in Fourier analysis. It transforms one function into another, which is called the frequency domain representation, or simply the DFT, of the original function. But the DFT requires an input function that is discrete and whose nonzero values have a limited duration. Such inputs are often created by sampling a continuous function, like a person's voice. Unlike the discrete-time Fourier transform (DTFT), it only evaluates enough frequency components to reconstruct the finite segment that was analyzed. Using the DFT implies that the finite segment that is analyzed is one period of an infinitely extended periodic signal; if this is not actually true, a window function has to be used to reduce the artifacts in the spectrum. For the same reason, the inverse DFT cannot reproduce the entire time domain, unless the input happens to be periodic. Therefore it is often said that the DFT is a transform for Fourier analysis of finite-domain discrete-time functions. The sinusoidal basis functions of the decomposition have the same properties. Discrete Fourier transforms are transforms of finite sequence of complex or real numbers. The results are again finite sequence of generally complex numbers. Discrete Fourier transforms map a finite sequence of numbers onto a finite sequence of numbers. Under the terms discrete Fourier transform we shall understand the direct discrete Fourier transform as well as the inverse discrete Fourier transform which maps the result of a direct transform back to original sequence.

1. INTRODUCTION
The Discrete Fourier Transform (DFT) plays an important role in the analyses, design and implementation of the discrete-time signal- processing algorithms and systems. It is used to convert the samples in time domain to frequency domain. DFTs is used in wide range of applications in Digital Signal Processing. DFT is identical to samples of the Fourier transform at equally spaced frequencies. Consequently, computation of the N-point DFT corresponds to the computation of N samples of the Fourier transform at N equally spaced frequencies k = 2k/N. Considering input x[n] to be complex, N complex multiplications and (N-1) complex additions are required to compute each value of the DFT, if computed directly from the formula given as

X (k) = Wn =

0 k N-1

2. THE DISCRETE FOURIER TRANSFORM

Fourier analysis is a family of mathematical techniques, all based on decomposing signals into sinusoids. The discrete Fourier transform (DFT) is the family member used with digitized signals. The real DFT, a version of the discrete Fourier transform that uses real numbers to represent the input and output signals. The complex DFT, a more advanced technique that uses complex numbers. Aperiodic-Continuous This includes, for example, decaying exponentials and the Gaussian curve. These signals extend to both positive and negative infinity without repeating in a periodic pattern. The Fourier Transform for this type of signal is simply called the Fourier Transform. Periodic-Continuous Here the examples include: sine waves, square waves, and any waveform that repeats itself in a regular pattern from negative to positive infinity. This version of the Fourier transform is called the Fourier Series. Aperiodic-Discrete These signals are only defined at discrete points between positive and negative infinity, and do not repeat themselves in a periodic fashion. This type of Fourier transform is called the Discrete Time Fourier Transform. Periodic-Discrete These are discrete signals that repeat themselves in a periodic fashion from negative to positive infinity. This class of Fourier Transform is sometimes called the Discrete Fourier Series, but is most often called the Discrete Fourier Transform. These four classes of signals all extend to positive and negative infinity. A group of infinitely long signals cannot be used to synthesize something finite in length. The way around this dilemma is to make the finite data look like an infinite length signal. This is done by imagining that the signal has an infinite number of samples on the left and right of the actual points. If all these imaginary samples have a value of zero, the signal looks discrete and aperiodic, and the Discrete Time Fourier Transform applies. As an alternative, the imaginary samples can be a duplication of the actual 1024 points. In this case, the signal looks discrete and

periodic, with a period of 1024 samples. This calls for the Discrete Fourier Transform to be used. As it turns out, an infinite number of sinusoids are required to synthesize a signal that is aperiodic. This makes it impossible to calculate the Discrete Time Fourier Transform in a computer algorithm. By elimination, the only

type of Fourier transform that can be used in DSP is the DFT. In other words, digital computers can only work with information that is discrete and finite in length. The first three members of the Fourier transform family are generally considered while solving mathematical and theoretical issues to ease the complexity. Each of the four Fourier Transforms can be subdivided into real and complex versions. The real version is the simplest, using ordinary numbers and algebra for the synthesis and decomposition. The complex versions of the four Fourier transforms are immensely more complicated, requiring the use of complex numbers. These are numbers such as: 3 + 4j, where j is equal to -1. Complex mathematics can quickly become overwhelming, even to those that specialize in DSP. The complex Fourier transforms are the realm of those that specialize in DSP, and are willing to sink to their necks in the swamp of mathematics. The mathematical term: transform, is extensively used in Digital Signal Processing, such as: Fourier transform, Laplace transform, Z transform, Hilbert

transform, Discrete Cosine transform, etc. A transform is an algorithm or procedure that changes one value into another value. Transforms allow both the input and output to have multiple values. Transforms are not limited to any specific type or number of data. In short, a transform is any fixed procedure that changes one chunk of data into another chunk of data.

3. PROPERTIES OF DFT

LINEAR PROPERTY:
Let x1 (n), x2 (n) are two finite duration sequences, with an equal duration of N samples and DFT[ x1 (n) ] = X1 (k), DFT[ x2 (n) ] = X2 (k), then according to linear property of DFT, DFT[ a x1 (n) + b x2 (n) ] = a X1 (k) + b X2 (k). Where a & b are arbitrary constants.

PROOF:
From basic definition of DFT DFT[x (n)] = Replace x (n) by a x1 (n) + b x2 (n) DFT [a x1 (n) + b x2 (n)] = = = =a
1(n) 1(n) 1(n) 1(n)

+ b x2(n)] + b x2(n) ]+ +b ]
2(n) 2(n)

= a DFT[x1(n)] + b DFT[x2(n)] = a X1(k) + b X2(k)

PERIODIC PROPERTY:

Let x (n) be a finite duration sequence, with a duration of N samples and DFT[x (n)] = X(k), then according to periodic property of DFT, X (N + k) = X (k) x (N + n) = x (n) PROOF: From basic definition of DFT DFT[x (n)] = Replace k by N + k X (N + k) = = = = = = X (K) (1)

TIME SHIFTING PROPERTY:

Let x (n) be a finite duration sequence, with a duration of N samples and DFT[ x(n) ] = X(k), then according to time shifting property of DFT, DFT[ x(n n0 ) ] = It is also known as circular time shift property. PROOF: From basic definition of DFT DFT[x (n)] = Replace k by x (n) by x (n n0) DFT[x (n-n0)] = Let n-n0=m = = = = = X (K)

CIRCULAR CONVOLUTION:

Circular convolution of a first sequence x 1 (n) having N samples [0 n N 1] and a second sequence x 2 (n) having N samples [0 n N 1] can be defined as X (n) = Where X (n): Circular convoluted sequence, with duration of N = N 1 N: Duration of x1 (n) or x2 (n) or x (n), 0 n N 1 Durations of circular convoluted sequence x (n), first sequence x 1 (n) and second sequences x2 (n) are equal, therefore circular convolution is also known as periodic convolution. DFT supports circular convolution, due to equal durations.
1(m) x2(n-m)

Derivation for Circular Convolution:


Let x1 (n) and x2 (n) are two finite duration sequences with an equal duration of N samples, assume x(n) be the circular convoluted sequence with a duration of N samples x(n) = x1 (n) x2 (n), convolution in time domain leads to multiplication in frequency domain. i.e. X (k) = X1 (k) X2 (k). IDFT of X (k) can be defined as IDFT[X (k)] = 1/N Replace X (k) = X1 (k) X2 (k) IDFT[X (k)] = 1/N x (n) = 1/N = 1/N Change the order of two sums x (n) = 1/N x (n) = x (n) =
2(m) 2(m) 2(m) 1(k)X2(k) 1(k)DFT[x2(k)] 1(k)

2(m)

1(k) 1(k) 1(m)

)] )] x2(n-m)]

x1(n-m)] or

CIRCULAR CONVOLUTION EXAMPLE:

Consider the two sequences x1(n) ={1, 2, 3, 1} x2(n) ={4, 3, 2, 2} Each sequence consists of four nonzero points. The sequences x 1(n) and x2(n) are represented in graph as points on circle. X3(m) is obtained by circular convolving x1(n) and x2(n) X3(m) =
1(n)

x2((m-n))N

m =0, 1, 2..N-1

From the above equation For m=0 X3(0) =


1(n)

x2((-n))4

=4+4+6+3 =17 For m=1 X3(1) =


1(n)

x2((1-n))4

=3+8+6+2 =19 For m=2 X3(2) =


1(n)

x2((2-n))4

=2+6+12+2 =22 For m=3 X3(3) =


1(n)

x2((3-n))4

=2+4+9+4 =19 X(m) ={17, 19, 22, 19}

MATLAB CODE FOR CIRCULAR CONVOLUTION


clc; clear all; close all; x=input('enter i/p x(n):'); m=length(x); h=input('enter i/p sequence h(n)'); n=length(h); subplot(2,2,1), stem(x); title('i/p sequencce x(n)is:'); xlabel('---->n'); ylabel('---->x(n)');grid; subplot(2,2,2), stem(h); title('i/p sequencce h(n)is:'); xlabel('---->n'); ylabel('---->h(n)');grid; disp('circular convolution of x(n) & h(n) is y(n):'); if(m-n~=0) if(m>n) h=[h,zeros(1,m-n)]; n=m; end x=[x,zeros(1,n-m)]; m=n; end y=zeros(1,n); y(1)=0; a(1)=h(1); for j=2:n a(j)=h(n-j+2); end for i=1:n y(1)=y(1)+x(i)*a(i); end for k=2:n y(k)=0; for j=2:n x2(j)=a(j-1); end x2(1)=a(n); for i=1:n if(i<n+1) a(i)=x2(i); y(k)=y(k)+x(i)*a(i); end end end subplot(2,2,[3,4]),stem(y); title('convolution of x(n) & h(n) is:'); xlabel('---->n'); ylabel('---->y(n)');grid;

LINEAR CONVOLUTION
Convolution is a formal mathematical operation, just as multiplication, addition, and integration. Addition takes two numbers and produces a third number, while convolution takes two signals and produces a third signal. Convolution is used in the mathematics of many fields, such as probability and statistics. In linear systems, convolution is used to describe the relationship between three signals the input signal, the impulse response, and the output signal. y (n) =
1(k)x2(n-k+1)

1<n<N-1

In this equation, x1(k), x2(n-k) and y (n) represent the input to and output from the system at time n. Here we could see that one of the inputs is shifted in time by a value every time it is multiplied with the other input signal. Linear Convolution is quite often used as a method of implementing filters of various types. EXAMPLE: Consider the two sequences x1(n) = {1, 2, 3, 4, 5} x2(n) = {1, 2} By using the equation y (n) = 1(k)x2(n-k+1)

1<n<N-1

From the above sequence we know that N=7 Calculating linear convolution of the sequence from the equation For n=1 y(1) =
1(k)x2(1-k+1)

= x1(1) x2(1-1+1) + x1(2) x2(1-2+1) + x1(3) x2(1-3+1) + x1(4) x2(1-4+1) + x1(5) x2(1-5+1) + x1(6) x2(1-6+1) = x1(1) x2(1-1+1) +0+0+0+0+0 = 1(1) =1 For n=2 y(2) = 1(k)x2(2-k+1) = x1(1) x2(2-1+1) + x1(2) x2(2-2+1) + x1(3) x2(2-3+1) + x1(4) x2(2-4+1) + x1(5) x2(2-5+1) + x1(6) x2(2-6+1) = x1(1) x2(2) + x1(2) x2(1) + 0+0+0+0

=1(2) + 2(1) =4 For n=3 y(3) = 1(k)x2(3-k+1) = x1(1) x2(3-1+1) + x1(2) x2(3-2+1) + x1(3) x2(3-3+1) + x1(4) x2(3-4+1) + x1(5) x2(3-5+1) + x1(6) x2(3-6+1) = 0+ x1(2) x2(2) + x1(3) x2(1) + 0+0+0 = 2(2) + 3(1) =7 For n=4 y(4) = 1(k)x2(4-k+1) = x1(1) x2(4-1+1) + x1(2) x2(4-2+1) + x1(3) x2(4-3+1) + x1(4) x2(4-4+1) + x1(5) x2(4-5+1) + x1(6) x2(3-6+1) =0 + 0 + x1(3) x2(2) + x1(4) x2(1) +0 +0 =3(2) + 4(1) =10 For n=5 y(5) = 1(k)x2(5-k+1) = x1(1) x2(5-1+1) + x1(2) x2(5-2+1) + x1(3) x2(5-3+1) + x1(4) x2(5-4+1) + x1(5) x2(5-5+1) + x1(6) x2(5-6+1) =0 + 0 + 0 + x1(4) x2(2) + x1(5) x2(1) + 0 =4(2) + 5(1) =13 For n=6 y(6) = 1(k)x2(6-k+1) = x1(1) x2(6-1+1) + x1(2) x2(6-2+1) + x1(3) x2(6-3+1) + x1(4) x2(6-4+1) + x1(5) x2(6-5+1) + x1(6) x2(6-6+1) =0 + 0 + 0 + 0 + x1(5) x2(2) + 0 =5(2) =10 y(n) = {1, 4, 7, 10, 13, 10}

MATLAB CODE FOR LINEAR CONVOLUTION


clc; clear all; close all; disp('linear convolution program'); x=input('enter i/p x(n):'); m=length(x); h=input('enter i/p h(n):'); n=length(h); x=[x,zeros(1,n)]; subplot(2,2,1), stem(x); title('i/p sequencce x(n)is:'); xlabel('---->n'); ylabel('---->x(n)');grid; h=[h,zeros(1,m)]; subplot(2,2,2), stem(h); title('i/p sequencce h(n)is:'); xlabel('---->n'); ylabel('---->h(n)');grid; disp('convolution of x(n) & h(n) is y(n):'); y=zeros(1,m+n-1); for i=1:m+n-1 y(i)=0; for j=1:m+n-1 if(j<i+1) y(i)=y(i)+x(j)*h(i-j+1); end end end subplot(2,2,[3,4]),stem(y); title('convolution of x(n) & h(n) is :'); xlabel('---->n'); ylabel('---->y(n)');grid;

DISCRETE FOURIER TRANSFORM EXAMPLE:


Consider the sequence X (n) = [1, 1, 1, 1, 1, 1, 0, 0] The formula for DFT is X (k) = From the above sequence we know that N=8 Calculating DFT of the sequence from the formula For k=0 X (0) = x (0) + x (1) + x (2) + x (3) + x (4) + x (5) + x (6) + x (7) =1 +1 +1 +1 +1 +1 +0+0 X (0) =6 For k=1 X (1) = x (0) + x (1) (5) + x (6) + x (2) + x (7) + x (3) + x (4) +x k=0: N-1

=1+0.7071-j0.7071+0-j-0.7071-j0.7071-1-0-0.7071+j0.7071+0+0 X (1) = -0.7071-j1.7071 For k=2 X (2) = x (0) + x (1) (5) + x (6) + x (2) + x (7) + x (3) + x (4) +x

=1+0-j-1-0+0+j+1-0+0-j+0+0 X (2) = 1-j For k=3 X (3) = x (0) + x (1) (5) + x (6) + x (2) + x (7) + x (3) + x (4) +x

= 1-0.7071-j0.7071+0+j+0.7071-j0.7071-1-0+0.7071+j0.7071+0+0 X (3) = 0.7071+j0.2929 For k=4 X (4) = x (0) + x (1) (5) + x (6) + x (2) + x (7) + x (3) + x (4) +x

X (4) = 1-1-0+1-0-1+1-0-1-0+0+0 X (4) = 0 For k=5 X (5) = x (0) + x (1) (5) + x (6) + x (2) + x (7) + x (3) + x (4) +x

= 1-0.7071+j0.7071-0-j+0.7071+j0.7071-1-0+0.7071-j0.7071+0+0 X (5) = 0.7071-j0.2929 For k=6 X (6) = x (0) + x (1) (5) + x (6) + x (2) + x (7) + x (3) + x (4) +x

= 1+0+j-1-0+0-j+1-0+0+j+0+0 X (6) = 1+j For k=7 X (7) = x (0) + x (1) (5) + x (6) + x (2) + x (7) + x (3) + x (4) +x

= 1+0.7071+j0.7071+0+j-0.7071+j0.7071-1-0-0.7071-j0.7071+0+0 X (7) = -0.7071+j1.7071

MATLAB CODE FOR DISCRETE FOURIER TRANSFORM


close all; clear all; N=input('How many point DFT do you want?'); x2=input('Enter the sequence='); n2=length(x2); c= zeros(N); x2=[x2 zeros(1,N-n2)]; for k=1:N for n=1:N w=exp((-2*pi*i*(k-1)*(n-1))/N); x(n)=w; end c(k,:)=x; end r=c*x2'; subplot(211) stem(abs(r)); title('DFT-absolute value'); subplot(212) stem(angle(r)); title('DFT-angle');

4. CONCLUSION
Fourier analysis is a family of mathematical techniques, all based on decomposing signals into sinusoids. The discrete Fourier transform (DFT) is the family member used with digitized signals. This is the first of four chapters on the real DFT, a version of the discrete Fourier transform that uses real numbers to represent the input and output signals. The time and frequency domains are alternative ways of representing signals. The Fourier transform is the mathematical relationship between these two representations. If a signal is modified in one domain, it will also be changed in the other domain, although usually not in the same way. Mathematical operations, such as convolution, addition, scaling and shifting, also have a matching operation in the opposite domain. These relationships are called properties of the Fourier Transform. I have studies the concepts of Discrete Fourier Transform (DFT) and their properties. I implemented the discrete Fourier transform equation and their relative properties in MATLAB.

5. REFERENCES
The Scientist and Engineer's Guide to Digital Signal Processing By Steven W. Smith, Ph.D. Discrete Fourier transforms and their applications by ek, Vclav. Bristol, England ; Boston : Adam Hilger, c1986. J G Proakis and D G Manolakis Digital Signal Processing Principles Algorithms and Applications 3rd Edition Prentice Hall 1996 Vinay K. Ingle John G. Proakis, "Digital Signal Processing Using Matlab V.4, 1997 by PWS PUBLISHING COMPANY

You might also like