Library / Signal processing and digital filters / DSP-06
Signal processing and digital filters
Complex DFT coefficient at one bin
Forward discrete Fourier transform coefficient at bin k of the first N samples (up to 8 here), with no scale factor.
- Ref
- DSP-06
- Rev
- v1
- Field
- Signal processing and digital filters
- Result
- |X[k]| [V]
The DFT coefficient of bin k projects the record onto a complex exponential that completes k cycles in N samples: X[k] = Σ x[n]e^(−i2πkn/N). With no scale factor, a real sine of peak amplitude A that fits the record exactly gives |X[k]| = AN/2 at its bin. The result is complex and depends on the time origin of the record.
Forward discrete Fourier transform coefficient at bin k of the first N samples (up to 8 here), with no scale factor. The result is complex and depends on the record time origin. The page returns its magnitude; the real part, imaginary part and phase are in the derived rows.
Calculator
- Real part of X[k]2.449×10−16 V
- Imaginary part of X[k]−2 V
- Phase of X[k]−90 °
What drives the result
Each variable is moved across its typical range while the others stay at the values above. The longest bar is the key driver.
- Bin 1 holds 2.4493×10−16 − 2i V, a magnitude of 2 V.
- If the record is one cycle of a real sinusoid at this bin, its peak amplitude is 2|X|/N = 1 V.
Chart data as tables
Ranked variables
| Variable | Typical range | Lowest result | Highest result | Swing (V) | Local step | Change in result |
|---|---|---|---|---|---|---|
| x1 Sample 1 | −10 to 10 V | 0.3333 | 11 | 10.67 | +0.4 V | +20 % |
| x3 Sample 3 | −10 to 10 V | 0.3333 | 11 | 10.67 | +0.4 V | −20 % |
| x0 Sample 0 | −10 to 10 V | 2 | 10.2 | 8.198 | +0.4 V | +1.98 % |
| x2 Sample 2 | −10 to 10 V | 2 | 10.2 | 8.198 | +0.4 V | +1.98 % |
| N Record length | 1 to 8 samples | 0 | 2 | 2 | +1 samples | −4.89 % |
| k Bin index | 0 to 7 | 0 | 2 | 2 | +1 | −100 % |
| x4 Sample 4 | −10 to 10 V | 2 | 2 | 0 | +0.4 V | 0 % |
| x5 Sample 5 | −10 to 10 V | 2 | 2 | 0 | +0.4 V | 0 % |
| x6 Sample 6 | −10 to 10 V | 2 | 2 | 0 | +0.4 V | 0 % |
| x7 Sample 7 | −10 to 10 V | 2 | 2 | 0 | +0.4 V | 0 % |
Sweep of Sample 1
| Sample 1 (V) | Magnitude of the coefficient (V) |
|---|---|
| −10 | 9 |
| −7.5 | 6.5 |
| −5 | 4 |
| −2.5 | 1.5 |
| 0 | 1 |
| 2.5 | 3.5 |
| 5 | 6 |
| 7.5 | 8.5 |
| 10 | 11 |
Sweep one variable
Variables and how each one contributes
Magnitude of the coefficient
What the equation gives you. Everything else feeds it.
Record length
The number of samples used, up to 8 here. A longer record gives finer bins and a larger coefficient for a coherent tone. Raising it by 10 % (to 4.4) moves the result by +0 %, from 2 to 2 V.
Bin index
The bin index; any integer works since the transform is periodic in k. Selects the frequency kfs/N that is analysed. Raising it by 10 % (to 1.1) moves the result by +0 %, from 2 to 2 V.
Sample 0
The sample at index 0, in V (ignored if 0 ≥ N). Adds to the coefficient through the factor e^(−i2πk0/N). Raising it by 10 % (to 0) moves the result by +0 %, from 2 to 2 V.
Sample 1
The sample at index 1, in V (ignored if 1 ≥ N). Adds to the coefficient through the factor e^(−i2πk1/N). Raising it by 10 % (to 1.1) moves the result by +5 %, from 2 to 2.1 V.
Sample 2
The sample at index 2, in V (ignored if 2 ≥ N). Adds to the coefficient through the factor e^(−i2πk2/N). Raising it by 10 % (to 0) moves the result by +0 %, from 2 to 2 V.
Sample 3
The sample at index 3, in V (ignored if 3 ≥ N). Adds to the coefficient through the factor e^(−i2πk3/N). Raising it by 10 % (to −1.1) moves the result by +5 %, from 2 to 2.1 V.
Sample 4
The sample at index 4, in V (ignored if 4 ≥ N). Adds to the coefficient through the factor e^(−i2πk4/N). Raising it by 10 % (to 0) moves the result by +0 %, from 2 to 2 V.
Sample 5
The sample at index 5, in V (ignored if 5 ≥ N). Adds to the coefficient through the factor e^(−i2πk5/N). Raising it by 10 % (to 0) moves the result by +0 %, from 2 to 2 V.
Sample 6
The sample at index 6, in V (ignored if 6 ≥ N). Adds to the coefficient through the factor e^(−i2πk6/N). Raising it by 10 % (to 0) moves the result by +0 %, from 2 to 2 V.
Sample 7
The sample at index 7, in V (ignored if 7 ≥ N). Adds to the coefficient through the factor e^(−i2πk7/N). Raising it by 10 % (to 0) moves the result by +0 %, from 2 to 2 V.
Worked example with the values above
- Each term is x[n]·e^(−i2π·1·n/4) for n = 0 to 3, with angles of −90° per sample step.
- Sum of real parts: 2.4493×10−16; sum of imaginary parts: −2.
- X[1] = 2.4493×10−16 − 2i, so |X| = 2 V.
Assumptions and limits
- Forward transform with a negative exponent and no scale factor; inverse transform divides by N.
- A record that is treated as one period of a periodic sequence, indexed from zero.
Common mistakes
- Using a scale factor that another tool applies (such as 1/N) and not noting it.
- Reading bin k as a frequency without multiplying by fs/N.
- Forgetting that the record time origin sets the phase.
Statistics and uncertainty
The DFT relations here are exact for the stated conventions, so the only uncertainty is in the data. In floating point, results match direct summation to about 1e−15 relative for short records, and the main risk is a sign or scale-convention mismatch with another tool.
Where it is used
- Checking FFT output by direct summation on a short record.
- Understanding shifts, scaling and power conservation in the frequency domain.
Maths you need
- Complex exponential: e^{iθ} = cos θ + i sin θ
- DFT pair: forward without a scale factor, inverse divides by N
- Periodic extension: the DFT treats a record as repeating forever