Two (simple?) questions about the DFT - Page 1
Forum section: electronics / projects

author: BurnedResistor
author_rank: Regular Contributor
timestamp: September 01, 2017, 01:17:20 pm
content: 1)The DFT's main foundation is the discrete orthogonal property of it's basis vector:The condition of the different frequencies is easy enough to understand as then the product of the two exponential is equal to e^0.The condition with the same frequencies of course makes sense graphically as the product effectively is another sinousioud in both the real and imaginary domain. This means that it's average/integral over one period is 0.I however could not come up with/find a algebraic argument for this. Is there a way to demonstrate that algebraicly?2)The DFT:Which allows for a discrete Signal of length N to be expressed as the sum of N complex sinousoids of frequency 0,1,..,N-1It makes intuative sense that much fewer sinousoids should be required as the signal is not continous, and therefor does not have to deal with issues due to continuity in any order and only has to be equal to the function at discrete points.I however saw no justification of why exactly N sinousoids are required.Why does a N length DFT only require N sinousoids?Thank you in advanceStill in Highschool and trying to wrap my brain around this by scowering sources on the web

author: Marco
author_rank: Super Contributor
timestamp: September 01, 2017, 03:52:20 pm
content: Linear algebra works, N linear equations with N unknowns.Pigeon hole principle works as well.PS. this will piss of mathematicians, but I think it's better to start with real transforms. Complex inputs are too abstract.PPS. working through a first year college Linear Algebra course before trying to understand DFT might not be a bad idea.

author: mrkev
author_rank: Regular Contributor
timestamp: September 03, 2017, 12:02:23 am
content: If I remember this correctly, Nyqist (or Shannon - Kotelnik) theorem comes to this. Basically, you can't sample frequencies above half of your sampling frequency (without information lost). DFT is periodical (meaning k = N to 2N has the same output as k=0 to N) and the Nth freqency you are getting is always your fsampling. Only first half (N/2) of the output has the information you want.So in fact, number of samples doesn't determine the highest frequency of the spectrum, it determines the step (or number of steps) between 0 and fsampling. You won't ever be able to get information that isn't present in your samples.And btw. the point that Marco made about complex computation is a good one. But if you are really serious, I would recommend making short program (or google one), that will compute few samples. If you see them adding up, it's quite obvious what DFT does and how the complex part is important for getting phase together with magnitude.

author: Marco
author_rank: Super Contributor
timestamp: September 03, 2017, 12:27:20 am
content: A real DFT still produces complex outputs (except bin 0 and N+1, which have only one magnitude).It's just that I think most people will find analysing a real input signal more enlightening than a quadrature input signal (which the "normal" DFT uses for analysis).

author: mrkev
author_rank: Regular Contributor
timestamp: September 03, 2017, 12:51:04 am
content: You can still take real input and compute complex spectrum. Or even take just magnitudes from that complex output.

author: CD4007UB
author_rank: Contributor
timestamp: September 03, 2017, 01:33:27 am
content: BurnedResistor, there is a slip in your first equation: the sum is N when k=l (because e^0 is 1).For the other case, the sum is a geometric series (which you may have met in your maths course). The first term is 1 and the common ratio is r=exp[2p.i.(k-l)/N]. The sum is therefore (1-r^N)/(1-r). The numerator vanishes because r^N=exp[2pi.i.(k-l)], which is 1 because k-l must be an integer (and exp[2p.i.m] =1 for any integer m).Hope that helps.

author: mark03
author_rank: Frequent Contributor
timestamp: September 03, 2017, 04:59:23 am
content: Re: your question #2, as has been alluded to above, it helps to have an understanding of vector spaces. Seen in this light, the DFT is a conversion between orthonormal bases. Consider the case where N=4. It's trivial to show that every length-4 sequence can be expressed as a weighted sum of the vectors{1,0,0,0}{0,1,0,0}{0,0,1,0}{0,0,0,1}Also, these vectors are mutually orthogonal and they all have a geometric length of one. so they constitute an orthonormal basis for the vector space of length-4 sequences. Now, one of the properties of a vector space is that it has the same dimensionality no matter which basis you choose to represent its members. Therefore, it will always require exactly four numbers to identify a vector in the space of length-4 sequences, whether those four numbers are the sequence itself (really, the coefficients of the "canonical basis" that I listed above), the coefficients of Fourier basis vectors, Hadamard basis vectors (look this up, it's cool!), or some other basis set. Sounds obvious in retrospect, doesn't it?Some vector spaces have a huge amount of redundancy, e.g. the vector space of all photographs ever taken, digitized to 1024x1024 monochrome pixels. The on-paper dimensionality is, of course, 2^20, but the *effective* dimensionality is much less. It is often the case that a transform like the DFT will reveal this redundancy in the form of "sparsity": many of the basis vectors will have small coefficients which can be zeroed out without adversely affecting the photograph. This, in a nutshell, is how lossy image compression (like JPEG) works.