In spectral analysis it is important to note that the discrete Fourier transform
(DFT) and its associated inverse (IDFT) can be represented in more than one
form. The method by which other functions of the DFT are computed depends
on an understanding of which DFT type was used. Presented here are two forms
of the DFT and an example of how the power-spectral-density function, by
example, is determined for each form. The first is labeled here as the DFT
proper since it is the derived equivalent of the continuous Fourier transform. The
second form, however, is more commonly implemented in practice (including
data analysis programs such as LabView or MATLAB), and thus is labeled here
as the algorithmic DFT.
DFT Proper:
The continuous Fourier transform for a given function h( t ) is given as
H ( f )=∫−∞
∞
h( t )e−i2 π ftdt
with the following inverse
h( t )=∫−∞
∞
H ( f )e i2 π ft df
A discrete and periodic form of these transformations are
Hm= Δt∑n=0
N−1
hn e−i 2π nm
N
hn=Δf ∑m=0
M−1
Hm ei 2 π
nmN
sincetn=nΔt and f m=mΔf=m /(NΔt ).
If h has the generic units of h and t is in seconds then H has the units of h/Hz.
[It can be argued that the unit 1/cycle can be correctly added to the transform.
Although no formal literature has been found to assert this, the concept can be
strengthened if the radian form is considered, e−iθ
. In this case the transform
and its inverse are not symmetric requiring a scaling factor of 2π to be
appropriated between the transforms. The arbitrary unit of radians can be
assigned, as allowable, and combined with the scaling factor to produce the unit
cycles. Since the transform should be invariant of the choosing of cycles or
radians (the exponential e has no units), the form as presented should also
include the unit cycles to make both versions (radian and cycle) of the transforms
compatible.] Since H is complex the units on the spectral density have little
applicable meaning; however it is important to note for the calculation of the
power spectral density which is real valued. The calculation of the power
spectral density function is given as
G=H ¿HΔf
with the units of h^2/Hz. The function H¿ is the complex conjugate of H .
The Algorithmic DFT:
For most applications the DFT has been defined to be invariant of a scaled time
and frequency. The algorithm then only requires information on the data series hn for calculation. By observing from before that
Δf=1/ (NΔt )
the discrete transform set can be rewritten by dividing the DFT by Δt . This also
requires multiplying the IDFT by Δt to maintain correct scaling.
Hm= ∑n=0
N−1
hn e−i 2 π nm
N
hn=1N
∑m=0
M−1
H mei2 π
nmN
In this form the units of Hm and hn are identical since no information regarding
time or frequency is conveyed. Hm is distinguished from Hm since the results of
these two functions are proportional, but not equal. The calculation of the power
spectral density however still requires frequency information, but because of the
redefinition of the transform it now becomes
G= H ¿ H
N2Δf
in order to maintain the correct units. Below is a MATLAB example illustrating
the calculation of a PSD for a sinusoidal oscillation at 64Hz and of amplitude 1. If
the units for this signal are volts/sqrt(Ohm) [eg. 1 volt acting across a 1 Ohm
resistor] then the expected total power output would be 0.5 watts [an equivalent
DC source with a magnitude of the RMS of the signal, or 1/sqrt(2)
volts/sqrt(Ohm), will produce the same power]. The power output is invariant to
the frequency. The plot of the PSD is multiplied by 2 since we are plotting only
the range below the Nyquist frequency, but still need to account for the power of
the mirroring side.
Fs=1000; % sample rate [samples/second]dt=1/Fs; % sample time [seconds]N=2048; % number of samplesT=N*dt; % sample period [seconds]t=linspace(0,T,N); % time vector [seconds]h=sin(2*pi*64*t); % signal [volts/sqrt(Ohm)] df=1/T; % frequency bin size [Hz]f=linspace(0,1/dt,N); % frequency vector [Hz] H=fft(h); % FFT of h [volts/sqrt(Ohm)/Hz] G=conj(H).*H/N/N/df; % PSD of h [(volts^2/Ohm)/Hz or Watts/Hz] TotalPower = sum(G)*df % Total Power [Watts] plot(f(1:(N/2-1)),2*G(1:(N/2-1))) % [Hz] [Watts/Hz]
Top Related