Library / Signal processing and digital filters / DSP-07
Signal processing and digital filters
One sample from a full complex spectrum
Sample n of the inverse DFT, built from all N bins (up to 8 here) in normal DFT order, each as real and imaginary parts.
- Ref
- DSP-07
- Rev
- v1
- Field
- Signal processing and digital filters
- Result
- Re x[n] [V]
The inverse DFT rebuilds sample n as the average of the bins, each rotated by e^(i2πkn/N): x[n] = (1/N) Σ X[k]e^(i2πkn/N). It needs all N bins in normal order. A real record has conjugate-symmetric bins, so the imaginary part of the result is zero. The page returns the real part.
Sample n of the inverse DFT, built from all N bins (up to 8 here) in normal DFT order, each as real and imaginary parts. The inverse divides by N and pairs with the forward convention of the previous entry. A real record needs conjugate-symmetric bins. The page returns the real part.
Calculator
- Imaginary part of x[n]2.449×10−16 V
- Magnitude of x[n]1 V
- Mean of the record, X[0]/N0 V
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.
- Sample 2 of the rebuilt record is −1 V, with an imaginary part of 2.449×10−16 V.
- The imaginary part is zero, so these bins are conjugate-symmetric and describe a real signal.
Chart data as tables
Ranked variables
| Variable | Typical range | Lowest result | Highest result | Swing (V) | Local step | Change in result |
|---|---|---|---|---|---|---|
| Re X0 Real part of bin 0 | −100 to 100 V | −26 | 24 | 50 | +4 V | −100 % |
| Re X1 Real part of bin 1 | −100 to 100 V | −25.5 | 24.5 | 50 | +4 V | +100 % |
| Re X2 Real part of bin 2 | −100 to 100 V | −26 | 24 | 50 | +4 V | −100 % |
| Re X3 Real part of bin 3 | −100 to 100 V | −25.5 | 24.5 | 50 | +4 V | +100 % |
| N Number of bins | 1 to 8 | −1 | 1 | 2 | +1 | −80 % |
| n Sample index | 0 to 7 | −1 | 1 | 2 | +1 | −100 % |
| Im X3 Imaginary part of bin 3 | −100 to 100 V | −1 | −1 | 1.843e-14 | +4 V | +4.44e-14 % |
| Im X2 Imaginary part of bin 2 | −100 to 100 V | −1 | −1 | 1.232e-14 | +4 V | −2.22e-14 % |
| Im X1 Imaginary part of bin 1 | −100 to 100 V | −1 | −1 | 6.217e-15 | +4 V | 0 % |
| Re X4 Real part of bin 4 | −100 to 100 V | −1 | −1 | 0 | +4 V | 0 % |
| Re X5 Real part of bin 5 | −100 to 100 V | −1 | −1 | 0 | +4 V | 0 % |
| Re X6 Real part of bin 6 | −100 to 100 V | −1 | −1 | 0 | +4 V | 0 % |
| Re X7 Real part of bin 7 | −100 to 100 V | −1 | −1 | 0 | +4 V | 0 % |
| Im X0 Imaginary part of bin 0 | −100 to 100 V | −1 | −1 | 0 | +4 V | 0 % |
| Im X4 Imaginary part of bin 4 | −100 to 100 V | −1 | −1 | 0 | +4 V | 0 % |
| Im X5 Imaginary part of bin 5 | −100 to 100 V | −1 | −1 | 0 | +4 V | 0 % |
| Im X6 Imaginary part of bin 6 | −100 to 100 V | −1 | −1 | 0 | +4 V | 0 % |
| Im X7 Imaginary part of bin 7 | −100 to 100 V | −1 | −1 | 0 | +4 V | 0 % |
Sweep of Sample index
| Sample index | Real part of the sample (V) |
|---|---|
| 0 | 1 |
| 0.875 | −6.123e-17 |
| 1.75 | −1 |
| 2.625 | 1.837e-16 |
| 3.5 | 1 |
| 4.375 | 1 |
| 5.25 | −1.194e-15 |
| 6.125 | −1 |
| 7 | −4.596e-16 |
Sweep one variable
Variables and how each one contributes
Real part of the sample
What the equation gives you. Everything else feeds it.
Number of bins
The number of bins used, up to 8. Sets the divisor and the angle step 2π/N of the rotation. Raising it by 10 % (to 4.4) moves the result by +0 %, from −1 to −1 V.
Sample index
The sample index to rebuild. Selects which time sample is computed; the result repeats every N samples. Raising it by 10 % (to 2.2) moves the result by +0 %, from −1 to −1 V.
Real part of bin 0
The real part of bin 0, in V. Adds to the sample through cos(2π0n/N). Raising it by 10 % (to 0) moves the result by +0 %, from −1 to −1 V.
Real part of bin 1
The real part of bin 1, in V. Adds to the sample through cos(2π1n/N). Raising it by 10 % (to 2.2) moves the result by +5 %, from −1 to −1.05 V.
Real part of bin 2
The real part of bin 2, in V. Adds to the sample through cos(2π2n/N). Raising it by 10 % (to 0) moves the result by +0 %, from −1 to −1 V.
Real part of bin 3
The real part of bin 3, in V. Adds to the sample through cos(2π3n/N). Raising it by 10 % (to 2.2) moves the result by +5 %, from −1 to −1.05 V.
Real part of bin 4
The real part of bin 4, in V. Adds to the sample through cos(2π4n/N). Raising it by 10 % (to 0) moves the result by +0 %, from −1 to −1 V.
Real part of bin 5
The real part of bin 5, in V. Adds to the sample through cos(2π5n/N). Raising it by 10 % (to 0) moves the result by +0 %, from −1 to −1 V.
Real part of bin 6
The real part of bin 6, in V. Adds to the sample through cos(2π6n/N). Raising it by 10 % (to 0) moves the result by +0 %, from −1 to −1 V.
Real part of bin 7
The real part of bin 7, in V. Adds to the sample through cos(2π7n/N). Raising it by 10 % (to 0) moves the result by +0 %, from −1 to −1 V.
Imaginary part of bin 0
The imaginary part of bin 0, in V. Adds to the sample through −sin(2π0n/N). Raising it by 10 % (to 0) moves the result by +0 %, from −1 to −1 V.
Imaginary part of bin 1
The imaginary part of bin 1, in V. Adds to the sample through −sin(2π1n/N). Raising it by 10 % (to 0) moves the result by +0 %, from −1 to −1 V.
Imaginary part of bin 2
The imaginary part of bin 2, in V. Adds to the sample through −sin(2π2n/N). Raising it by 10 % (to 0) moves the result by +0 %, from −1 to −1 V.
Imaginary part of bin 3
The imaginary part of bin 3, in V. Adds to the sample through −sin(2π3n/N). Raising it by 10 % (to 0) moves the result by +0 %, from −1 to −1 V.
Imaginary part of bin 4
The imaginary part of bin 4, in V. Adds to the sample through −sin(2π4n/N). Raising it by 10 % (to 0) moves the result by +0 %, from −1 to −1 V.
Imaginary part of bin 5
The imaginary part of bin 5, in V. Adds to the sample through −sin(2π5n/N). Raising it by 10 % (to 0) moves the result by +0 %, from −1 to −1 V.
Imaginary part of bin 6
The imaginary part of bin 6, in V. Adds to the sample through −sin(2π6n/N). Raising it by 10 % (to 0) moves the result by +0 %, from −1 to −1 V.
Imaginary part of bin 7
The imaginary part of bin 7, in V. Adds to the sample through −sin(2π7n/N). Raising it by 10 % (to 0) moves the result by +0 %, from −1 to −1 V.
Worked example with the values above
- Rotation per bin: angle 2πkn/N = 2π × k × 2 / 4 for k = 0 to 3.
- Sum of the rotated bins divided by N = 4: real −1, imaginary 2.4493×10−16.
- x[2] = −1 V (real part).
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
- Mixing the forward and inverse sign conventions or the 1/N factor.
- Forgetting that DFT bins above N/2 stand for negative frequencies.
- Reading phase without noting the time origin of the record.
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