72

My question has to do with the physical meaning of the results of doing a spectral analysis of a signal, or of throwing the signal into an FFT and interpreting what comes out using a suitable numerical package,

Specifically:

  • take a signal, say a time-varying voltage v(t)
  • throw it into an FFT (you get back a sequence of complex numbers)
  • now take the modulus (abs) and square the result, i.e. |fft(v)|^2.

So you now have real numbers on the y axis -- shall I call these spectral coefficients?

  • using the sampling resolution, you follow a cookbook recipe and associate the spectral coefficients to frequencies.
  • AT THIS POINT, you have a frequency spectrum g(w) with frequency on the x axis, but WHAT PHYSICAL UNITS on the y axis?

My understanding is that this frequency spectrum shows how much of the various frequencies are present in the voltage signal -- they are spectral coefficients in the sense that they are the coefficients of the sines and cosines of the various frequencies required to reconstitute the original signal.

So the first question is, what are the UNITS of these spectral coefficients?

The reason this matters is that spectral coefficients can be tiny and enormous, so I want to use a dB scale to represent them.

But to do that, I have to make a choice:

  • Either I use the 20log10 dB conversion, corresponding to a field measurement, like voltage.
  • Or I use the 10log10 dB conversion, corresponding to an energy measurement, like power.

Which scaling I use depends on what the units are.

Any light shed on this would be greatly appreciated!

Assad Ebrahim
  • 6,234
  • 8
  • 42
  • 68
  • 4
    A note that for a Fourier transform (not an fft) in terms of f, the units are [V.s] (if the signal is in volts, and time is in seconds). That's because when we integrate, the result has the units of the y axis multiplied by the units of the x axis (finding the area under a curve). Also, the integral of the square of a signal is the same in time domain and in frequency domain (Parseval's theorem). The units on the left are [V^2.s], and on the right [X^2.(1/s)] (f is in Hz), therefore X = [V.s]. See also http://physics.stackexchange.com/questions/15073/how-does-the-fourier-transform-invert-units – Evgeni Sergeev Oct 11 '12 at 01:22
  • @EvgeniSergeev - thank you, that's a nice explanation of the core Fourier Transform, relating back to the underlying mathematics (+1). – Assad Ebrahim Oct 11 '12 at 07:10
  • I'm voting to close this question as off-topic because it belongs on [Physics](https://physics.stackexchange.com/) – BryanH Nov 05 '15 at 16:57
  • 9
    @BryanH: 6 years later, not sure you're adding a whole of value closing it down. Please remember that the site was rather different in the early days. For one thing, stackoverflow was the only game in town back then. And judging by the response to the question and the answers, the readership of SO still has plenty of engineers. With all due respect, I'd say leave it as it is. – Assad Ebrahim Nov 05 '15 at 21:08

5 Answers5

87

take a signal, a time-varying voltage v(t)

units are V, values are real.

throw it into an FFT -- ok, you get back a sequence of complex numbers

units are still V, values are complex ( not V/Hz - the FFT a DC signal becomes a point at the DC level, not an dirac delta function zooming off to infinity )

now take the modulus (abs)

units are still V, values are real - magnitude of signal components

and square the result, i.e. |fft(v)|^2

units are now V2, values are real - square of magnitudes of signal components

shall I call these spectral coefficients?

It's closer to an power density rather than usual use of spectral coefficient. If your sink is a perfect resistor, it will be power, but if your sink is frequency dependent it's "the square of the magnitude of the FFT of the input voltage".

AT THIS POINT, you have a frequency spectrum g(w): frequency on the x axis, and... WHAT PHYSICAL UNITS on the y axis?

Units are V2

The other reason the units matter is that the spectral coefficients can be tiny and enormous, so I want to use a dB scale to represent them. But to do that, I have to make a choice: do I use the 20log10 dB conversion (corresponding to a field measurement, like voltage)? Or do I use the 10log10 dB conversion (corresponding to an energy measurement, like power)?

You've already squared the voltage values, giving equivalent power into a perfect 1 Ohm resistor, so use 10log10.

