FTNotesbghh HJ
FTNotesbghh HJ
Robert DeSerio
The Acquire and Analyze Transient vi is a LabVIEW program that takes and analyzes
decaying oscillations. In this addendum, the mathematics associated with the creation
and fitting of the signal’s Fourier transform is presented. The initial sections deal with
determining a model for the fitting function. The final section gives a description of the
chi-square that is minimized in the fit.
1 f˜(ω)
x̃(ω) = (8)
m −ω 2 + jγω + ω02
Consequently, if f˜(ω) is known, x(t) can be found by taking the inverse Fourier transform
of both sides
1 Z∞ 1 f˜(ω)
x(t) = ejωt dω (9)
2π −∞ m −ω 2 + jγω + ω02
Example 1: The force is a delta function (impulse). A force of this form is given by
f (t) = ∆p δ(t), where δ(t) is the Dirac delta function and ∆p characterizes its net impulse.
Z ∞
Impulse = f (t)dt
−∞
Z ∞
= ∆p δ(t)dt
−∞
= ∆p
With Fourier analysis, the force is specified over all times and the solution is specified over
all times. A delta function at t = 0, with no force before t = 0 implies a solution starting
at rest at equilibrium
x0 = 0 (10)
before the impulse and, while holding that position after the impulse, the mass gains a
non-zero initial velocity
v0 = ∆p/m (11)
after the impulse. Let’s see how this turns out.
The Fourier transform of the impulsive force is
Z ∞
f˜(ω) = ∆p δ(t)e−jωt dt
−∞
= ∆p
implying that an impulse is equal amounts of complex oscillations at all real frequencies.
Using this force in Eq. 9 gives
1 ∆p
x̃(ω) =
m −ω + jγω + ω02
2
v0
= (12)
−ω + jγω + ω02
2
We will see next that the right side is also an expression for the frequency response—giving
the amplitude and phase of the steady state oscillations as a function of the frequency of a
sinusoidal driving force of fixed amplitude. Consequently, Eq. 12 is the well known result
that the Fourier transform of the impulse response is the frequency response.
Taking the inverse Fourier transform of Eq. 12 gives
1 Z∞ v0
x(t) = ejωt dω (13)
2π −∞ −ω + jγω + ω02
2
We have already solved the equation of motion for an impulsive force—as the solution to
the homogeneous differential equation, satisfying general initial conditions. We will check
back on this issue shortly.
Example 2: The force is a uniform oscillating force of magnitude f0 , frequency ωf and
phase constant φf
f (t) = f0 cos(ωf t + φf )
(14)
In treating this problem with Fourier transforms we will need the Fourier transform pair
that can be expressed:
1 Z ∞ −j(ω−ω0 )t
δ(ω − ω 0 ) = e dt (15)
2π −∞
The Fourier transform of f (t) becomes
Z ∞
f˜(ω) = f0 cos(ωf t + φf )e−jωt dt
−∞
f0 Z ∞ j(ωf t+φf )
= e + e−j(ωf t+φf ) e−jωt dt
2 −∞
f0 Z ∞ jφf −j(ω−ωf )t
= e e + e−jφf e−j(ω+ωf )t dt
2 −∞
f0 jφf
= 2π e δ(ω − ωf ) + e−jφf δ(ω + ωf )
2
Thus
ejφf δ(ω − ωf ) + e−jφf δ(ω + ωf )
x̃(ω) = πf0
−ω 2 + jγω + ω02
and
1 Z∞ ejφf δ(ω − ωf ) + e−jφf δ(ω + ωf ) jωt
x(t) = πf0 e dω
2π −∞ −ω 2 + jγω + ω02
ej(ωf t+φf ) e−j(ωf t+φf )
!
f0
= +
2 −ωf2 + jγωf + ω02 −ωf2 − jγωf + ω02
This is just the real part of the first term. Calling the drive frequency ω rather than ωf we
have the result
f0 ej(ωt+φf )
( )
1
x(t) = <
m −ω 2 + jγω + ω02
Then
Z ∞
z̃ ∗ (−ω) = z ∗ (t)e−jωt dt
−∞
Z ∞
= [x(t) − jy(t)] e−jωt dt
−∞
= x̃(ω) − j ỹ(ω) (20)
and the transforms for both the real and imaginary components of z(t) can be recovered
from z̃(ω) according to
1
x̃(ω) = [z̃(ω) + z̃ ∗ (−ω)] (21)
2
and
1
ỹ(ω) = [z̃(ω) − z̃ ∗ (−ω)] (22)
2j
In general, both x̃(ω) and ỹ(ω) are complex, with non-zero real and imaginary parts.
However, because x(t) and y(t) are purely real functions, their Fourier transforms will have
certain symmetry properties. These symmetries can be derived from
1 ∗
x̃∗ (−ω) = [z̃ (−ω) + z̃(ω)]
2
1
= [z̃(ω) + z̃ ∗ (−ω)]
2
= x̃(ω) (23)
and
1 ∗
ỹ ∗ (−ω) = − [z̃ (−ω) − z̃(ω)]
2j
1
= [z̃(ω) − z̃ ∗ (−ω)]
2j
= ỹ(ω) (24)
The complex conjugates of Eqs. 23 and 24 are x̃(−ω) = x̃∗ (ω) and ỹ(−ω) = ỹ ∗ (ω) and
demonstrate that the Fourier transforms of real functions will have real parts that are
symmetric about ω = 0 and imaginary parts that are antisymmetric.
Decaying oscillations
Decaying oscillations (from t = 0 → ∞) can be expressed as the real function
u(t) = 1 t ≥ 0 (26)
= 0 t<0
and A and φ depend on initial conditions.
It is easy to demonstrate that x(t) is the real part of the complex function
0
z(t) = Aejφ e−γt/2 ejω0 t u(t)
0
= Ae−γt/2 ej(ω0 t+φ) u(t)
= Ae−γt/2 cos(ω00 t + φ)u(t) + j Ae−γt/2 sin(ω00 t + φ)u(t)
giving x(0) = x0 = 0 and v(0) = v0 = Aω00 as required. With φ = −π/2, Eq. 27 gives
−jA
z̃(ω) = γ (29)
2
+ j (ω − ω00 )
and
jA
z̃ ∗ (−ω) = γ (30)
2
+ j (ω + ω00 )
Then from Eq. 21
!
A −j j
x̃(ω) = γ + γ
2 2
+ j (ω − ω00 ) 2
+ j (ω + ω00 )
γ γ
A −j 2
+ j (ω + ω00 ) + j 2
+ j (ω − ω00 )
=
γ
γ
2 + j (ω − ω00 ) + j (ω + ω00 )
2 2
Aω00
= γ2
− (ω − ω00 ) (ω +
4
ω00 ) + jγ
2
((ω + ω00 ) + (ω − ω00 ))
v0
= γ2
4
− ω + ω002 + jωγ
2
v0
=
−ω + ω02 + jωγ
2
where the final substitution arises because the decaying oscillation frequency ω00 satisfies
ω002 = ω02 − γ 2 /4.
Thus demonstrating the validity of Eq. 12 for the harmonic oscillator.
so that it is a product of the original function z(t) and the symmetric “rectangle function”
which is non-zero and equal to unity only in the interval −τ ≤ t ≤ τ . It has the Fourier
transform
Z ∞
r̃τ (ω) = rτ (t)e−jωt dt
−∞
Z τ
= e−jωt dt
−τ
Z τ
= [cos ωt + j sin ωt] dt
−τ
1 τ
= [sin ωt − j cos ωt]
ω t=−τ
sin ωτ
= 2 (34)
ω
The definite integral for r̃τ (ω) can be shown to give1
Z ∞
r̃τ (ω)dω = 2π (35)
−∞
where g̃(ω) and h̃(ω) are the individual Fourier transforms of g(t) and h(t)
Z ∞
g̃(ω) = g(t)e−jωt dt
−∞
Z ∞
h̃(ω) = h(t)e−jωt dt
−∞
ti = i∆t (41)
xi = x(ti ) (42)
zi = xi + jyi (44)
= z(ti ) (45)
Algorithms to implement DFTs such as Eq. 46 then return values of z̃k for −N/2 ≤ k ≤
N/2−1, i.e., N complex values. Note that the discrete Fourier transforms of real functions,
such as xi or yi , have only N independent quantities; their real parts being constrained to
be symmetric and their imaginary parts constrained to be antisymmetric as demonstrated
by Eqs. 23 and 24.
To see how the DFT and continuous Fourier transforms are related, use the “rectangle
rule” for numerical integration of Eq. 17 (taking z(t) = 0 for t < 0 and for t > N ∆t, i.e.,
outside the sampling interval) as
Z ∞
z̃(ω) = z(t)e−jωt dt
−∞
N −1
z(ti )e−jωti ∆t
X
=
i=0
N −1
zi e−jωti ∆t
X
= (47)
i=0
ωk = k∆ω (49)
With z̃(ω) determined on a grid of spacing ∆ω, the appropriate representation of r̃τ (ω),
would be on that same grid spacing. The rectangle rule for integration then gives Eq. 39
as
M
1 X
z̃τ (ωi ) = z̃(ωi−k )r̃τ (ωk )∆ω (52)
2π k=−M
where M is not infinite as the theory requires, but is chosen large enough to give a satis-
factory representation of r̃τ (ω). Note that the size of M will limit the values of i for which
all terms in the convolution exist. Values for z̃τ (ωi ) within M points of the ends will not
be calculable. Normally, fits are over regions well away from the end points and even large
values of M can be accommodated, although larger M values slow execution speed.
2
The frequency spacing ∆f = ∆ω/2π changes the spacing units from rad/sec to hertz. Dividing Eq. 48
by 2π and using Eq. 40 shows that this spacing is ∆f = f0 /N .
Let the discrete version of r̃τ (ωk ) include all normalization factors so that
∆ω
r̃τ k = r̃τ (ωk ) (53)
2π
Then Eq. 52 becomes
M
X
z̃τ (ωi ) = z̃i−k r̃τ k (54)
k=−M
where Nk is the number of points chosen on the x̃(ωk ) plots as the fitting region.