Your Equation

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

Solve for
V
samples
18
07
V
−1010
V
−1010
V
−1010
V
−1010
V
−1010
V
−1010
V
−1010
V
−1010
  • 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.

Magnitude of the coefficient (V) current value 2 V
x1Sample 1Key driver
0.33311
x3Sample 3
0.33311
x0Sample 0
10.2
x2Sample 2
10.2
NRecord length
0
kBin index
0
x4Sample 4
x5Sample 5
x6Sample 6
x7Sample 7
  • 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

VariableTypical rangeLowest resultHighest resultSwing (V)Local stepChange in result
x1 Sample 1−10 to 10 V0.33331110.67+0.4 V+20 %
x3 Sample 3−10 to 10 V0.33331110.67+0.4 V−20 %
x0 Sample 0−10 to 10 V210.28.198+0.4 V+1.98 %
x2 Sample 2−10 to 10 V210.28.198+0.4 V+1.98 %
N Record length1 to 8 samples022+1 samples−4.89 %
k Bin index0 to 7 022+1 −100 %
x4 Sample 4−10 to 10 V220+0.4 V0 %
x5 Sample 5−10 to 10 V220+0.4 V0 %
x6 Sample 6−10 to 10 V220+0.4 V0 %
x7 Sample 7−10 to 10 V220+0.4 V0 %

Sweep of Sample 1

Sample 1 (V)Magnitude of the coefficient (V)
−109
−7.56.5
−54
−2.51.5
01
2.53.5
56
7.58.5
1011

Sweep one variable

Magnitude of the coefficient (V)Hover, touch, or use the arrow keys on the chart
0246810 −10−50510 Sample 1 (V) now 2

Variables and how each one contributes

|X[k]|

Magnitude of the coefficient

Result · V

What the equation gives you. Everything else feeds it.

N

Record length

samples · typical 1 to 8

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.

k

Bin index

· typical 0 to 7

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.

x0

Sample 0

V · typical −10 to 10

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.

x1

Sample 1

V · typical −10 to 10

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.

x2

Sample 2

V · typical −10 to 10

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.

x3

Sample 3

V · typical −10 to 10

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.

x4

Sample 4

V · typical −10 to 10

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.

x5

Sample 5

V · typical −10 to 10

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.

x6

Sample 6

V · typical −10 to 10

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.

x7

Sample 7

V · typical −10 to 10

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

  1. Each term is x[n]·e^(−i2π·1·n/4) for n = 0 to 3, with angles of −90° per sample step.
  2. Sum of real parts: 2.4493×10−16; sum of imaginary parts: −2.
  3. 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

Related formulas

Practise this formula