log(x2) is 2 log(x), so 20log10 |fft(v)| = 10log10 ( |fft(v)|2), so alternatively if you did not square the values you could use 20log10.

Pete Kirkham
  • 48,893
  • 5
  • 92
  • 171
  • Pete, thanks! I was editing the derivation as you were typing your response. I get Energy/Hz (see derivation below). – Assad Ebrahim Oct 06 '09 at 09:39
  • 5
    Yes. That's why I said "not V/Hz - the FFT a DC signal becomes a point at the DC level, not an dirac delta function zooming off to infinity". The FFT calculates sum of its input sampled at discrete time points multiplied by dimensionless values; the units of the result of the FFT are those of its input; there is no scaling by time or frequency in the process. – Pete Kirkham Oct 06 '09 at 09:58
  • @Pete -- aaah! Isee. Thanks. So, would the term "spectral coefficients" be correctly applied to the complex sequence of numbers from fft(v)? – Assad Ebrahim Oct 06 '09 at 10:15
  • @PeteKirkham Why wouldn't the units be `V*s`, since the fourier transform is `S(w) = integral(s(t) * exp(-j*w*t) * dt)`? The exponential is unitless, the signal `s(t)` is in volts and we have `dt` in seconds. Edit: ah perhaps the FFT algorithm specifically skips the `dt` scale factor. Hm might be worth mentioning in here. – jnez71 Jun 05 '20 at 01:28
7

The y axis is complex (as opposed to real). The magnitude is the amplitude of the original signal in whatever units your original samples were in. The angle is the phase of that frequency component.

Laurence Gonsalves
  • 137,896
  • 35
  • 246
  • 299
  • 1
    Thanks Laurence; let me clarify: (A) I get real values on the y axis. So, since a true Fourier transform gives complex values, one of the following might be going on inside the package: (i) it's taking the Real values of the transform, or (ii) it's take the Magnitude of the transform, or (iii) ? (B) Original samples are in Volts – Assad Ebrahim Oct 06 '09 at 06:08
  • 2
    @AKE, the real part of the complex value doesn't tell you much by itself - it's almost worthless. You probably want magnitude, which is `sqrt(r^2 + i^2)`, or the square of the magnitude which is easier to calculate, leaving out the `sqrt`. – Mark Ransom Jan 13 '11 at 04:46
  • What units are the real and imaginary parts? What units is the phase (meaning the units of the x axis) – Gulzar Oct 04 '19 at 21:00
  • @Gulzar The *magnitude* of the y-axis is in the same units as the original input wave's y-axis. The real and imaginary parts are in the same units as the magnitude, but it usually doesn't make much sense to think about them independently, just like you wouldn't look at only one dimension of a distance vector. The phase is not the x-axis, phase is the angle of y in polar form — 360° = 2π radians = 1 cycle. The x-axis is frequency, and the scale depends upon the number of samples and the sample rate. See this other question for details on the x-axis: https://stackoverflow.com/q/4364823/90848 – Laurence Gonsalves Oct 04 '19 at 21:25
4

Here's what I've been able to come up with so far:

The y-axis seems likely to be in units of [Energy / Hz] !?

Here's how I'm deriving this (feedback welcomed!):

  1. the signal v(t) is in volts

  2. so after taking the Fourier integral: integral e^iwt v(t) dt , we should have units of [volts*seconds], or [volts/Hz] (e^iwt is unitless)

  3. taking the magnitude squared should then give units of [volts^2 * s^2], or [v^2 * s/Hz]

  4. we know Power is proportional to volts ^2, so this gets us to [power * s / Hz]

  5. but Power is the time-rate of change in energy, i.e. power = energy/s, so we can also write Energy = power * s

  6. this leaves us with the candidate conclusion [Energy/Hz]. (Joules/Hz ?!)

... which suggests the meaning "Energy content per Hz", and suggests as a use integrating frequency bands and seeing the energy content... which would be very nice if it were true...

