I was using MATLAB for approximating FTs. Why DFT is used if we can approximate the transform-integration using summation.
-
1Because the DFT is something else, simple as that. And I wouldn't know what you mean with "approximating the CTFT-integral": You've got a finite-length discrete signal. You want a finite-length discrete frequency-domain vector. What exactly are you proposing that is not a DFT? – Marcus Müller Oct 26 '20 at 16:25
-
Instead of going from, CT signal samples->DFT->DTFT->CTFT, why can't we use numerical method to find CTFT directly from CT signal? – Lelouch Yagami Oct 26 '20 at 16:31
-
1but, we don't start from CT signals. Signals that we can deal with in a computer are always already digitized. – Marcus Müller Oct 26 '20 at 16:39
-
2also, don't forget we rarely actually care about an approximation of the CTFT, as what we deal with is usually limited and hence can be dealt with discrete methods in a way that's more useful. – Marcus Müller Oct 26 '20 at 16:44
-
1@LelouchYagami It could be argued that "approximating the integration using summation" is what the DFT is doing. To use summation instead of integration, you must discretize first. – MBaz Oct 26 '20 at 16:45
-
@MarcusMüller My interpretation of the question is that it is about using a computer and discrete methods to find the FT of a continuous-time signal -- for example, to estimate the spectrum of a signal at the input of an SDR. – MBaz Oct 26 '20 at 16:46
-
@MBaz. Then why don't we directly go for numerical summation instead of FFT algorithm? Using DFT need filters, windows, etc for producing CTFT. – Lelouch Yagami Oct 26 '20 at 16:58
-
The FFT is numerical summation? and the dft doesn't need filters and windows – it's what you do for other reasons. Again, nobody expects a CTFT to come out of the DFT. We never deal with CT signals to begin with, so the CTFT is mostly of usefulness for theory. – Marcus Müller Oct 26 '20 at 17:15
-
@Marcus. Like MBaz said, I am talking about using a computer to display spectrum of a continuous signal.http://www.ws.binghamton.edu/fowler/Fowler%20Personal%20Page/EECE301%20-%20Flipped%20Files/EECE%20301%20NS_21%20DFT%20-%20DTFT%20-%20CTFT%20Relations.pdf – Lelouch Yagami Oct 26 '20 at 17:29
-
3@LelouchYagami Compare the FT and DFT equations. Both multiply by a complex exponential and then sum. And the reason for using the FFT is that it is extremely fast. – MBaz Oct 26 '20 at 17:42
-
1@LelouchYagami but the slides you link to actually show that you're not doing that – you're trying to describe the properties of a band-limited signal, which hence was sampled at a finite sampling rate retaining full reconstructability, and that can be described with a discrete spectrum. What happens outside of the bandwidth observed by sampling is irrelevant to us (otherwise we couldn't have sampled as we did), and thus, the CTFT has absolutely no advantage to us – it's a property of the signal we sampled, yes, but sampling is not a "detour" – it's a necessary step. – Marcus Müller Oct 26 '20 at 17:49
-
DFT is its own transform, not 'approximating' CFT. It's discrete, not discretized - more here, and first section here. DFT is exact. – OverLordGoldDragon Oct 26 '20 at 18:30
-
2boy, i dunno where to begin here. not only is the OP missing something basic, but also most, nearly all, of these comments are way off, too. – robert bristow-johnson Oct 26 '20 at 18:49
-
4the fact is that discrete-time functions $x[n]$ that are uniformly-sampled continuous-time functions $x(nT)$ are approximations to the continuous-time function $x(t)$. the fact is that the DFT is (among other things) an approximation to the CTFT. limiting the limits of the CTFT integral to finite (but large) limits and then representing that integral as a specific Riemann summation leads directly to the DFT. – robert bristow-johnson Oct 26 '20 at 18:54
-
@robertbristow-johnson that is unarguably true – but it kind of misses the point! Very rarely do we assume finite, but large limits and do a DFT over say, a couple million samples (that's a dangerous thing to do, a lot of things aren't stationary enough for that); instead, we say "Oh, we've got a Nyquist rate of so and so, and we can work with this if we consider the spectrum to be cyclic and if we can characterize it in $N$ points"; which really leaves the path of being (in approach) an approximation to the (disputably) "truer" DTFT, but describes the spectrum as how it "applies" to the – Marcus Müller Oct 26 '20 at 23:17
-
actually discrete signal. – Marcus Müller Oct 26 '20 at 23:17
-
MATLAB does quite fine with a DFT (FFT) of size $N=2^{22}$. with double-precision arithmetic, it's not dangerous at all. – robert bristow-johnson Oct 26 '20 at 23:20
-
@robertbristow-johnson not numerically stable, but physically stable; as in: "I want really good estimation of the RIR of this hangar filled with planes, so I'm taking half an hour of samples" might not actually be that good an idea, if someone decides to open the door somewhere in between. Same applies to wireless channels, where I of course worry much more about it, in slightly shorter time intervals. In essence, what we usually don't need is a good approximation of the continuous spectrum; what we need is a good estimation of the spectrum as it influences our use case, and that's – Marcus Müller Oct 26 '20 at 23:25
-
discrete in nature, to me, usually. – Marcus Müller Oct 26 '20 at 23:26
-
1okay, i understand what you mean. but the first statement of your first comment i disagree with. the last question of the same comment i agree with – robert bristow-johnson Oct 26 '20 at 23:27
-
I see your point! Sadly, can't edit comments, and can't delete that comment, either, I guess, since it started the discussion. – Marcus Müller Oct 26 '20 at 23:29
-
2i'm just saying that "approximat[ing] the CTFT-integral itself" is the DFT. – robert bristow-johnson Oct 26 '20 at 23:30
-
well, one approximation, and that approximation exists for anything you've sampled, no matter whether the original thing even had FT (that's solved by finite integral limits, indeed, making every signal L¹ and hence every transform of one L²). I'm really not that comfortable with saying "a DFT of some time-domain value vector is always an approximation of a CTFT"; there's just too many caveats here, starting with aliasing and thus requiring band-limitation as prior condition for the CT signal; but how's that even defined without doing the CTFT first? – Marcus Müller Oct 26 '20 at 23:35
-
@MBaz. That's it. Can you share any comparison chart of both methods regarding the speed of computation? Using FFT to compute CTFT vs Using direct equation (approximated as summation) of the same finite duration continuous-time signal. – Lelouch Yagami Oct 27 '20 at 15:19
-
I don't have any charts, and anyway the speed of computation will depend on how many samples you take. However, the FFT does many tricks to speed up the calculations, and no faster algorithm is known (but there's no proof that it is the fastest). – MBaz Oct 27 '20 at 15:51
1 Answers
Assuming that future vistors won't take the time to read all the comments, I'd like to give a very simple and straightforward interpretation of the discrete Fourier transform (DFT) as an approximation of the continuous-time Fourier transform (CTFT).
First, we need to assume that the signal to be transformed decays sufficiently for large value of $|t|$. (If it doesn't, we can still use the DFT to approximate the CTFT, but the truncation error will be large.) Furthermore, we choose the origin $t=0$ such that the relevant part of the signal appears for $t\ge 0$. Then we can approximate the Fourier integral in the following way:
$$X(j\Omega)=\int_{-\infty}^{\infty}x(t)e^{-j\Omega t}dt\approx \int_{0}^{T}x(t)e^{-j\Omega t}dt\tag{1}$$
with some sufficiently large $T$. The approximation $(1)$ generally results in a truncation error, which can be made small by an appropriate choice of $T$.
Now we can approximate the right-hand side of $(1)$ by a Riemann sum:
$$\int_{0}^{T}x(t)e^{-j\Omega t}dt\approx\sum_{n=0}^{N-1}x(n\Delta t)e^{-j\Omega n\Delta t}\Delta t\tag{2}$$
where $\Delta t$ is the sampling interval and $T=N\Delta t$. The approximation $(2)$ introduces an aliasing error, which can be made small by choosing $\Delta t$ sufficiently small.
Computing the right-hand side of $(2)$ at discrete frequencies $\Omega_k=2\pi k f_s/N$, $k=0,1,\ldots,N-1$, where $f_s=1/\Delta t$ is the sampling frequency, finally results in
$$\begin{align}X(j\Omega_k)&\approx\sum_{n=0}^{N-1}x(n\Delta t)e^{-j\Omega_k n\Delta t}\Delta t\\&=\frac{1}{f_s}\sum_{n=0}^{N-1}x(n\Delta t)e^{-j\frac{2\pi}{N}nk}\\&=\frac{1}{f_s}\textrm{DFT}\big\{x_d[n]\big\},\qquad x_d[n]=x(n\Delta t)\tag{3}\end{align}$$
Eq. $(3)$ says that the CTFT of $x(t)$ can be approximated on a set of discrete frequencies by the DFT of a sampled version of $x(t)$. Two types of error have to be taken into account: 1. the truncation error, from truncating the signal, and 2. the aliasing error, from sampling the signal.
Note that we can never avoid both errors, because for finite length signals (with zero truncation error) we always get an aliasing error due to the infinite bandwidth of finite length signals, and for perfectly band-limited signals (with zero aliasing error), we always have a truncation error because they can't have finite length. In practice we always have to deal with both types of error.
In sum, answering the question in your question title: under the aforementioned conditions, the DFT is an approximation of the CTFT integral, and it has the advantage that there exist very efficient algorithms (FFT) for its computation.
- 89,963
- 9
- 79
- 179
-
I already know this approximation. Can you share any comparison chart of both methods regarding the speed of computation? Using FFT to compute CTFT vs Using direct equation (approximated as summation) of the same finite duration continuous-time signal. That would be the answer to this question.Mr.MBaz also said FFT is extremely fast. I only got comparison chart of FFT vs DFT direct computation. – Lelouch Yagami Oct 27 '20 at 15:24
-
Doing an integral approximation of the CTFT the textbook way is going to be about as computationally intensive or maybe a bit more, as doing a DFT the hard way. So you can just take the DFT direct computation times as your CTFT times. – TimWescott Oct 27 '20 at 15:29
-
Or you could actually do the work yourself and benchmark both. That'll give you a way deeper understanding. – TimWescott Oct 27 '20 at 15:29
-
2well, they don't listen to me, Matt. maybe they will listen to you. – robert bristow-johnson Oct 27 '20 at 17:46
-
2@robertbristow-johnson: I wrote this down because we don't have this stuff on our site yet, and I think we should have it. The OP seems to want something else, but that's a different matter. – Matt L. Oct 27 '20 at 20:18