Your Equation

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

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

Real part of the shifted bin (V) current value 4 V
Re X3Real part of bin 3Key driver
−100100
NNumber of bins
0
kOutput bin index
1
mShift in bins
1
Re X0Real part of bin 0
Re X1Real part of bin 1
Re X2Real part of bin 2
Re X4Real part of bin 4
Re X5Real part of bin 5
Re X6Real part of bin 6
Re X7Real part of bin 7
Im X0Imaginary part of bin 0
Im X1Imaginary part of bin 1
Im X2Imaginary part of bin 2
Im X3Imaginary part of bin 3
Im X4Imaginary part of bin 4
Im X5Imaginary part of bin 5
Im X6Imaginary part of bin 6
Im X7Imaginary part of bin 7
  • 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

VariableTypical rangeLowest resultHighest resultSwing (V)Local stepChange in result
Re X3 Real part of bin 3−100 to 100 V−100100200+4 V+100 %
N Number of bins1 to 8 044+1 −100 %
k Output bin index0 to 7 143+1 −75 %
m Shift in bins−7 to 7 143+1 −25 %
Re X0 Real part of bin 0−100 to 100 V440+4 V0 %
Re X1 Real part of bin 1−100 to 100 V440+4 V0 %
Re X2 Real part of bin 2−100 to 100 V440+4 V0 %
Re X4 Real part of bin 4−100 to 100 V440+4 V0 %
Re X5 Real part of bin 5−100 to 100 V440+4 V0 %
Re X6 Real part of bin 6−100 to 100 V440+4 V0 %
Re X7 Real part of bin 7−100 to 100 V440+4 V0 %
Im X0 Imaginary part of bin 0−100 to 100 V440+4 V0 %
Im X1 Imaginary part of bin 1−100 to 100 V440+4 V0 %
Im X2 Imaginary part of bin 2−100 to 100 V440+4 V0 %
Im X3 Imaginary part of bin 3−100 to 100 V440+4 V0 %
Im X4 Imaginary part of bin 4−100 to 100 V440+4 V0 %
Im X5 Imaginary part of bin 5−100 to 100 V440+4 V0 %
Im X6 Imaginary part of bin 6−100 to 100 V440+4 V0 %
Im X7 Imaginary part of bin 7−100 to 100 V440+4 V0 %

Sweep of Shift in bins

Shift in binsReal part of the shifted bin (V)
−74
−5.252
−3.54
−1.753
01
1.753
3.51
5.254
72

Sweep one variable

Real part of the shifted bin (V)Hover, touch, or use the arrow keys on the chart
11.522.533.54 −6−4−20246 Shift in bins now 4

Variables and how each one contributes

Re Y[k]

Real part of the shifted bin

Result · V

What the equation gives you. Everything else feeds it.

N

Number of bins

· typical 1 to 8

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.

k

Output bin index

· typical 0 to 7

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.

m

Shift in bins

· typical −7 to 7

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.

Re X0

Real part of bin 0

V · typical −100 to 100

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.

Re X1

Real part of bin 1

V · typical −100 to 100

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.

Re X2

Real part of bin 2

V · typical −100 to 100

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.

Re X3

Real part of bin 3

V · typical −100 to 100

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.

Re X4

Real part of bin 4

V · typical −100 to 100

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.

Re X5

Real part of bin 5

V · typical −100 to 100

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.

Re X6

Real part of bin 6

V · typical −100 to 100

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.

Re X7

Real part of bin 7

V · typical −100 to 100

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.

Im X0

Imaginary part of bin 0

V · typical −100 to 100

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.

Im X1

Imaginary part of bin 1

V · typical −100 to 100

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.

Im X2

Imaginary part of bin 2

V · typical −100 to 100

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.

Im X3

Imaginary part of bin 3

V · typical −100 to 100

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.

Im X4

Imaginary part of bin 4

V · typical −100 to 100

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.

Im X5

Imaginary part of bin 5

V · typical −100 to 100

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.

Im X6

Imaginary part of bin 6

V · typical −100 to 100

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.

Im X7

Imaginary part of bin 7

V · typical −100 to 100

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

  1. Source index: (k − m) mod N = (0 − 1) mod 4 = 3.
  2. Read X[3] = 4 + 0i V.
  3. 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

Related formulas

Practise this formula