Your Equation

Library / Signal processing and digital filters / DSP-19

Signal processing and digital filters

Power-weighted spectral centroid

Mean frequency of a spectrum weighted by power, from up to five bin frequencies and their non-negative powers (set unused powers to zero).

Ref
DSP-19
Rev
v1
Field
Signal processing and digital filters
Result
fc [Hz]

The spectral centroid is the power-weighted mean frequency, fc = Σ fk Pk / Σ Pk, the centre of gravity of the spectrum. Use non-negative bin powers; for a PSD with unequal bin widths, multiply by the widths first. It moves up when high-frequency power grows, so it tracks the apparent brightness of a signal.

Mean frequency of a spectrum weighted by power, from up to five bin frequencies and their non-negative powers (set unused powers to zero). For a PSD on unequal bins, multiply by the bin widths first. It needs a positive total power and one consistent band.

Calculator

Solve for
Hz
Hz
0100,000
Hz
0100,000
Hz
0100,000
Hz
0100,000
Hz
0100,000
V²
01,000
V²
01,000
V²
01,000
V²
01,000
V²
01,000
  • Total power, ΣP4 V²
  • RMS spread about the centroid109 Hz
  • Frequency of the strongest bin200 Hz

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.

Spectral centroid (Hz) current value 225 Hz
f2Frequency of bin 2Key driver
12550,100
f1Frequency of bin 1
20025,200
f3Frequency of bin 3
12525,100
P3Power of bin 3
167399
P4Power of bin 4
399
P5Power of bin 5
399
P1Power of bin 1
100267
P2Power of bin 2
200250
f4Frequency of bin 4
f5Frequency of bin 5
  • The centroid is at 225 Hz, pulled above the strongest bin by any power above it.
  • A centroid is a single-number summary and hides the shape: two quite different spectra can share the same centroid, so always check the spread too.
Chart data as tables

Ranked variables

VariableTypical rangeLowest resultHighest resultSwing (Hz)Local stepChange in result
f2 Frequency of bin 20 to 100,000 Hz12550,13050,000+10%+4.44 %
f1 Frequency of bin 10 to 100,000 Hz20025,20025,000+10%+1.11 %
f3 Frequency of bin 30 to 100,000 Hz12525,13025,000+10%+4.44 %
P3 Power of bin 30 to 1,000 V²166.7399.3232.6+10%+1.9 %
P4 Power of bin 40 to 1,000 V²225399.3174.3+10%0 %
P5 Power of bin 50 to 1,000 V²225399.3174.3+10%0 %
P1 Power of bin 10 to 1,000 V²100.5266.7166.2+10%−1.36 %
P2 Power of bin 20 to 1,000 V²200.125049.9+10%−0.529 %
f4 Frequency of bin 40 to 100,000 Hz2252250+10%0 %
f5 Frequency of bin 50 to 100,000 Hz2252250+10%0 %

Sweep of Power of bin 3

Power of bin 3 (V²)Spectral centroid (Hz)
0166.7
125394.5
250397.2
375398.1
500398.6
625398.9
750399.1
875399.2
1,000399.3

Sweep one variable

Spectral centroid (Hz)Hover, touch, or use the arrow keys on the chart
150200250300350400 02004006008001000 Power of bin 3 (V²) now 225

Variables and how each one contributes

fc

Spectral centroid

Result · Hz

What the equation gives you. Everything else feeds it.

f1

Frequency of bin 1

Hz · typical 0 to 100,000

The frequency of bin 1, in Hz. Moves the centroid towards this bin in proportion to its power. Raising it by 10 % (to 110) moves the result by +1.11 %, from 225 to 227.5 Hz.

f2

Frequency of bin 2

Hz · typical 0 to 100,000

The frequency of bin 2, in Hz. Moves the centroid towards this bin in proportion to its power. Raising it by 10 % (to 220) moves the result by +4.44 %, from 225 to 235 Hz.

f3

Frequency of bin 3

Hz · typical 0 to 100,000

The frequency of bin 3, in Hz. Moves the centroid towards this bin in proportion to its power. Raising it by 10 % (to 440) moves the result by +4.44 %, from 225 to 235 Hz.

f4

Frequency of bin 4

Hz · typical 0 to 100,000

The frequency of bin 4, in Hz. Moves the centroid towards this bin in proportion to its power. Raising it by 10 % (to 440) moves the result by +0 %, from 225 to 225 Hz.

f5

Frequency of bin 5

Hz · typical 0 to 100,000

The frequency of bin 5, in Hz. Moves the centroid towards this bin in proportion to its power. Raising it by 10 % (to 440) moves the result by +0 %, from 225 to 225 Hz.

P1

Power of bin 1

V² · typical 0 to 1,000

The power of bin 1. A larger power pulls the centroid towards this bin’s frequency. Raising it by 10 % (to 1.1) moves the result by −1.36 %, from 225 to 222 Hz.

P2

Power of bin 2

V² · typical 0 to 1,000

The power of bin 2. A larger power pulls the centroid towards this bin’s frequency. Raising it by 10 % (to 2.2) moves the result by −0.529 %, from 225 to 223.8 Hz.

P3

Power of bin 3

V² · typical 0 to 1,000

The power of bin 3. A larger power pulls the centroid towards this bin’s frequency. Raising it by 10 % (to 1.1) moves the result by +1.9 %, from 225 to 229.3 Hz.

P4

Power of bin 4

V² · typical 0 to 1,000

The power of bin 4. A larger power pulls the centroid towards this bin’s frequency. Raising it by 10 % (to 0) moves the result by +0 %, from 225 to 225 Hz.

P5

Power of bin 5

V² · typical 0 to 1,000

The power of bin 5. A larger power pulls the centroid towards this bin’s frequency. Raising it by 10 % (to 0) moves the result by +0 %, from 225 to 225 Hz.

Worked example with the values above

  1. Weighted sum: Σ f P = 900.
  2. Total power: Σ P = 4.
  3. fc = 900 / 4 = 225 Hz.

Assumptions and limits

  • A stationary signal with a tone of constant amplitude and frequency, and a record that holds a whole number of cycles for the coherent formulas.
  • A single, well-isolated spectral peak for interpolation, and a bandwidth that is stated.

Common mistakes

  • Using these coherent formulas on a record with a non-integer number of cycles.
  • Adding noise or a DC offset into the harmonic sum.
  • Using a peak that is not the largest of its three neighbouring bins in the parabolic interpolation.

Statistics and uncertainty

Tone amplitude and phase from a single FFT line are accurate to a fraction of a per cent only for a coherent record; for a non-coherent tone, scalloping loss of up to 3.9 dB (rectangular window) or 1.4 dB (Hann) adds error unless it is corrected.

Where it is used

  • Measuring amplitude, phase and distortion of tones in an FFT record.
  • Refining a frequency estimate without a longer record.

Maths you need

  • Coherent sampling: a whole number of signal cycles in the record
  • Spectral peak: a local maximum in the spectrum
  • Parseval’s theorem: power in the time domain equals power in the frequency domain

Related formulas

Practise this formula