Fourier Transforms from a Linear Algebra Perspective
Follow the numbers from a moving point, to a wave, to a vector—and then change its coordinates.
What the Fourier transform is
A recording gives us values at successive times. To describe repetition across that recording, we sample simple repeating waves at those same times. Each sampled reference wave gives a wave-vector; choosing enough independent wave-vectors gives us a basis for describing the signal.
The discrete Fourier transform is a change of basis: it expresses the same signal vector as a weighted linear combination of basis wave-vectors. Its input is the recorded values. Its output encodes the weights: multiply each basis wave-vector by its weight and add to reconstruct the original signal vector.
For example, four recorded values give x = (3, 2, −1, 0). These are the components of x in the standard basis, each storing the signal’s value at a particular time. In a wave-vector basis, the coordinates tell us how much of each reference wave builds that same x. Each fixed basis gives one unique set of weights.
Fourier chooses its wave-vectors to describe repetition at different rates. The sampling schedule determines the Fourier basis; the signal’s values determine the weights. PCA chooses its basis from variation across the supplied observations. In both cases, the basis determines what the coordinates mean.
Here is the sequence we will follow:
Represent the sampled signal as a vector. Four equally spaced samples become the components of x. Let u mark the fraction of the block elapsed, and n = 0, 1, 2, 3 label the components. Adding and scaling sampled signals becomes vector addition and scaling.
Read the four filled dots, left to right →
x =32-10Components n = 0, 1, 2, 3
The filled dots supply 3, 2, −1, 0. The hollow endpoint begins the next block. Construct the basis wave-vectors. A point’s horizontal and vertical positions during one turn give the cosine and sine waves. Sample a constant, a one-turn cosine, a one-turn sine and a two-turn cosine at the same four times. Name their wave-vectors b₀, b꜀, bₛ and b₂. These four independent wave-vectors form our basis.
Wave-vector Wave Components at time u 0 ¼ ½ ¾ Constant
b₀1 1 1 1 One-turn cosine
b꜀1 0 -1 0 One-turn sine
bₛ0 1 0 -1 Two-turn cosine
b₂1 -1 1 -1 Every row uses the same four times. The one-turn pair has average zero; the constant supplies the average, and the two-turn cosine supplies alternating variation. Build a signal from known weights. The weights a₀, a꜀, aₛ and a₂ multiply b₀, b꜀, bₛ and b₂, respectively. Add matching components to obtain x:
Known weights:1210Contribution n = 0 n = 1 n = 2 n = 3 1 × b₀ 1 1 1 1 2 × b꜀ 2 0 -2 0 1 × bₛ 0 1 0 -1 0 × b₂ 0 0 0 0 Sum x 3 2 -1 0 Add down each column. For the first component: 1 + 2 + 0 + 0 = 3. The four column totals reproduce x = (3, 2, −1, 0). Recover each basis wave-vector’s weight. Now x and the basis wave-vectors are known, and the weights are unknown. To isolate one weight, take the dot product between x and the corresponding basis wave-vector.
The signal and basis wave-vectors have known components. Their weights are the unknowns:
Multiply each weight into its basis wave-vector:
The first row is . All four rows are:
Start with the cosine wave-vector b꜀ = (1, 0, −1, 0). We want an equation containing a꜀ without the other unknown weights. Dotting both sides with b꜀ gives us that equation, because its dot products with the other basis wave-vectors are zero:
The expression in parentheses is x written as its linear combination. Distribute the same dot product across its four terms:
Each weight is a scalar multiplying its whole vector, so it can be factored outside the dot product:
Evaluate the dot products of the known vectors:
Only the term containing a꜀ remains:
Divide both sides by b꜀ · b꜀ to find a꜀:
For each basis wave-vector b, divide x · b by b · b to recover its weight:
Basis wave-vector x · b b · b Weight b₀ 4 4 a0 = 4 / 4 = 1 b꜀ 4 2 ac = 4 / 2 = 2 bₛ 2 2 as = 2 / 2 = 1 b₂ 0 4 a2 = 0 / 4 = 0 For b꜀, the dot product gives 4 = 2a꜀, so a꜀ = 2. Express the signal in the complex Fourier basis. We have completed the decomposition in our real basis. Next, construct the basis used by the usual DFT, recover its weights, and identify the entries the DFT returns.
We have described the signal x as a linear combination of the real basis wave-vectors:
The cosine basis wave-vector b꜀ contains the horizontal positions of a point sampled during one turn around the unit circle; the sine basis wave-vector bₛ contains its vertical positions. To keep both positions together at each sample, combine the corresponding components as b꜀ + i bₛ, with i² = −1. Call the resulting wave-vector v₁:
Each component of v₁ is a complex number: the component from b꜀ is its real part, and the component from bₛ is its imaginary part.
The usual DFT describes the same signal using complex basis wave-vectors. Repeat this construction for zero, one, two and three turns, labeling the turn count k. These four independent wave-vectors form a basis for our four-component signal, giving four DFT entries:
At our four sample times, the zero-turn and two-turn sine components are all zero. The three-turn cosine matches b꜀ and the three-turn sine matches −bₛ.
We know x and these four basis wave-vectors. We want their weights, which we’ll call c₀, c₁, c₂ and c₃:
To isolate c₁, we need a multiply-and-add operation that gives zero on v₀, v₂ and v₃, and a known nonzero result on v₁. Reverse the imaginary signs of v₁ to get (1, −i, −1, i). This is its complex conjugate, written with a bar:
The dot still means multiply matching components and add; the bar tells us to reverse the basis wave-vector’s imaginary signs first. Since i(−i) = 1, every component of v₁ times its conjugate gives 1. The four comparisons are:
Apply that operation to both sides of the equation for x:
Distribute across the four weighted wave-vectors:
Factor out each weight and use the known comparisons. Only c₁ remains:
Evaluate the left side from the known signal, then divide by 4 to recover the weight:
We now have the weight c₁. The usual DFT keeps the sum 4 − 2i as its output and places the division by 4 in reconstruction. This choice of where to divide is a normalization convention; dividing during the forward transform could instead give the weights directly. Call the stored sum X[1]:
Thus X[1] is the weight scaled by 4. For N samples, every complex basis wave-vector has squared length N, so X[k] = Ncₖ. The two numbers carry the same information; dividing X[k] by N recovers the weight.
Repeat the same operation for each basis wave-vector: the sum gives X[k], and division by 4 gives its weight cₖ. Using the dot products already calculated for x = (3, 2, −1, 0):
Basis wave-vector DFT entry Weight Collect the weights in c and the DFT entries in X:
Both descriptions reconstruct the same four signal components. For this real signal, c₃ is the conjugate of c₁; their imaginary contributions cancel when the weighted wave-vectors are added.
Write the dot product as the DFT formula. We have calculated each entry using . To use this operation for any sample count, express the components of vₖ and the addition of component products with compact formulas.
Each DFT entry comes from dotting x with the conjugate of one complex basis wave-vector. For k = 1, the calculation was:
To perform this operation for N equally spaced samples, we need a formula for each component of vₖ. Write vₖ[n] for its component at sample n, just as x[n] names the signal’s component there. k chooses the basis wave-vector; n chooses the component.
We built each component from cosine + i × sine of the circle angle θ. The complex exponential, written , abbreviates that combination. Reversing the imaginary sign gives its conjugate:
For one turn sampled four times, the angles are 0, π/2, π and 3π/2. The conjugated wave-vector used above therefore has these two equivalent forms:
For N samples, sample n occurs at fraction n/N of the block. The basis wave-vector vₖ comes from k turns across that block: its total angle is 2πk, so its angle at sample n is 2πk × n/N. This supplies every component:
Now expand the original dot product into its component products. Hold k fixed and add over n. The symbol Σ abbreviates this addition; substituting the component formula gives the DFT formula:
Repeat for k = 0, …, N − 1 to obtain all N DFT entries. These N independent complex basis wave-vectors sample rotating waves called Fourier modes. For our four samples, each column below is a conjugated basis wave-vector. The rows label its components by n:
n ↓ · k → 0 1 2 3 Take the dot product of x = (3, 2, −1, 0) with the conjugated basis wave-vector in column k. This gives X[k], the corresponding entry of X = (4, 4 − 2i, 0, 4 + 2i).
As before, recovering the weight requires dividing by the basis wave-vector’s squared length. Each component times its own conjugate is 1; N such products give squared length N. Comparisons between different basis wave-vectors give zero, so:
The entries X[k] store the sums; the weights cₖ multiply the basis wave-vectors when reconstructing x. Reconstruct the sampled signal. Use the recovered weights cₖ = X[k]/N in the linear combination of complex basis wave-vectors. This reverses the change of coordinates and returns the original samples.
We now know the complex weights. Multiply each basis wave-vector by its weight and add, exactly as we did with the real basis:
The first row adds 1 + (1 − i/2) + 0 + (1 + i/2) = 3. The imaginary terms cancel; adding each other row gives the remaining signal components:
Rebuilt x =32-10For N samples, use cₖ = X[k]/N and . Writing the same weighted sum one component at a time gives the inverse DFT:
The forward DFT computes the comparisons X[k]. Division by N gives the weights cₖ; the inverse adds the weighted basis wave-vectors to rebuild x. From the dot product to a continuous-time integral. Give the samples actual times, then sample the same continuous signal more closely. Scaling the dot product by the time width of each sample turns its products into areas whose sum approaches an integral.
We know how to take the dot product of a sampled signal with a conjugated basis wave-vector. Our next goal is the corresponding comparison for a signal defined at every time. Use the same curve drawn in step 1 over one time unit, with value zero outside 0 ≤ t < 1. Write its continuous values as x(t).
Our four samples are separated by Δt = ¼. For N samples, let the block duration be T = NΔt. Sample n occurs at tₙ = nΔt, and a basis wave making k turns in the block has frequency fₖ = k/T. These substitutions rewrite the same angle and dot product:
For our one-turn wave over one time unit, f = 1. The conjugated wave has a cosine real part and a negative-sine imaginary part. Its product with the signal is:
Sample this same continuous signal more closely. To give each sample its share of time, multiply the dot product by Δt. Each product then contributes a rectangle’s area: its height times its time width. The illustration shows both parts of this comparison:
Same signal and frequency · choose the number of samples
Time width: . Each shaded rectangle has that width and the sampled product as its height.
Real part
Imaginary part
Areas below zero count negatively. The selected samples give:
Choosing more samples shrinks Δt. The number of samples per time unit, 1/Δt, is the sampling rate. As Δt tends to zero at fixed T, the rectangles’ signed areas approach an integral. The time width is then written dt:
For this particular example at f = 1, the four-sample area sum already equals the integral: 1 − i/2. The narrower rectangles show how the same operation extends to continuous time.
For a signal across all time, extend the observation window in both directions to cover it. The same integral at any frequency f gives the continuous Fourier transform, X(f):
Our chosen signal is zero outside 0 ≤ t < 1, so integrating over that block already gives its all-time transform. In particular, X(1) = 1 − i/2.
Repeating a fixed block
If we repeat the block periodically, its complex weights approach the finite-interval integral divided by T. Adding those weighted whole-turn waves gives a Fourier series. The all-time transform above instead uses the specified signal, including its values outside the block.
The transform compares the signal with a wave at each frequency. Reconstruction uses these results to add the weighted waves back together. Reconstruct the continuous signal. Return to the weighted sum of waves. We now need to identify their weights from X(f), then show how adding those weighted waves becomes an integral over frequency.
We reconstruct x(t) by adding weighted waves. To connect their weights to X(f), start with cₖ = X[k]/N and examine how the available frequencies change with the block duration.
For T = 1, successive whole-turn waves have frequencies 0, 1, 2, … . For T = 2, they have frequencies 0, ½, 1, … . The gap between them is the frequency spacing, Δf = 1/T. It supplies the second factor in each weight:
Keep Δt = ¼ and extend our one-unit example with its specified zeros. At f = 1, Δt X[k] stays 1 − i/2, while a longer block gives a smaller frequency spacing and a smaller weight:
Duration T Entry k at f = 1 Spacing Δf Weight cₖ 1 1 1 1 − i/2 2 2 ½ ½ − i/4 As the time gaps shrink and the window expands, Δt X[k] approaches X(f). A small frequency interval contributes approximately X(f) Δf; in the limit, write X(f) df. This makes X(f) a density of weights over frequency.
Multiply each wave by its frequency-interval weight and add, as in our finite reconstruction. For this real signal, contributions at f and −f have conjugate weights, so their imaginary parts cancel, as the paired complex contributions did earlier. Including all frequencies gives the inverse Fourier transform:
This recovers the continuous waveform at its continuous points, including x(½) = −1 in our example. At a jump, Fourier reconstruction gives the average of the two sides. Forward: accumulate across time. Inverse: accumulate weighted waves across frequency.
The detailed walkthrough develops steps 1–4 in sections 01–05, the complex basis, DFT and inverse from steps 5–7 in section 06, and steps 8–9 in section 07.
Prerequisites: vectors, linear combinations, matrices and dot products; see the change-of-basis tutorial.
One vector, four components
Imagine a sensor that measures a changing quantity at equal time intervals. Store four consecutive measured values, 3, 2, −1 and 0, as the components of our signal vector x.
To mark where we are within the recorded block, let u be the fraction of its duration that has elapsed: u = 0 is the start, and u = 1 is the start of the next block. Write W(u) for the signal’s value at that point in the block. The curve below shows one such signal. Sampling it at u = 0, ¼, ½ and ¾ gives the four components of x:
Plotting a signal puts time across the page and signal value vertically. The vector x has four components, indexed by n = 0, 1, 2 and 3. The notation x[n] means the component of x at index n. Its associated sample time is u = n/4. For example, x[2] = −1 is the component at index 2, associated with u = ½.
Sampling carries addition and scaling from curves to vectors: if two curves add to W, their values add at each sample time, so their sampled vectors add to x. This is the bridge we will use. A weighted combination that reproduces x matches these four samples exactly; specifying the curve between them requires additional information.
One way to build x is to add vectors that affect a single component at a time. Let eₙ have component 1 at index n and zero at every other index. For example, e₀ = (1, 0, 0, 0) and e₁ = (0, 1, 0, 0). These vectors form the standard basis:
Each coefficient answers “what happened at this moment?” Our new coordinates should instead describe repeated movement across the block. We will choose reference waves by how many times they repeat: a constant level, one repetition, two repetitions, and so on, keeping the independent wave-vectors obtained by sampling them. Completing whole repetitions lets each reference repeat smoothly from one block to the next. A point moving steadily around a circle gives us a concrete way to construct those patterns.
Read a moving point in two directions
Place a point one unit to the right of a circle’s center. Keep it one unit from the center and move it counterclockwise at a steady speed, completing one turn during our block. At any moment we can read two numbers: its horizontal position relative to the center, and its vertical position.
At the start it is at (1, 0). A quarter turn puts it at the top, (0, 1). Half a turn puts it at the left, (−1, 0). Three quarters of a turn puts it at the bottom, (0, −1). Use the quarter-turn buttons to follow those positions into the two plots:
Horizontal position over time
Vertical position over time
The horizontal positions at the four sample times are 1, 0, −1, 0. The vertical positions are 0, 1, 0, −1. Storing each sequence in order gives the components of two vectors. Between the sample times, the point’s horizontal and vertical positions vary continuously.
The horizontal position is called the cosine of the angle turned. The vertical position is its sine. A complete turn has angle 2π when measured in radians; a quarter turn has angle π/2. If θ denotes the angle, then after a fraction u of our one-turn block:
A full return to the starting position is one cycle. These two curves each complete one cycle per block. Sampling them has constructed the first two basis wave-vectors we were looking for: b꜀ from the cosine and bₛ from the sine.
The cosine begins at its maximum; the sine begins at zero and rises. They describe the same repeating rate at different starting positions. Scaling and adding their wave-vectors lets a one-cycle oscillation reach its peak at different times while keeping that rate fixed.
We now have two basis wave-vectors, and we want enough to build every four-component signal vector. The components of b꜀ and bₛ each add to zero, so any weighted combination of these two also has component sum zero. A signal such as (1, 1, 1, 1) has sum 4. To represent it, our basis needs another wave-vector that shifts all four components together. Section 03 constructs that wave-vector, then identifies the final missing direction.
Complete the basis of wave-vectors
The signal (1, 1, 1, 1) stays at 1 at every sample. Use it as our third basis wave-vector, b₀. A weight of 1 adds 1 to all four components; a weight of 2 adds 2 to each. This constant contribution sets the signal’s average across the four samples—its overall level—while the cosine and sine describe variation around that level.
We now have three basis wave-vectors. In every weighted combination of them, the total of components 0 and 2 equals the total of components 1 and 3. The cosine and sine contribute zero to each pair; the constant contributes equally to both. Yet a signal can alternate as (1, −1, 1, −1): one pair totals 2, and the other totals −2. Representing that difference requires one more independent wave-vector.
The fourth basis wave-vector comes from the next repeating rate. Make the point complete two turns in the same block and read its horizontal position. At our four sample times it has turned 0, ½, 1 and 1½ turns. It is therefore at the right, left, right and left of the circle. Storing those horizontal positions gives exactly the missing pattern, 1, −1, 1, −1. Call this alternating wave-vector b₂.
The number of cycles per unit time is a wave’s frequency. For now we measure it in cycles per block: the constant has frequency 0; b꜀ and bₛ share frequency 1; b₂ has frequency 2. Compare the four reference waves at the same marked times and the basis wave-vectors obtained from their samples:
Constant wave-vector · b₀
The signal stays at 1 throughout the block.
One-turn cosine wave-vector · b꜀
Read horizontal position during one turn.
One-turn sine wave-vector · bₛ
Read vertical position during one turn.
Two-turn cosine wave-vector · b₂
Read horizontal position during two turns.
Each column of numbers was obtained by sampling its curve at u = 0, ¼, ½ and ¾, in that order. At the same time u, a point making two turns has traveled through twice the angle of a point making one turn:
The two-turn point is on the horizontal axis at all four sample times. Its vertical position is always zero there, so the two-turn sine gives the zero vector and contributes no additional direction.
We have selected reference waves by their repeating rates and kept four independent wave-vectors. Together they form a basis: every four-component signal vector has one unique set of weights in this collection. Its weights are its coordinates in this basis. The next section builds a signal with these coordinates; section 05 shows how to recover them.
Why four wave-vectors complete this basis
The constant wave-vector supplies the shared level, the cosine and sine wave-vectors supply two independent one-cycle variations, and the alternating wave-vector supplies the remaining variation between the two pairs. These wave-vectors have nonzero lengths and every pair has dot product zero, as section 05 will show. That makes them four independent directions in a four-dimensional space.
Still faster waves can give wave-vectors we already have. Four samples can distinguish four independent coordinates; the continuous curves supply a particular way to construct those coordinates.
For example, sampling a three-turn cosine gives the same four vector components as sampling the one-turn cosine. Different continuous waves producing the same recorded samples is called aliasing. The Fourier representation of the sampled vector is unique once its basis is fixed, while determining the continuous motion that produced those samples requires additional information.
The choice is purposeful: one coordinate controls the shared level, two control the size and timing of one-cycle variation, and one controls alternating variation. Multiplying a basis wave-vector by a scalar scales every component by that factor; adding wave-vectors adds their components at matching indices.
Build a signal from known weights
The basis is now fixed. First we will start with known weights and see how they construct a signal. Choose weights 1, 2, 1 and 0 for the constant, one-turn cosine, one-turn sine and alternating wave-vectors, respectively. Their contributions add to our original recording:
Let a be the column of weights, in the fixed order constant, cosine, sine, alternating. Our example has a = (1, 2, 1, 0). The four weights describe the same vector whose sample values are x = (3, 2, −1, 0). Change a weight and follow its contribution down the table:
| Contribution | n = 0 | n = 1 | n = 2 | n = 3 |
|---|---|---|---|---|
| 1 × b₀ | 1 | 1 | 1 | 1 |
| 2 × b꜀ | 2 | 0 | -2 | 0 |
| 1 × bₛ | 0 | 1 | 0 | -1 |
| 0 × b₂ | 0 | 0 | 0 | 0 |
| Sum x | 3 | 2 | -1 | 0 |
The sample coordinates (3, 2, −1, 0) and the wave coordinates (1, 2, 1, 0) describe the same signal vector using different bases. Translating between them is a change of basis. Each wave coordinate is the weight of a basis wave-vector. The basis and its order tell us what each coordinate multiplies.
Place the four basis wave-vectors into the columns of a matrix B. Multiplying B by a scales and adds those columns, exactly as in the table:
B takes wave coordinates in and gives sample coordinates out. We have just supplied the weights a and computed x = Ba. A recording presents the reverse problem: it supplies x, and we must find a. The next section keeps B fixed and solves that problem.
Recover the weights from a known signal
We now know the signal x = (3, 2, −1, 0) and the four basis wave-vectors. The unknowns are the weights that reproduce x. Finding them is the signal’s decomposition in the chosen basis. Write the unknown weights as a₀, a꜀, aₛ and a₂, in the same order as our basis:
The signal and basis wave-vectors have known components. Their weights are the unknowns:
Multiply each weight into its basis wave-vector:
The first row is . All four rows are:
Start with the cosine wave-vector b꜀ = (1, 0, −1, 0). We want an equation containing a꜀ without the other unknown weights. Dotting both sides with b꜀ gives us that equation, because its dot products with the other basis wave-vectors are zero:
The expression in parentheses is x written as its linear combination. Distribute the same dot product across its four terms:
Each weight is a scalar multiplying its whole vector, so it can be factored outside the dot product:
Evaluate the dot products of the known vectors:
Only the term containing a꜀ remains:
Divide both sides by b꜀ · b꜀ to find a꜀:
Each dot product multiplies matching components and adds the products. Matching signs give positive products; opposite signs give negative products. In particular, the numerator and denominator used above are:
Doubling x doubles its dot product with b꜀ and therefore doubles the recovered weight. Dividing by b꜀ · b꜀ accounts for the chosen basis wave-vector’s squared length.
Every pair of distinct wave-vectors in our basis has dot product zero. Such vectors are orthogonal: perpendicular in the vector space. This concerns their components; the crossing angles of curves drawn on a page describe a different geometry. Orthogonality lets the same recovery method isolate any one of our four weights:
The denominator b · b is the squared length of b. It supplies the factor multiplying that wave-vector’s weight in the dot product. For a basis whose vectors have nonzero dot products with one another, the expansion would retain other weights and require solving for them together.
Now repeat the calculation with x = (3, 2, −1, 0) and each basis wave-vector in turn: b₀, b꜀, bₛ and b₂. These are four separate dot products with the same signal. Each card shows that result, the squared length of the selected wave-vector, and their ratio:
Constant wave-vector · b₀
One-turn cosine wave-vector · b꜀
One-turn sine wave-vector · bₛ
Two-turn cosine wave-vector · b₂
In our fixed basis order, the recovered weights are:
Section 04 went from weights to signal; we have now gone from signal to weights. Substituting this a into x = Ba rebuilds the original components. This is the coordinate-recovery operation that Fourier performs in its wave-vector basis.
The explorer below repeats the calculation for one weight at a time. Keep the example signal selected and choose the basis wave-vector whose weight you want to recover. The table multiplies their matching components; the result shows the dot product, the squared length of the basis wave-vector, and the recovered weight. You can also choose a single basis wave-vector as x: its own weight is 1, and the other three weights are 0.
Signal vector x
Basis wave-vector b꜀
| Index n | 0 | 1 | 2 | 3 |
|---|---|---|---|---|
| x | 3 | 2 | -1 | 0 |
| b꜀ | 1 | 0 | -1 | 0 |
| Product | 3 | 0 | 1 | 0 |
The same calculation explains uniqueness. Dotting any proposed weighted sum with one basis wave-vector removes the other contributions and forces that weight to equal the ratio above. Each of the four weights is fixed independently.
Express coordinate recovery as a matrix
The matrix equation Ba = x describes the same problem: B and x are known, and a is unknown. The matrix that reverses B is its inverse, B⁻¹. Put each basis wave-vector across a row and divide that row by its squared length. Row-by-column multiplication then performs our four weight-recovery calculations:
Turning columns into rows is the transpose. If the columns were also scaled to length one, transposing B would be enough to invert it. Our columns keep the convenient wave heights ±1, so their different lengths require the row divisions shown here.
The recovered coordinates now answer the question that motivated our basis: how much steady level, one-cycle variation and alternating variation reproduce this signal? The sampling schedule fixed the basis wave-vectors; the signal supplied their weights. PCA’s data-selected basis answers a different question about variation across observations.
We have finished recovering the four real weights. The usual DFT uses a complex basis. The next section constructs those basis wave-vectors, recovers their weights with the same apply-to-both-sides reasoning, and connects the result to the DFT formula and reconstruction.
Recover complex weights and write the DFT
We have described the signal x as a linear combination of the real basis wave-vectors:
The cosine basis wave-vector b꜀ contains the horizontal positions of a point sampled during one turn around the unit circle; the sine basis wave-vector bₛ contains its vertical positions. To keep both positions together at each sample, combine the corresponding components as b꜀ + i bₛ, with i² = −1. Call the resulting wave-vector v₁:
Each component of v₁ is a complex number: the component from b꜀ is its real part, and the component from bₛ is its imaginary part.
The usual DFT describes the same signal using complex basis wave-vectors. Repeat this construction for zero, one, two and three turns, labeling the turn count k. These four independent wave-vectors form a basis for our four-component signal, giving four DFT entries:
At our four sample times, the zero-turn and two-turn sine components are all zero. The three-turn cosine matches b꜀ and the three-turn sine matches −bₛ.
We know x and these four basis wave-vectors. We want their weights, which we’ll call c₀, c₁, c₂ and c₃:
To isolate c₁, we need a multiply-and-add operation that gives zero on v₀, v₂ and v₃, and a known nonzero result on v₁. Reverse the imaginary signs of v₁ to get (1, −i, −1, i). This is its complex conjugate, written with a bar:
The dot still means multiply matching components and add; the bar tells us to reverse the basis wave-vector’s imaginary signs first. Since i(−i) = 1, every component of v₁ times its conjugate gives 1. The four comparisons are:
Apply that operation to both sides of the equation for x:
Distribute across the four weighted wave-vectors:
Factor out each weight and use the known comparisons. Only c₁ remains:
Evaluate the left side from the known signal, then divide by 4 to recover the weight:
We now have the weight c₁. The usual DFT keeps the sum 4 − 2i as its output and places the division by 4 in reconstruction. This choice of where to divide is a normalization convention; dividing during the forward transform could instead give the weights directly. Call the stored sum X[1]:
Thus X[1] is the weight scaled by 4. For N samples, every complex basis wave-vector has squared length N, so X[k] = Ncₖ. The two numbers carry the same information; dividing X[k] by N recovers the weight.
Repeat the same operation for each basis wave-vector: the sum gives X[k], and division by 4 gives its weight cₖ. Using the dot products already calculated for x = (3, 2, −1, 0):
| Basis wave-vector | DFT entry | Weight |
|---|---|---|
Collect the weights in c and the DFT entries in X:
Both descriptions reconstruct the same four signal components. For this real signal, c₃ is the conjugate of c₁; their imaginary contributions cancel when the weighted wave-vectors are added.
The one-turn cosine and sine describe variation at the same frequency. Their weights determine the wave’s size and the timing of its peak. The position within a cycle at a chosen starting time is its phase. Our complex weights retain both pieces of information: c₁ = (a꜀ − i aₛ)/2 and c₃ = (a꜀ + i aₛ)/2. Together with c₀ = a₀ and c₂ = a₂, they retain the same four real degrees of freedom.
To use this construction for any sample count, we need a formula for each component of the complex basis wave-vector and a compact way to write its dot product with x:
Each DFT entry comes from dotting x with the conjugate of one complex basis wave-vector. For k = 1, the calculation was:
To perform this operation for N equally spaced samples, we need a formula for each component of vₖ. Write vₖ[n] for its component at sample n, just as x[n] names the signal’s component there. k chooses the basis wave-vector; n chooses the component.
We built each component from cosine + i × sine of the circle angle θ. The complex exponential, written , abbreviates that combination. Reversing the imaginary sign gives its conjugate:
For one turn sampled four times, the angles are 0, π/2, π and 3π/2. The conjugated wave-vector used above therefore has these two equivalent forms:
For N samples, sample n occurs at fraction n/N of the block. The basis wave-vector vₖ comes from k turns across that block: its total angle is 2πk, so its angle at sample n is 2πk × n/N. This supplies every component:
Now expand the original dot product into its component products. Hold k fixed and add over n. The symbol Σ abbreviates this addition; substituting the component formula gives the DFT formula:
Repeat for k = 0, …, N − 1 to obtain all N DFT entries. These N independent complex basis wave-vectors sample rotating waves called Fourier modes. For our four samples, each column below is a conjugated basis wave-vector. The rows label its components by n:
| n ↓ · k → | ||||
|---|---|---|---|---|
| 0 | ||||
| 1 | ||||
| 2 | ||||
| 3 |
Take the dot product of x = (3, 2, −1, 0) with the conjugated basis wave-vector in column k. This gives X[k], the corresponding entry of X = (4, 4 − 2i, 0, 4 + 2i).
As before, recovering the weight requires dividing by the basis wave-vector’s squared length. Each component times its own conjugate is 1; N such products give squared length N. Comparisons between different basis wave-vectors give zero, so:
Having recovered the complex weights, the next question is how to use them to rebuild the signal. Return to the same linear combination, with the weights now known:
We now know the complex weights. Multiply each basis wave-vector by its weight and add, exactly as we did with the real basis:
The first row adds 1 + (1 − i/2) + 0 + (1 + i/2) = 3. The imaginary terms cancel; adding each other row gives the remaining signal components:
For N samples, use cₖ = X[k]/N and . Writing the same weighted sum one component at a time gives the inverse DFT:
Both directions describe the same finite change of coordinates. We have reconstructed every recorded component. Describing a continuous waveform also requires specifying what happens between samples and beyond the recorded interval.
Accumulate across continuous time
We have reconstructed the sampled signal. Now extend the dot-product comparison to a signal defined at every time: attach times to the samples, scale by the duration each sample represents, and let those durations shrink. The same continuous example will make each step visible.
We know how to take the dot product of a sampled signal with a conjugated basis wave-vector. Our next goal is the corresponding comparison for a signal defined at every time. Use the same curve drawn in step 1 over one time unit, with value zero outside 0 ≤ t < 1. Write its continuous values as x(t).
Our four samples are separated by Δt = ¼. For N samples, let the block duration be T = NΔt. Sample n occurs at tₙ = nΔt, and a basis wave making k turns in the block has frequency fₖ = k/T. These substitutions rewrite the same angle and dot product:
For our one-turn wave over one time unit, f = 1. The conjugated wave has a cosine real part and a negative-sine imaginary part. Its product with the signal is:
Sample this same continuous signal more closely. To give each sample its share of time, multiply the dot product by Δt. Each product then contributes a rectangle’s area: its height times its time width. The illustration shows both parts of this comparison:
Same signal and frequency · choose the number of samples
Time width: . Each shaded rectangle has that width and the sampled product as its height.
Real part
Imaginary part
Areas below zero count negatively. The selected samples give:
Choosing more samples shrinks Δt. The number of samples per time unit, 1/Δt, is the sampling rate. As Δt tends to zero at fixed T, the rectangles’ signed areas approach an integral. The time width is then written dt:
For this particular example at f = 1, the four-sample area sum already equals the integral: 1 − i/2. The narrower rectangles show how the same operation extends to continuous time.
For a signal across all time, extend the observation window in both directions to cover it. The same integral at any frequency f gives the continuous Fourier transform, X(f):
Our chosen signal is zero outside 0 ≤ t < 1, so integrating over that block already gives its all-time transform. In particular, X(1) = 1 − i/2.
Repeating a fixed block
If we repeat the block periodically, its complex weights approach the finite-interval integral divided by T. Adding those weighted whole-turn waves gives a Fourier series. The all-time transform above instead uses the specified signal, including its values outside the block.
We now have X(f), the comparison with a wave at each frequency. To reconstruct x(t), we need to turn these comparisons into the weights of a continuous sum of waves:
We reconstruct x(t) by adding weighted waves. To connect their weights to X(f), start with cₖ = X[k]/N and examine how the available frequencies change with the block duration.
For T = 1, successive whole-turn waves have frequencies 0, 1, 2, … . For T = 2, they have frequencies 0, ½, 1, … . The gap between them is the frequency spacing, Δf = 1/T. It supplies the second factor in each weight:
Keep Δt = ¼ and extend our one-unit example with its specified zeros. At f = 1, Δt X[k] stays 1 − i/2, while a longer block gives a smaller frequency spacing and a smaller weight:
| Duration T | Entry k at f = 1 | Spacing Δf | Weight cₖ |
|---|---|---|---|
| 1 | 1 | 1 | 1 − i/2 |
| 2 | 2 | ½ | ½ − i/4 |
As the time gaps shrink and the window expands, Δt X[k] approaches X(f). A small frequency interval contributes approximately X(f) Δf; in the limit, write X(f) df. This makes X(f) a density of weights over frequency.
Multiply each wave by its frequency-interval weight and add, as in our finite reconstruction. For this real signal, contributions at f and −f have conjugate weights, so their imaginary parts cancel, as the paired complex contributions did earlier. Including all frequencies gives the inverse Fourier transform:
Finite blocks and continuous signals
The DFT reconstructs its supplied samples exactly. The waveform between and beyond them depends on additional measurements or an explicit signal model. Here the displayed curve and its zero extension provide that model.
The integral formulas hold under suitable convergence conditions; for the piecewise smooth example, reconstruction returns the signal at continuity points and the average of its two sides at a jump. Waves that continue forever, such as a pure sine of constant size, require a generalized version of the all-time transform.
Objects, symbols and terminology
- Signal; x
- The quantity recorded over time; x is the signal vector with standard-basis components (3, 2, −1, 0).
- W(u)
- Continuous signal value at fraction u of the illustrated block. Sampling gives x[n] = W(n/4).
- Component
- A scalar entry of a vector in a specified basis. The standard-basis components x[n] store sampled signal values.
- u; n; x[n]
- Fraction of the recorded block elapsed; integer component index; the component of x at that index. The sample time associated with x[n] is u = n/4 in the example.
- eₙ
- Standard basis vector with component one at index n and zero at every other index.
- θ; radians
- Angle of the moving point, with a full turn equal to 2π radians.
- Cosine; sine
- Horizontal and vertical positions of a point on a circle of radius one.
- Cycle; frequency
- One complete repetition; number of repetitions per unit time.
- Wave-vector
- A vector of samples from a reference wave at the same times as the signal samples. A basis wave-vector is one of the wave-vectors chosen to form the basis.
- b₀, b꜀, bₛ, b₂
- The constant, one-turn cosine, one-turn sine and two-turn cosine basis wave-vectors, in that fixed order.
- Basis; coordinates
- Independent vectors spanning the space; the unique weights of those vectors that build a given vector.
- Overall level
- The average of the four signal components, represented by the constant contribution.
- Decomposition
- Recovering the weights that express a supplied signal vector as a linear combination of the chosen basis vectors.
- a; a₀, a꜀, aₛ, a₂
- Column of real wave coordinates—the weights of the four basis wave-vectors—initially (1, 2, 1, 0).
- B; B⁻¹
- Matrix with the four basis wave-vectors as columns; its inverse, translating sample coordinates back to wave coordinates.
- Dot product; ·
- Here the dot denotes multiplying matching components and adding. For a real vector b, b · b is its squared length. For a complex vector v, use v · v̄ for its squared length.
- Orthogonal
- Real vectors whose dot product is zero. For complex vectors, conjugate the reference first: vⱼ · v̄ₖ = 0 for different basis wave-vectors.
- Transpose
- The operation that swaps a matrix’s rows and columns.
- Phase
- Position within an oscillation’s cycle at a chosen reference time.
- Complex number; real and imaginary parts
- A number written horizontal + i × vertical. The horizontal coordinate is its real part; the vertical coordinate is its imaginary part.
- Complex conjugate; v̄ₖ
- Reverse the sign of every imaginary part. Multiplying a unit-circle component by its conjugate gives 1; multiplying vₖ by v̄ₖ and adding gives N.
- i; eⁱᶿ
- Complex unit with i² = −1; the complex exponential representing the rotating point cos θ + i sin θ.
- Σ
- Add the terms over the indicated indices.
- vₖ; vₖ[n]
- Complex basis wave-vector formed by sampling k turns across the block at N equally spaced times; its component at sample n is .
- c; cₖ
- Complex basis weights, distinct from the real weights a. The signal is x = ∑ₖ cₖvₖ. Each cₖ = X[k]/N; our example has c = (1, 1 − i/2, 0, 1 + i/2).
- Fourier mode
- A basis oscillation. In the complex DFT, k selects a rotating basis wave, and vₖ stores its N sampled components. There are N independent basis wave-vectors.
- N; k; X[k]
- Number of samples; number of reference-wave turns across the block, indexed from 0 to N − 1; complex DFT entry X[k] = x · v̄ₖ, the comparison result before division by N. Thus X[k] = Ncₖ.
- Normalization convention
- The choice of where to apply the scale factor. Here the forward DFT returns X[k] = Ncₖ, and reconstruction divides by N to recover the weights.
- DFT; inverse DFT
- Finite change from samples to complex wave coordinates; the reverse reconstruction operation.
- Fourier series
- An infinite-sum description of a periodic continuous signal using whole-cycle reference waves.
- t; f; x(t); X(f)
- Continuous time; cycles per unit time; continuous-time signal; its Fourier transform.
- dt; df; density
- Infinitesimal time and frequency widths used in integration; X(f) contributes through X(f) df in reconstruction.
- Δt; T; tₙ; fₖ
- Time between samples; block duration T = NΔt; sample time tₙ = nΔt for a block beginning at zero; frequency k/T for k turns per block.
- Sampling rate
- Number of measurements per unit time, 1/Δt. A reference wave’s frequency k/T counts its turns per unit time.
- Δf; cₖ = X[k]/N
- Spacing 1/T between reference frequencies; the complex wave-vector weight, equivalently (Δt X[k])Δf. In the continuous limit, Δt X[k] approaches X(f) and the frequency-interval weight becomes X(f) df.
