DFT Developement (Brandon.Price): Difference between revisions

From Class Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 42: Line 42:
<math>X(m) = DFT(x(nT)) = \sum_{n=0}^{N-1} x(nT)\ e^{- j 2\pi n m / N} </math> for <math> m = 0, \dots, N-1</math>
<math>X(m) = DFT(x(nT)) = \sum_{n=0}^{N-1} x(nT)\ e^{- j 2\pi n m / N} </math> for <math> m = 0, \dots, N-1</math>


Commonly, we write <math> x(nT) = x(n) </math>
Commonly, we write: x(nT) = x(n)


Let us reflect on these:
Let us reflect on these:

We notice that X(m) is periodic with period N since:

<math>X(m+N)= \sum_{n=0}^{N-1} x(nT)\ e^{- j 2\pi n (m+N) / N} = \sum_{n=0}^{N-1} x(nT)\ e^{- j 2\pi n m / N} e^{- j 2\pi n } = \sum_{n=0}^{N-1} x(nT)\ e^{- j 2\pi n m / N} = X(m)</math>

We also notice that with the following approximations, we can see a resemblance between the DFT and the Fourier Integral:

<math>f \approx \frac{m}{NT}</math>

<math>t \approx nT</math>

<math>\int dt \approx \sum T</math>

So, slipping these into the DFT and shifting our index by N/2 (since the sequence is periodic) we find:

<math>DFT(x(nT)) = \sum_{n=0}^{N-1} x(nT)\ e^{\frac{- j 2\pi n m }{N}} = \frac{1}{T} \sum_{n=-N/2}^{N/2-1} x(nT)\ e^{- j 2\pi n T (\frac{m}{N T})}T \approx \frac{1}{T}\int_{-NT/2}^{NT/2} x(t)\ e^{- j 2\pi t f}\,dt</math>

The only real differences are limits on the integral and the 1/T scaling factor. So, the DFT may not be such a bad approximation after all!

Revision as of 19:23, 30 November 2008

The Fourier Transform is a powerful tool, but how can we use it with computers?

Let's take a look at the Fourier Transform and make some observations.

Here, we see an integration of time from negative infinity to infinity for the function . This is a problem for several reasons:

1)We have no access to data for a given function before we start observing (so we can't start at time = -infinity).

2) We can't wait until all time passes (ending at time = infinity) to compute the transform.

3) We can't use continuous integration since computers are restricted by finite memory.


We can get around each of these by noting that:

1) We don't care what happened to our signal before we started looking.

2) We don't care what happens to our signal after a certain (short) length of time.

3) we can approximate an integral using a summation (just like Riemann sums from the Calculus).


Our answer will not be the same as the true Fourier Transform, but as engineers, we are prepared to carefully sacrifice some precision for practicality. So, let's call this modification a "Discrete Fourier Transform (DFT)." How do we calculate one and how does it compare to the Fourier Transform?

We start with an infinite continuous signal (in time) and multiply it by a sequence of delta functions, effectively sampling the continuous signal at discrete intervals. The resulting convolution in the frequency domain gives us a periodic frequency function.

DFTDev1(brandon.price).jpg

Next, we multiply our infinite series of impulse functions by a windowing function (this eliminates the data before and after the length of time we care about). Now we have a discrete representation (N samples) of just the part of the signal we want. In the frequency domain, we once again convolve, resulting in a slightly distorted, periodic frequency signal. (Fewer samples or smaller sample interval results in more distortion in the frequency domain).

DFTDev2(brandon.price).jpg

We want to work with discrete frequency data too, in the computer, so we multiply the frequency domain by a sequence of impulse functions. The corresponding convolution in time makes our discrete sample periodic.

DFTDev3(brandon.price).jpg


Now, we have a discrete representation of a small piece of the original continuous signal - both in time and frequency! Comparing the time domain and frequency domain, we can see the the DFT must be defined as:

for

Commonly, we write: x(nT) = x(n)

Let us reflect on these:

We notice that X(m) is periodic with period N since:

We also notice that with the following approximations, we can see a resemblance between the DFT and the Fourier Integral:

So, slipping these into the DFT and shifting our index by N/2 (since the sequence is periodic) we find:

The only real differences are limits on the integral and the 1/T scaling factor. So, the DFT may not be such a bad approximation after all!