Library / Signal processing and digital filters / DSP-10
Signal processing and digital filters
DFT bin relocation by complex modulation
Coefficient Y[k] of the spectrum after multiplying the signal by exp(i2πmn/N), which moves every bin up by m whole bins with wrap-around.
- Ref
- DSP-10
- Rev
- v1
- Field
- Signal processing and digital filters
- Result
- Re Y[k] [V]
Multiplying a signal by e^(i2πmn/N) moves every DFT bin up by m: the new spectrum is Y[k] = X[(k − m) mod N], with wrap-around at the ends. The new signal is generally complex. This is the discrete form of mixing a signal to a new centre frequency.
Coefficient Y[k] of the spectrum after multiplying the signal by exp(i2πmn/N), which moves every bin up by m whole bins with wrap-around. Y is generally the transform of a complex signal. The page returns the real part; the imaginary part and magnitude are in the derived rows.
Calculator
- Imaginary part of Y[k]0 V
- Magnitude of Y[k]4 V
- Source bin index, (k − m) mod N3
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.
- After a shift of 1 bin(s), output bin 0 holds what was in bin 3, a real part of 4 V.
- The shift moves the frequency by 1·fs/4, and bins that leave one end of the spectrum wrap round to the other, so keep the band well inside the Nyquist range.
Chart data as tables
Ranked variables
| Variable | Typical range | Lowest result | Highest result | Swing (V) | Local step | Change in result |
|---|---|---|---|---|---|---|
| Re X3 Real part of bin 3 | −100 to 100 V | −100 | 100 | 200 | +4 V | +100 % |
| N Number of bins | 1 to 8 | 0 | 4 | 4 | +1 | −100 % |
| k Output bin index | 0 to 7 | 1 | 4 | 3 | +1 | −75 % |
| m Shift in bins | −7 to 7 | 1 | 4 | 3 | +1 | −25 % |
| Re X0 Real part of bin 0 | −100 to 100 V | 4 | 4 | 0 | +4 V | 0 % |
| Re X1 Real part of bin 1 | −100 to 100 V | 4 | 4 | 0 | +4 V | 0 % |
| Re X2 Real part of bin 2 | −100 to 100 V | 4 | 4 | 0 | +4 V | 0 % |
| Re X4 Real part of bin 4 | −100 to 100 V | 4 | 4 | 0 | +4 V | 0 % |
| Re X5 Real part of bin 5 | −100 to 100 V | 4 | 4 | 0 | +4 V | 0 % |
| Re X6 Real part of bin 6 | −100 to 100 V | 4 | 4 | 0 | +4 V | 0 % |
| Re X7 Real part of bin 7 | −100 to 100 V | 4 | 4 | 0 | +4 V | 0 % |
| Im X0 Imaginary part of bin 0 | −100 to 100 V | 4 | 4 | 0 | +4 V | 0 % |
| Im X1 Imaginary part of bin 1 | −100 to 100 V | 4 | 4 | 0 | +4 V | 0 % |
| Im X2 Imaginary part of bin 2 | −100 to 100 V | 4 | 4 | 0 | +4 V | 0 % |
| Im X3 Imaginary part of bin 3 | −100 to 100 V | 4 | 4 | 0 | +4 V | 0 % |
| Im X4 Imaginary part of bin 4 | −100 to 100 V | 4 | 4 | 0 | +4 V | 0 % |
| Im X5 Imaginary part of bin 5 | −100 to 100 V | 4 | 4 | 0 | +4 V | 0 % |
| Im X6 Imaginary part of bin 6 | −100 to 100 V | 4 | 4 | 0 | +4 V | 0 % |
| Im X7 Imaginary part of bin 7 | −100 to 100 V | 4 | 4 | 0 | +4 V | 0 % |
Sweep of Shift in bins
| Shift in bins | Real part of the shifted bin (V) |
|---|---|
| −7 | 4 |
| −5.25 | 2 |
| −3.5 | 4 |
| −1.75 | 3 |
| 0 | 1 |
| 1.75 | 3 |
| 3.5 | 1 |
| 5.25 | 4 |
| 7 | 2 |
Sweep one variable
Variables and how each one contributes
Real part of the shifted bin
What the equation gives you. Everything else feeds it.
Number of bins
The number of bins, up to 8. Sets the wrap-around of the index. Raising it by 10 % (to 4.4) moves the result by +0 %, from 4 to 4 V.
Output bin index
The output bin to read. Chooses which relocated bin is returned. Raising it by 10 % (to 0) moves the result by +0 %, from 4 to 4 V.
Shift in bins
The shift, in bins (positive moves the spectrum up). Changes which original bin is read: k − m, wrapped. Raising it by 10 % (to 1.1) moves the result by +0 %, from 4 to 4 V.
Real part of bin 0
The real part of bin 0, in V. Is the output when bin 0 is the one read. Raising it by 10 % (to 1.1) moves the result by +0 %, from 4 to 4 V.
Real part of bin 1
The real part of bin 1, in V. Is the output when bin 1 is the one read. Raising it by 10 % (to 2.2) moves the result by +0 %, from 4 to 4 V.
Real part of bin 2
The real part of bin 2, in V. Is the output when bin 2 is the one read. Raising it by 10 % (to 3.3) moves the result by +0 %, from 4 to 4 V.
Real part of bin 3
The real part of bin 3, in V. Is the output when bin 3 is the one read. Raising it by 10 % (to 4.4) moves the result by +10 %, from 4 to 4.4 V.
Real part of bin 4
The real part of bin 4, in V. Is the output when bin 4 is the one read. Raising it by 10 % (to 0) moves the result by +0 %, from 4 to 4 V.
Real part of bin 5
The real part of bin 5, in V. Is the output when bin 5 is the one read. Raising it by 10 % (to 0) moves the result by +0 %, from 4 to 4 V.
Real part of bin 6
The real part of bin 6, in V. Is the output when bin 6 is the one read. Raising it by 10 % (to 0) moves the result by +0 %, from 4 to 4 V.
Real part of bin 7
The real part of bin 7, in V. Is the output when bin 7 is the one read. Raising it by 10 % (to 0) moves the result by +0 %, from 4 to 4 V.
Imaginary part of bin 0
The imaginary part of bin 0, in V. Shows up in the imaginary part when bin 0 is read. Raising it by 10 % (to 0) moves the result by +0 %, from 4 to 4 V.
Imaginary part of bin 1
The imaginary part of bin 1, in V. Shows up in the imaginary part when bin 1 is read. Raising it by 10 % (to 0) moves the result by +0 %, from 4 to 4 V.
Imaginary part of bin 2
The imaginary part of bin 2, in V. Shows up in the imaginary part when bin 2 is read. Raising it by 10 % (to 0) moves the result by +0 %, from 4 to 4 V.
Imaginary part of bin 3
The imaginary part of bin 3, in V. Shows up in the imaginary part when bin 3 is read. Raising it by 10 % (to 0) moves the result by +0 %, from 4 to 4 V.
Imaginary part of bin 4
The imaginary part of bin 4, in V. Shows up in the imaginary part when bin 4 is read. Raising it by 10 % (to 0) moves the result by +0 %, from 4 to 4 V.
Imaginary part of bin 5
The imaginary part of bin 5, in V. Shows up in the imaginary part when bin 5 is read. Raising it by 10 % (to 0) moves the result by +0 %, from 4 to 4 V.
Imaginary part of bin 6
The imaginary part of bin 6, in V. Shows up in the imaginary part when bin 6 is read. Raising it by 10 % (to 0) moves the result by +0 %, from 4 to 4 V.
Imaginary part of bin 7
The imaginary part of bin 7, in V. Shows up in the imaginary part when bin 7 is read. Raising it by 10 % (to 0) moves the result by +0 %, from 4 to 4 V.
Worked example with the values above
- Source index: (k − m) mod N = (0 − 1) mod 4 = 3.
- Read X[3] = 4 + 0i V.
- Y[0] has real part 4 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
- 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