Continuing... assuming the above is correct, then we are dealing with an Energy measurement, so this would suggest using 10log10 conversion to get into dB scale, instead of 20log10...

...

Assad Ebrahim
  • 6,234
  • 8
  • 42
  • 68
  • Everything looks good except it's not Energy/power, per se. Unless you have a specific resistance in mind, you shouldn't lie and just say it's Volts^2. – Victor Liu Oct 06 '09 at 09:45
  • I have an ideal 50 ohm resistance in mind (the transmitting device impedance matched with the projector). P ~ V^2 / R with R taken as the 50 ohm constant load. – Assad Ebrahim Oct 06 '09 at 09:52
  • 1
    @AssadEbrahim This was an old response so not sure if you're still around but this looks good! Further I believe Energy is $\Sum_{k=0}^{N-1}x[n]^2$ while power is $\frac{1}{N}\Sum_{k=0}^{N-1}x[n]^2$. So if we normalize the FFT by the length (which is the time duration in samples), we do end up with a power spectral density. Does this make sense to you? – Dan Boschen Apr 21 '17 at 10:20
  • I'm not completely sure about your particular application, but when you did the Fourier integral in point #2, shouldn't you include the normalization constant in front, which would be in units of seconds^-1? – Louis Jun 14 '17 at 18:50
3

The power into a resistor is v^2/R watts. The power of a signal x(t) is an abstraction of the power into a 1 Ohm resistor. Therefore, the power of a signal x(t) is x^2 (also called instantaneous power), regardless of the physical units of x(t).

For example, if x(t) is temperature, and the units of x(t) are degrees C, then the units for the power x^2 of x(t) are C^2, certainly not watts.

If you take the Fourier transform of x(t) to get X(jw), then the units of X(jw) are C*sec or C/Hz (according to the Fourier transform integral). If you use (abs(X(jw)))^2, then the units are C^2*sec^2=C^2*sec/Hz. Since power units are C^2, and energy units are C^2*sec, then abs(X(jw)))^2 gives the energy spectral density, say E/Hz. This is consistent with Parseval's theorem, where the energy of x(t) is given by (1/2*pi) times the integral of abs(X(jw)))^2 with respect to w, i.e., (1/2*pi)*int(abs(X(jw)))^2*dw) > (1/2*pi)*(C^2*sec^2)*2*pi*Hz > (1/2*pi)*(C^2*sec/Hz)*2*pi*Hz > E.

Conversion to a dB (log scale) scale does not change the units.

If you take the FFT of samples of x(t), written as x(n), to get X(k), then the result X(k) is an estimate of the Fourier series coefficients of a periodic function, where one period over T0 seconds is the segment of x(t) that was sampled. If the units of x(t) are degrees C, then the units of X(k) are also degrees C. The units of abs(X(k))^2 are C^2, which are the units of power. Thus, a plot of abs(X(k))^2 versus frequency shows the power spectrum (not power spectral density) of x(n), which is an estimate the power of a set of frequency components of x(t) at the frequencies k/T0 Hz.

helencrump
  • 1,351
  • 1
  • 18
  • 27
2

Well, late answer I know. But I just had cause to do something like this, in a different context. My raw data was latency values for transactions against a storage unit - I resampled it to a 1ms time interval. So original data y was "latency, in microseconds." I had 2^18 = 262144 original data points, on 1ms time steps.

After I did the FFT, I got a 0th component (DC) such that the following held:

FFT[0] = 262144*(average of all input data).

So it looks to me like FFT[0] is N*(average of input data). That sort of makes sense - every single data point possesses that DC average as part of what it is, so you add 'em all up.

If you look at the definition of the FFT that makes sense too. All of the other components would involve sine and cosine terms too, but really the FFT is just a summation. The average is just the only one that happens to be present in all points equally, because you have cos(0) = 1.

Kip Ingram
  • 21
  • 1
  • So, to complete that thought, the UNITS have to be the same, because the FFT components are just a summation of the input components multiplied by dimensionless sine and cosine terms. – Kip Ingram Mar 11 '17 at 04:19