Вы находитесь на странице: 1из 73

Solutions to Problems in

Noise and Vibration Analysis:


Signal Analysis and Experimental Procedures

Anders Brandt

February 3, 2013
Contents

Preface v

1 Introduction 1

2 Dynamic Signals and Systems 3

3 Time Data Analysis 9

4 Statistics and Random Processes 15

5 Fundamental Mechanics 19

6 Modal Analysis Theory 25

7 Transducers for Noise and Vibration Analysis 33

8 Frequency Analysis Theory 35

9 Experimental Frequency Analysis 39

10 Spectrum and Correlation Estimates Using the DFT 45

11 Measurement and Analysis Systems 47

12 Rotating Machinery Analysis 49

13 Single-input Frequency Response Measurements 51

14 Multiple-input Frequency Response Measurement 57

15 Orthogonalization of Signals 61

iii
16 Advanced Analysis Methods 63

Bibliography 65
Preface

This is a document with answers and solution examples for the Problems in
my book ‘Noise and Vibration Analysis: Signal Analysis and Experimental
Procedures’ [1]. It is available for anyone, and can be downloaded from my
website http://www.abravibe.com if you obtain a verified login account.
The answers and solution examples are formulated in a form that I per-
sonally prefer. This means that in most cases the solutions are ‘pragmatic’
rather than stringent. I hope you like this. In many cases the solutions pre-
dominantly consist of MATLAB/Octave code. For these code examples to
work, in most cases you will have to have installed the accompanying toolbox,
ABRAVIBE which can also be downloaded from my website. In addition,
you usually have to add plotting etc., as I have tried to keep this document
as short as possible by not including obvious things.
I hope this document will be useful for your teaching or learning of vi-
brations and vibration analysis! Please feel free to contact me through my
website if you have any questions or suggestions for improvements.
Odense February 3, 2013
Anders Brandt

v
Chapter 1

Introduction

No Problems!

1
Solutions to Book Problems

Copyright ©, 2013 Anders Brandt 2


Chapter 2

Dynamic Signals and Systems

Problem 2.1.
a) 5 V.
b) 10 Hz.
c) The function value at t = 0 is approximately 3.5. The initial phase
angle is thus found by solving 5sin(φ) = 3.5 which gives φ ≈ 0.775 rad or
approximately 45 degrees. This answer must be taken rather approximately,
as it is strongly dependent on the value of the function at t = 0 which is not
readily read by any accuracy.
d) Let us first assume that the angle in c) is exactly 45 degrees, or π/4
radians. Thus

x(t) = 5 sin(2π · 10t + π/4) = 5cos(2π · 10t − π/4)

We thus have that the sought, complex sine is x̃(t) = 5ej(2π·10t−π/4) ≈ 3.54(1−
j)ej2π·10t

Problem 2.2. The RMS level is found as the square root of the mean of the
mean of a signal sin2 (ωt) is one half (0.5), the sought
squared signal. As theq

RMS level is xrms = 42 /2 = 4/ 2. It is also quite acceptable to simply

‘know’ that the RMS level is always the amplitude divided by 2.

Problem 2.3. An example MATLAB/Octave code including some test code


of the function can be written as

1 f1=50;
2 f2=[10 20 40 50 60 80 100 48 49 51 52];
3 for n = 1:length(f2)
4 m=multsines(f1,f2(n));
5 pause

3
Solutions to Book Problems

6 end
7 %−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
8 % The function
9 function [y,t] = multsines(f1,f2)
10 fs=10*max(f1,f2);
11 T=10*max(1/f1,1/f2);
12 t=(0:1/fs:T)';
13 y=sin(2*pi*f1*t).*sin(2*pi*f2*t);
14 m=mean(y);
15 plot(t,y)
16 xlabel('Time [s]')
17 s=sprintf('f1=%i, f2=%i, and mean = %6.2f',f1,f2,m);
18 title(s)

Problem 2.4. Solving


√ √ for the roots of the denominator we get s1,2 = −1 ±
1 − 4 = −1 ± j 3.
The answer can also be obtained by the MATLAB/Octave command se-
quence
» roots([1 2 4])
Problem 2.5. We solve the partial fraction expansion by the hand-over
(cover-up) method. Thus
1 R1 R2
= +
(s − s1 )(s − s2 ) s − s1 s − s2
√ √
where s1 = −1 + j 3 and s2 = −1 − j 3 were found in Problem 2.4. The
residues are found as
1 1 1 j

R1 = = = √ =− √
s − s2 s=s1

s1 − s2 2j 3 2 3
and similarly
1 1 1 j

R2 = = =− √ = √
s − s1 s=s2

s2 − s1 2j 3 2 3

Problem 2.6. Using the partial fraction expansion from Problem 2.5, and
observing that R1 = −R2 , we have that
j h √ √ i
h(t) = R1 es1 t + R2 es2 t = √ −e(−1+j 3)t + e(−1−j 3)t
2 3
j h  √ √ i je−t √
= √ e−t e−j 3t − ej 3t = √ · (−2) · j sin( 3t)
2 3 2 3
e −t √
= √ sin( 3t)
3

Copyright ©, 2013 Anders Brandt 4


Solutions to Book Problems

Impulse Response
0.3

0.25

0.2

0.15

0.1

0.05

−0.05
0 2 4 6 8 10
Time [s]

Figure 2.1: Plot for Problem 2.6

MATLAB/Octave code to verify and plot the results can be written as


follows:

1 t=(0:1/100:10);
2 hc=exp(−t)/sqrt(3).*sin(sqrt(3)*t);
3 A=[1 2 4];
4 B=1;
5 [R,p]=residue(B,A);
6 h=real(R(1)*exp(p(1)*t)+R(2)*exp(p(2)*t));
7 plot(t,h,t,hc)

The plot should appear similar to Figure 2.1


Problem 2.7. Replacing the Laplace operator by s = jω = j2πf we get the
frequency response function
1
H(jω) =
−ω 2 + j2ω + 4
The function is calculated and plotted by the following MATLAB/Octave
code.

1 f=(0:0.01:2)'; % Always use columns


2 jw=j*2*pi*f;

Copyright ©, 2013 Anders Brandt 5


Solutions to Book Problems

Frequency Response

Transfer Func. Magnitude


0
10

−2
10

−4
10
0 0.5 1 1.5 2

0
Phase [Deg.]

−50

−100

−150

−200
0 0.5 1 1.5 2
Frequency [Hz]

Figure 2.2: Plot for Problem 2.7

3 H=1./(jw.^2+2*jw+4);
4 semilogy(f,H)

The plot should look similar to Figure 2.2.

Problem 2.8. We start by the expression x ∗ h


Z ∞
x(t) ∗ h(t) = x(u)h(t − u)du
−∞

We make the variable substitution


t−u=z ⇒u=t−z
du = −dz
u = −∞ ⇒ z = ∞, u = ∞ ⇒ z = −∞

The integral now becomes


Z −∞
x(t) ∗ h(t) = x(t − z)h(z)(−dz) =
Z∞∞
= x(t − z)h(z)dz = h(t) ∗ x(t)
−∞

QED

Copyright ©, 2013 Anders Brandt 6


Solutions to Book Problems

Problem 2.9. A polynomial is represented in MATLAB/Octave by a vec-


tor with the polynomial coefficients, starting with the one with highest order.
Thus for example the polynomial s2 +3s+2 corresponds to the MATLAB/Oc-
tave polynomial [1 3 2]. Equation (2.35) on page 19 gives a Laplace expres-
sion
10
Y (s) = .
(s + 3)(s2 + 3s + 2)
To find the two roots of the second order polynomial (which are poles p of the
system), we can use the roots command:
» p = roots([1 3 2])
which gives us the two roots p1 = −2, p2 = −1, to be added to the pole
p3 = −3 from the first-order polynomial. We can now obtain the entire third-
order polynomial with the command poly in the following way,
» P = poly([-1 -2 -3])
which results in the vector [1 6 11 6].
To solve the differential equation, the third-order Laplace expression Y (s)
has to be decomposed using partial fraction expansion. This is done in MAT-
LAB/Octave by first defining the two polynomials that make up Y (s) =
B(s)/A(s), that is B(s)=10, and A(s) = [1 6 11 6], and then the partial
fraction expansion is done by the command residue,
» [R,p] = residue(B,A)
which results in the residues 5, −10, 5 for the poles that we already know,
−3, −2, −1. Note that each residue, of course, belongs to a particular pole.
Once we have the poles and residues, the solution in the time domain is

y(t) = R1 ep1 t + R2 ep2 t + R3 ep3 t = 5e−3t − 10e−2t + 5e−t .

Problem 2.10. As mentioned on page 25 in [1], polynomial multiplication


is equivalent to convolution. So, the third-order polynomial could also have
been obtained by
» P = conv([1 3],[1 3 2])
If you make the polynomial multiplication you should obtain the same
polynomial as in Problem 2.9 and by the above convolution.

Copyright ©, 2013 Anders Brandt 7


Solutions to Book Problems

Copyright ©, 2013 Anders Brandt 8


Chapter 3

Time Data Analysis

Problem 3.1. The following MATLAB/Octave code can be used

1 fs=2000;
2 T=0.05;
3 t=(0:1/fs:T)';
4 x1=cos(2*pi*800*t);
5 x2=cos(2*pi*1200*t);
6 M=max(abs(x1−x2));
7 fprintf('Max deviation is approx. %5.2g\n',M)

which should result in a maximum deviation of approximately 10−13 .

Problem 3.2. First, note the printing error in Eq.(3.30), where t is missing
in both exponents, see the latest errata list. In the frequency domain, the
output spectrum at the frequency fn , n = 1, 2 will be

Y (fn ) = X(fn )H(fn ) = |X1 | ej(∠(X(fn )) · |H(fn )| ejAωn

where ∠X(fn ) = ∠X1 + ωn . Thus, focusing on the angle, we have that

∠Y (fn ) = ∠X(fn ) + ∠H(fn ) = ∠X(fn ) + Aωn

Thus, if we let f2 = af1 for some constant a, then

∠Y (f1 ) = ∠X1 + ω1 + Aω1


∠Y (f2 ) = ∠X2 + ω2 + Aω2 .

The phase angle difference in the output signal is therefore

∠Y (f2 ) − ∠Y (f1 ) = ∠X2 − ∠X1 + (1 + A)(ω2 − ω1 )

9
Solutions to Book Problems

which can be written as B(f2 − f1 ). If the original difference in angle between


the two frequency components were such that

∠X2 − ∠X1
=b
ω1 − ω2
then for the output signal, the corresponding relation between the angles of
the two components are

∠Y2 − ∠Y1
= b + (1 + A) = C
ω1 − ω2
which is independent of the frequencies f1 and f2 . Thus, the relative phase
relationships between the frequencies are kept through the filter H(f ). QED

Problem 3.3. The following MATLAB/Octave code can be used

1 fs=1;
2 dt=1/fs;
3 f=linspace(0,0.5,1000)';
4 jw=j*2*pi*f;
5 Hi=dt./(1−exp(−jw));
6 subplot(2,1,1)
7 loglog(f,abs(Hi),f,abs(1./jw));
8 subplot(2,1,2)
9 semilogx(f,angledeg(Hi),f,angledeg(1./jw))

The result should be similar to Figure 3.1.

Problem 3.4. The following MATLAB/Octave code can be used

1 fs=1;
2 dt=1/fs;
3 f=linspace(0,0.5,1000)';
4 jw=j*2*pi*f;
5 B=dt*[1 −1];
6 A=1;
7 Hd=freqz(B,A,f,fs);

plus plotting commands similar to those for Problem 3.3. The result should
be similar to Figure 3.2.

Problem 3.5. The following code can be used. A special ‘trick’ is necessary
to compensate the frequency response for the time dealy corresponding to 6
samples.

Copyright ©, 2013 Anders Brandt 10


Solutions to Book Problems

5
10
Log. Magnitude

0
10

−5
10
−3 −2 −1
10 10 10

0
Integrator
Phase, [Deg.]

True
−50

−100
−3 −2 −1
10 10 10
Log. Relative Frequency f/fs

Figure 3.1: Plot for Problem 3.3

5
10
Log. Magnitude

0
10

−5
10
−3 −2 −1
10 10 10

100
Phase, [Deg.]

50
diff
True
0
−3 −2 −1
10 10 10
Log. Relative Frequency f/fs

Figure 3.2: Plot for Problem 3.4

Copyright ©, 2013 Anders Brandt 11


Solutions to Book Problems

−50

−100
Log. Magnitude

−150

−200

−250

−300

−350
−3 −2 −1
10 10 10
Log. Rel. Frequency f/fs

Figure 3.3: Plot for Problem 3.5

1 fs=1;
2 N=1001;
3 f=linspace(0,0.5,N);
4 jw=j*2*pi*f;
5 [B,A]=mfdfilt(6); % See inside for details
6 Hd=freqz(B,A,f,fs);
7 Hd=Hd.*exp(2j*pi*6*f); % Adjust for time delay
8 d=(Hd−jw)./jw;
9 semilogx(f,db20(d));

plus plotting commands similar to those for Problem 3.3. The result should
be similar to Figure 3.3. The error at f /fs = 0.01 is approximately -131.5
dB.
Problem 3.6. The folowing code computes the true differentiated signal in
yt, and a differentiated output in yr (using remez algorithm) and ym (using
maxflat). If you are using Octave, please note that only maxflat is possible.
A suitable way to compute how similar the signals are, is to compute the
standard deviation of the difference between the signals. It is also a good ide
to normalize this value with the standard deviation of the true differentiated
signal.

1 fs=2300;
2 t=(0:1/fs:10)';

Copyright ©, 2013 Anders Brandt 12


Solutions to Book Problems

3 x=sin(2*pi*230*t);
4 yt=(2*pi*230)*cos(2*pi*230*t);
5 Type='remez';
6 yr=timediff(x,fs,Type);
7 L=length(yr);
8 % Throw away transient start signal
9 dr=std(yr(100:L)−yt(100:L))/std(yt)
10 Type='maxflat';
11 ym=timediff(x,fs,Type);
12 L=length(ym);
13 dr=std(ym(100:L)−yt(100:L))/std(yt)

You should note that the first 100 samples are thrown away. Try running
the script with this reduces to 10 and to 1, respectively. You will see that it
makes a big difference! If you plot yr and yt overlaid you will see why. The
differentiation filters take a few samples before they settle (i.e. the transient
response dies out).

Problem 3.7. The folowing code computes the true integrated signal in yt,
and integrated outputs in ys, yh, and yi for simple, hpfilter, and IIR type,
respectively.

1 fs=2300;
2 t=(0:1/fs:10)';
3 x=sin(2*pi*230*t);
4 yt=−1/(2*pi*230)*cos(2*pi*230*t);
5 Type='simple';
6 ys=timeint(x,fs,Type);
7 L=length(ys);
8 % Throw away transient start signal
9 ds=std(ys(100:L)−yt(100:L))/std(yt)
10 Type='hpfilter';
11 yh=timeint(x,fs,Type);
12 L=length(yh);
13 dh=std(yh(100:L)−yt(100:L))/std(yt)
14 Type='iir';
15 yi=timeint(x,fs,Type);
16 L=length(yi);
17 di=std(yi(100:L)−yt(100:L))/std(yt)

You should note how much better the IIR method is compared with the other
two methods.

Copyright ©, 2013 Anders Brandt 13


Solutions to Book Problems

Copyright ©, 2013 Anders Brandt 14


Chapter 4

Statistics and Random


Processes

Problem 4.1. The mean value of the normalized variable z is


x − x̄ 1 1 1
 
z̄ = E = E [x − x̄] = E [x] − x̄ = [x̄ − x̄] = 0
σx σx σx σx
The variance of z, σz2 is (note z̄ = 0)

(x − x̄)2 σx2
" #
h i 1 h i
σz2 = E (z − z̄) 2
=E = E (x − x̄)2
) = =1
σx2 σx2 σx2
Problem 4.2. We have that
Z z0 Z z0 1 Z z0 − z 2
pz (z)dz = 2 pz (z)dz = 2 √ e 2 dz
−z0 0 2π 0
Thus, with Eq. (4.42) we have that
! √
z0 2 Z z0 / 2 −t2
erf √ =√ e dt =
2 π 0
 √ √ 
 t = z/ 2 ⇒ dt = dz/ 2 
= √ =
t = 0 ⇒ z = 0, t = z0 / 2 ⇒ z = z0 
2 Z z0 −z2 √
=√ e 2 dz/ 2 =
π 0
s
2 Z z0 −z2 1 Z z0 −z2
= e 2 dz = 2 √ e 2 dz
π 0 2π 0
The last equation is equal to the last integral in the first equation in this
example. QED

15
Solutions to Book Problems

0
0.4 10

0.2

−5
0 10
−5 0 5 −5 0 5
0
0.4 10

0.2
−5
10

0
−10 0 10 −5 0 5

Figure 4.1: Plot for Problem 4.4

Problem 4.3. By letting x1 = x2 = x3 = x4 in the theorem, we obtain the


kurtosis (we let the mean be zero for simplicity)
E [x4 ] E [x2 ] E [x2 ] + E [x2 ] E [x2 ] + E [x2 ] E [x2 ]
K(x) = = =
σx4 σx4
3σ 2 σ 2
= x4 x = 3
σx
Problem 4.4. The following code computed the PDFs of the data and of
Gaussian data with the same mean and standard deviation. The apdf com-
mand can either produce a linear plot, or a logy plot, as in Figure 4.1.

1 % Linear plots
2 x=randn(100000,1);
3 [pdfx,ax]=apdf(x,50,1);
4 y=x+0.1*x.*abs(x);
5 [pdfG,ay]=apdf(y,50,1);
6 % sometimes better with log plots
7 x=randn(100000,1);
8 [pdfx,ax,Gx]=apdf(x,50,2);
9 y=x+0.1*x.*abs(x);
10 [pdfy,ay,Gy]=apdf(y,50,2);

Problem 4.5. The following code creates the data and test for stationarity
with the reverse arrangements test.

Copyright ©, 2013 Anders Brandt 16


Solutions to Book Problems

1 x=randn(100000,1);
2 s=sin(linspace(0,pi,100000))';
3 y=x.*s;
4 % Reverse arrangements test on std
5 N=100;
6 F=framestat(y,N,'std');
7 alfa=0.02;
8 status=teststat(F,0.02,'reverse')

The result of the test is that data in y are stationary (despite the fact that
the data are obviously not stationary). The reverse arrangements test tests
if each frame result is larger or smaller that all subsequent frames. If data
are stationary, the principle of the test is that each frame should be larger
than approximately half of the subsequent frames. This does, however, occur
also in the case of the present data, since the amplitude of the random signal
increases and decreases in amplitude over equal amount of time. The reverse
arrangements test simply does not detect this case of nonstationarity.

Problem 4.6. The following code creates the data and test for stationarity
with the runs test.

1 x=randn(100000,1);
2 s=sin(linspace(0,pi,100000))';
3 y=x.*s;
4 % Reverse arrangements test on std
5 N=100;
6 F=framestat(y,N,'std');
7 alfa=0.02;
8 status=teststat(F,0.02,'runs')

The runs test detects that data are nonstationary. This is because the runs
test is sensitive to trends in the data, as each frame result is checked against
only adjacent frame results when it produces the number of runs. Thus data
such as the data in y produces much too few runs.

Copyright ©, 2013 Anders Brandt 17


Solutions to Book Problems

Copyright ©, 2013 Anders Brandt 18


Chapter 5

Fundamental Mechanics

Problem 5.1. We have the SDOF transfer function


1/m 1/m
H(s) = =
s2 2
+ s2ζωn + ωn (s − s1 )(s − s2 )
where the poles are
q
s1,2 = −ζωn ± jωn 1 − ζ 2 = σ ± jωd
Partial fraction expansion of H(s) gives
C1 C2
 
H(s) = +
s − s1 s − s2
which (using the hand-over or cover-up method) yields
1/m 1
C1 = =
s1 − s2 j2mωd
1/m −1
C2 = = (= −C1 = C1∗ )
s2 − s1 j2mωd

where ωd = ωn 1 − ζ 2 .
Problem 5.2. We will solve this problem and Problem 5.3 together. We
start by writing the impulse response as in Eq. (5.14)
h(t) = C1 e−ζωn t ejωd t + C2 e−ζωn t e−jωd t =
1 h i
= e−ζωn t ejωd t − e−jωd t =
j2mωd
1
= e−ζωn t 2j sin (ωd t) =
j2mωd
1
= sin (ωd t)
mωd

19
Solutions to Book Problems

and thus
1
A=
mωd
and Eq. (5.15) is thus proved.

Problem 5.3. See Problem 5.2.

Problem 5.4. First, note the missing mass in this Problem. As mentioned
in the errata list, assume a unity mass, i.e. m = 1 kg. The following code
can be used. The code is written as two functions only because it can then
contain the whole solution in one file; otherwise it had to be split into a script
file and a function file, for example. This code uses the envelope computation
using the Hilbert transform. This is kind of advanced considering the Hilbert
transform is not introduced until Chapter 16. You are not expected to have
come up with this method in your solution. You can rather use a cursor and
manually find where the impulse response has decayed to a certain amount of
the start value. However, the method below allows for ‘automatic’ detection
of how many periods of oscillation the impulse response goes through before
reaching approximately 1 % of the beginning value.
Change the damping where it says, and run again

1 function problem5_4
2 fn=[1 10 20 50 100 1000];
3 z=[0.05]; % Try different values, say 0.1, 0.05, 0.02!
4 for n=1:length(fn)
5 [h,t,fs]=fz2impresp(fn(n),z);
6 figure
7 plot(t,h)
8 xlabel('Time [s]')
9 title(['f_n = ' num2str(fn(n))]);
10 e=abs(hilbert(h/max(h)));
11 idx=min(find(e < .01));
12 T=t(idx);
13 Nper(n)=floor(T*fn(n));
14 pause
15 close
16 end
17 Nper
18 % Nper=−log(0.01)/(2*pi*z) % within resolution
19 end
20 function [h,t,fs]=fz2impresp(fn,z)
21 m=1;
22 wd=2*pi*fn*sqrt(1−z^2);
23 A=1/(m*wd);
24 % fs is unspecified: set to 100*fn

Copyright ©, 2013 Anders Brandt 20


Solutions to Book Problems

25 fs=10*fn;
26 % We also need to set some max. time
27 % Let's say 100 periods of fn
28 T=100/fn;
29 t=(0:1/fs:T)';
30 h=A*exp(−z*2*pi*fn*t).*sin(wd*t);
31 end

The code shows that for each damping value, the number of periods until
the impulse response has decayed is constant, independent of the natural fre-
quency, fn . This is not surprising, since the exponential decay is e−ζ2πfn t,
and in this expression, fn t, for a particular time t, is the number of periods
of oscillation with the frequency fn . Thus, if we set the decay to 0.01, for
example, as in the MATLAB/Octave code above, then we have that

− ln(0.01)
fn t =
2πζ

which is constant for a particular damping ratio ζ.

Problem 5.5. The following code can be used as an example.

1 function problem5_5
2 fn=1;
3 z=[0.01 0.05 0.1];
4 for n=1:length(z)
5 [H(:,n),f]=sdofmob(fn,z(n));
6 end
7 figure
8 subplot(1,3,1)
9 plot(f,abs(H))
10 grid
11 subplot(1,3,2)
12 semilogy(f,abs(H))
13 grid
14 subplot(1,3,3)
15 loglog(f,abs(H))
16 grid
17 end
18 function [H,f]=sdofmob(fn,z)
19 m=1;
20 % Specify frequency axis with N=1000 and up to 10*fn
21 f=linspace(0,5*fn,1000);
22 jw=j*2*pi*f;
23 H=jw/m./(jw.^2 +jw*2*z*2*pi*fn + (2*pi*fn)^2);
24 end

Copyright ©, 2013 Anders Brandt 21


Solutions to Book Problems

The code for accelerance is obtained by simply multiplying the mobility in the
sdofmob function above (on line 23) by jω (and preferrably change the name
to sdofacc).

Problem 5.6. The following code is a slight modification to the problem text.
It produces the same result.

1 m=4; k=1e6; c=80;


2 [H,f]=sdofacc(m,c,k);
3 semilogy(f,abs(H))
4
5 function [H,f]=sdofacc(m,c,k)
6 fn=1/(2*pi)*sqrt(k/m);
7 z=c/(2*sqrt(m*k));
8 % Specify frequency axis with N=1000 and up to 10*fn
9 f=linspace(0,10*fn,1000);
10 jw=j*2*pi*f;
11 H=jw.^2/m./(jw.^2 +jw*2*z*2*pi*fn + (2*pi*fn)^2);
12 end

To find m, c, k from the plot, one way is to follow these points:

1. Go to the highest frequency and read out H(∞) ≈ 1/m from which you
extract the mass.

2. Read the
q frequency of the peak, and extract the stiffness by solving fn =
1/(2π) (k/m).

3. The damping is a little more tricky. First find Hmax , and then go down
-3 dB to Hmax /sqrt(2) on both sides of the peak, to find the resonance
bandwidth Br = fu − fl , the upper minus the lower -3 dB frequencies.
The damping is then found by ζ = Br /(2fn ).
An alternative to find the stiffness is to convert the accelerance to dy-
namic flexibility (receptance, displacement/force) by dividing the accel-
erance by −ω 2 . At low frequencies, the FRF is now approaching 1/k.

Problem 5.7. A force balance equation on the mass at the top of Fig. (5.11)
(b) yields (using y for the mass displacement as in (a))

F (t) = mÿ + cẏ + ky

A force balance equation at the bottom yields

Fe (t) = cẏ + ky

Copyright ©, 2013 Anders Brandt 22


Solutions to Book Problems

By Laplace transforming both of these differential equations and form the


ratio Fe (s)/F (s) we obtain

Fe (s) cs + k (cs + k)/m


= 2
= 2
F (s) ms + cs + k s + s · c/m + k/m

which is identical to the expression on the right-hand side of Eq. (5.51). Since
it has already been shown that Eq. (5.51) leads to Eq.|(5.54), the expression
on the right-hand side of Eq. (5.55) will be the same as the right-hand side
of Eq. (5.54). QED.

Problem 5.8. The resonance frequency will be approx. 16 Hz.

Copyright ©, 2013 Anders Brandt 23


Solutions to Book Problems

Copyright ©, 2013 Anders Brandt 24


Chapter 6

Modal Analysis Theory

Problem 6.1. See the solution for Problem 5.1.

Problem 6.2. The matrices become


" #
2 0
[M ] =
0 5
" #
2 · 104 −1 · 104
[K] =
−1 · 104 2 · 104
" #
12 −1
[C] =
−1 27
Solution procedure 1
In the first approach, we first calculate M −1 K
" #
1 · 104 −5 · 103
[Mp ] = . . . =
−5 · 103 4 · 103

The characteristic polynomial then becomes

CP = Mp − λ⌈I⌋ = (1 · 104 − λ)(4 · 103 − λ) − 25 · 106 )

Note that this can be computed in MATLAB/Octave using convolution. If


variable MP contains the matrix Mp above, then the following lines computes
the characteristic polynomial in CP, roots of it in R

1 CP=conv([−1 MP(1,1)],[−1 MP(2,2)]) − [0 0 MP(1,2)*MP(2,1)]


2 R=roots(CP)

25
Solutions to Book Problems

which results in the characteristic polynomial

CP = λ2 − 1.4 · 104 λ + 3 · 107

with the roots (eigenvalues)

1.14 · 104
(
λ=
0.264 · 104

Because the system has proportional damping, the mode shapes are iden-
tical to those of the undamped system. Thus, once the poles (eigenvalues) are
calculated, we insert them into the equation for the undamped system

[Mp ] − λr [I] = {0}

which, for the first (lowest) eigenvalue, of 0.264 · 104 gives us


" #( ) ( )
1 · 104 − 0.264 · 104 −5 · 103 ψ1 0
=
−5 · 103 4 · 103 − 0.264 · 104 ψ2 1
0

which leads to the mode shape, normalized to unity length,


( )
0.562
0.827 1

For the second eigenvalue of 1.14 · 104 , we get


" #( ) ( )
1 · 104 − 1.14 · 104 −5 · 103 ψ1 0
=
−5 · 10 4 · 10 − 1.14 · 104
3 3
ψ2 2
0

which gives the mode shape


( )
0.965
−0.262 2

We now use the mode shapes to diagonalize the mass, damping, and stiff-
ness matrices, from which we can find the poles of the damped system. Thus
" #T " #" #
T 0.562 0.965 2 0 0.562 0.965
⌈Mr ⌋ = [Ψ] [M ] [Ψ] = =
0.827 −0.262 0 5 0.827 −0.262
& %
4.05 0
=
0 2.21

Copyright ©, 2013 Anders Brandt 26


Solutions to Book Problems

Similarly & %
1.07 0
⌈Kr ⌋ = · 104
0 2.51
& %
21.3 0
⌈Cr ⌋ = · 104
0 13.5
Using the modal mass, modal damping, and modal stiffness values as
SDOF systems, we obtain natural frequencies and damping factors
s
1 k1
f1 = = . . . = 8.18Hz
2π m1
c1
ζ1 = √ = . . . = 0.074 = 5.1%
2 m1 k1
s
1 k2
f2 = = . . . = 17.0Hz
2π m2
c2
ζ1 = √ = . . . = 0.077 = 2.9%
2 m2 k2
By which we can compute the complex poles (with positive imaginary part;
the complex conjugates are also poles) as
q
s1 = −ζ1 ω1 + jω1 1 − ζ1 = −2.63 + j51.3
q
s2 = −ζ1 ω1 + jω1 1 − ζ1 = −3.07 + j106.5.

Solution procedure 2
In the second approach, we first calculate K −1 M
" #
0.133 · 10−3 −0.167 · 10−3
[Kp ] = . . . =
−0.0667 · 10−3 0.333 · 10−3

The characteristic polynomial then becomes

CP = (0.133 · 10−3 − λ)(0.333 · 10−3 − λ) − 1.11 · 10−8 )

which can be computed in MATLAB/Octave as shown in procedure 1. This


results in the characteristic polynomial

CP = λ2 − 4.67 · 10−4 λ + 3.33 · 10−8

with roots (eigenvalues) (


0.379 · 10−3
λ=
0.0880 · 10−3

Copyright ©, 2013 Anders Brandt 27


Solutions to Book Problems

We insert the eigenvalues into the equation for the undamped system
[Kp ] − λr [I] = {0}
which, for the first (highest, because the eigenvalues are now proportional to
1/s2 ) eigenvalue, of 0.379 · 10−3 gives us
" # ( )
0.133 · 10−3 − 0.379 · 10−3 0.167 · 10−3 ψ1
=
0.0667 · 10−3 0.333 · 10−3 − 0.264 · 10−3 ψ2 1

which leads to the mode shape, normalized to unity length,


( )
0.562
0.827 1

For the second eigenvalue of 0.0880 · 10−3 , we get


" # ( )
0.133 · 10−3 − 0.0880 · 10−3 0.167 · 10−3 ψ1
=
0.0667 · 10−3 0.333 · 10−3 − 0.0880 · 10−3 ψ2 2

which gives the mode shape


( )
0.965
−0.262 2

In the previous step we thus obtained the same mode shapes as in Solution
procedure 1, although to roots of the system equation (Kp ) was different. From
this stage on, the solutions are the same.
Problem 6.3. The following code is a solution using eig (assuming matrices
already defined as in above two problems)

1 % Solution using eig and the first approach (inv(M)*K)


2 [V,D]=eig(M\K)
3 % Undamped natural frequencies
4 pn=sqrt(−diag(D))
5 Mr=V'*M*V
6 Cr=V'*C*V
7 Kr=V'*K*V
8 % Relative damping factors
9 z(1)=Cr(1,1)/(2*sqrt(Mr(1,1)*Kr(1,1)));
10 z(2)=Cr(2,2)/(2*sqrt(Mr(2,2)*Kr(2,2)));
11 z=z(:) % Make sure z is a column
12 % Complex poles (with positive imaginary parts)
13 disp('poles:')
14 p=−z.*pn+j*pn.*sqrt(1−z.^2)
15 disp('mode shapes:')
16 V

Copyright ©, 2013 Anders Brandt 28


Solutions to Book Problems

−1
10

−2
10
Mobility [(m/s)/N]

−3
10

−4
10

0 10 20 30 40 50
Frequency [Hz]

Figure 6.1: Problem64Plot

Problem 6.4. First note the errata list change, that the formulation should
be according to Eq. (6.100). An example of code to produce the task in this
Problem is found in the AbraVibe command mck2frf which is used in the
following lines of code:

1 f=(0:.001:50)';
2 Hv=mck2frf(f,M,C,K,[1:2],[1:2],'v');
3 figure
4 [N,D,R]=size(Hv);
5 for r=1:R
6 for d=1:D
7 semilogy(f,abs(Hv(:,d,r)));
8 hold on
9 end
10 end

The resulting FRFs can be seen in Fig. 6.1. As is obvious from the plot, only
three FRFs are visible. The reason is, of course, that (Maxwell’s) reciprocity
gives that H12 = H21 and therefore these two FRFs look like one.

The following code solves the poles and mode shapes of the system using a
state space formulation. The code come to the most part from the AbraVibe
command mck2modal, the part after detecting non-proportional damping.

Copyright ©, 2013 Anders Brandt 29


Solutions to Book Problems

1 % Following code is taken from the AbraVibe command ...


mck2frf for
2 % nonproportional code
3 A=[C M; M 0*M];
4 B=[K 0*M; 0*M −M];
5 [V,D]=eig(B,−A);
6 % Sort in descending order
7 [Dum,I]=sort(diag(abs(imag(D))));
8 p=diag(D);
9 p=p(I);
10 V=V(:,I);
11 % Rotate vectors to real first element (row 1)
12 phi=angle(V(1,:));
13 phi=diag(exp(−j*phi));
14 V=V*phi;
15 % Here we differ a little from mck2modal, as the AbraVibe ...
toolbox uses
16 % unity Modal A scaling, which we do not want here. ...
Instead we scale to
17 % unity length, but only after shortening the mode shapes
18 % Shorten to size N−by−N. NOTE!
19 [m,n]=size(V);
20 p=p(1:2:m);
21 V=V(1:m/2,1:2:n);
22 V(:,1)=V(:,1)/(norm(V(:,1)));
23 V(:,2)=V(:,2)/(norm(V(:,2)));
24 V=real(V);

Problem 6.5.
Problem 6.6. The following code uses the results from Problem 6.5 to pro-
duce the FRFs using Eq. (6.110)

1 % compute modal mass to be used for modal scaling


2 Mr=V'*M*V;
3 f=(0:.001:50)';
4 jw=j*2*pi*f;
5 Hv=zeros(length(f),2,2);
6 for r=1:2 % Force position
7 for d=1:2 % velocity position
8 % Next two: Eq. (6.109)
9 A1=1/(j*2*imag(p(1))*Mr(1,1))*V(r,1)*V(d,1);
10 A2=1/(j*2*imag(p(2))*Mr(2,2))*V(r,2)*V(d,2);
11 Hd=A1./(jw−p(1))+conj(A1)./(jw−conj(p(1)));
12 Hd=Hd+A2./(jw−p(2))+conj(A2)./(jw−conj(p(2)));
13 Hv(:,d,r)=jw.*Hd; % Receptance to Mobility
14 end

Copyright ©, 2013 Anders Brandt 30


Solutions to Book Problems

15 end

It should be noted that this could be done very simply using AbraVibe, in
the following way.

1 f=(0:.001:50)';
2 [p,V]=mck2modal(M,C,K);
3 Hv=modal2frf(f,p,V,[1:2],[1:2],'v');

Problem 6.7. In this example we add 5 to C(1,1) and recalculate the poles
and mode shapes. Using mck2modal we get

1 [p,V]=mck2modal(M,C,K);
2 % Rotate vectors to real first element (row 1)
3 phi=angle(V(1,:));
4 phi=diag(exp(−j*phi));
5 V=V*phi;
6 V(:,1)=V(:,1)/norm(V(:,1));
7 V(:,2)=V(:,2)/norm(V(:,2));
8 disp('poles:')
9 p
10 listpoles(p)
11 disp(' ')
12 disp('mode shapes:')
13 V
14 angledeg(V)

As can be seen, the undamped natural frequencies are unchanged within the
three digits we have used (although with more digits there is a slight difference,
of course) and damping ratios are changed to 5.5 % and 3.9 %, respectively.
As the last output of the script shows, the phase angles between the two masses
are approximately 0.8 degrees for the first mode (instead of zero), and 178
degrees for the second mode (instead of 180). The two masses thus still move
almost in- versus out-of-phase in the two modes.

Problem 6.8. For this problem we force the 2DOF system from the problems
above with a frequency very close to the first mode, say, f0 = 8.5Hz. we use
the command timefresp to excite the first mass and compute the responses
of the two masses. Then we change the damping of both modes to 1 % and
rerun. The following code shows how.

1 [p,V]=mck2modal(M,C,K);
2 [fr,zr]=poles2fz(p);

Copyright ©, 2013 Anders Brandt 31


Solutions to Book Problems

−4
x 10
5

−5
0 5 10 15 20
−3
x 10
1

−1
0 5 10 15 20

Figure 6.2: Plot for Problem 6.8

3 listpoles(p);
4 f0=8.5;
5 fs=500;
6 t=(0:1/fs:20)';
7 F=sin(2*pi*f0*t);
8 u1=timefresp(F,fs,p,V,1,[2],'d');
9 % Change damping to 1%
10 p=fz2poles(fr,0.01);
11 u2=timefresp(F,fs,p,V,1,[2],'d');

The results should look similar to Fig. 6.2 As can be seen in the plot, with
these numbers, the system takes approximately 2 seconds to settle when damp-
ing is the original damping. When reducing the damping of both modes to 1
%, it takes approximately 8 seconds for the transient to die. Try changing
the frequency of the sine closer to and further from the eigenfrequencies of
the system and see what happens!

Copyright ©, 2013 Anders Brandt 32


Chapter 7

Transducers for Noise and


Vibration Analysis

Problem 7.1. The second time constant is


1 1
τ2 = = ≈ 0.796
ω2 2π2
which by Eq. (7.5) gives a total time of
τ1 τ2
τmathrmtot = = . . . = 0.0796
τ1 + τ2
that is, with such a large difference, the small time constant is dominating.
Problem 7.2. With a dominating cutoff frequency of 2 Hz, the input acts as
a first-order highpass filter with this cutoff frequency. This filter has a FRF
defined by Eq. (3.6), which is
jω/ωc
H(jω) = .
1 + jω/ωc
An exact solution can be obtained by computing the magnitude |H(jw)| and
set this expression equal to 0.95. An approximate solution is obtained by
creating the FRF in MATLAB/Octave and find the value nearest to 0.95.
The following code implements this latter approach.

1 fc=2;
2 f=(0:.01:200)';
3 jwwc=j*f/fc;
4 H=jwwc./(1+jwwc);
5 Hmag=abs(H);
6 idx=min(find(Hmag ≥ 0.95));
7 fmin=f(idx)

33
Solutions to Book Problems

which gives a minimum frequency of approximately 6.1 Hz, which is three


times larger than the cutoff frequency. (1 % error would lead to approx. 7
times the cutoff frequency.)

Problem 7.3. Direct application of Eq. (7.7) gives

I 4 · 10−3
fmathrmmax = = ≈ 44kHz.
2πVp CL 2π3 · 94 · 10−3 · 50

Problem 7.4. A plot similar to Fig. 7.14 should be obtained.

Copyright ©, 2013 Anders Brandt 34


Chapter 8

Frequency Analysis Theory

Problem 8.1. To make it easier to calculate the Fourier series, we can make
two changes. First, we define a slightly different square wave signal
(
0 −Tp /2 ≤ t < 0
xp (t) =
10 0 ≤ t < Tp /2

with Tp = 1/f1 . Since the amplitude of this square wave varies between 0 and
1, then evidently the square wave signal in the Problem definition is

xs (t) = −5 + xp (t)

so that xs (t) lies between -5 and 5.


We then substitute v = 2πf1 t, which means that dt = dv/(2πf1 ), and the
integration limits of Eq. (8.2) become t = 0 ⇒ v = 0, t = Tp = 1/f1 ⇒ v =
2π.
To compute the Fourier series coefficients of xp (v), we note that the mean
of the signal is 5. Thus a0 = 5. For k > 1 we have that
2 Z Tp 1 Z 2π
ak = xp (t) cos (2πkf1 t) dt = xp (v) cos(kv)dv
Tp Tp π 0
Now, xp is zero between pi and 2π, so this integral becomes
1Zπ
ak = xp (v) cos(kv)dv = 0
π 0
quite evidently. For the bk coefficients, we obtain similarly that
" #π
1Zπ 1 − cos(kv)
bk = xp (v) sin(kv)dv = =
π 0 π k 0
1 10
= (−10 cos(kπ) + 1) = (1 − cos(kπ)) .
kπ kπ
35
Solutions to Book Problems

Since (
1 k = 0, 2, 4, . . .
cos(kπ) =
−1 k = 1, 3, 5, . . .
then bk = 0, k = 0, 2, 4, . . ., and
20
bk = k = 1, 3, 5, . . .

We can thus write the modified square wave signal as
!
20 sin(3v) sin(5v)
xp (v) = 5 + sin(v) + + + ...
π 3 5
and the original square wave we wanted is thus equal to
!
20 sin(3v) sin(5v)
xs (t) = sin(v) + + + ...
π 3 5

Problem 8.2. The easiest in this case is to note that the triangle as defined
in Fig. 8.3 is the integral of a square wave. We thus form a generic square
wave as in eq. 8.1. With unity amplitude a square wave thus can be written
as !
1 4 sin(3v) sin(5v)
xp (v) = + sin(v) + + + ...
2 π 3 5
By integrating this and noting that the first term must disappear since the
triangle does not include a trend, and since we do not know the amplitude,
then the triangle xt (v) can be written as
Z
sin(3v) sin(5v)
xt (v) = A sin(v) + + + . . . dv
3 5 !
cos(3v) cos(5v)
= −A cos(v) + + + ...
32 52
or, if we want to have it as a function of frequency,
!
cos(6πf1 t) cos(10πf1 t)
xt (t) = −A cos(2πf1 t) + + + ...
32 52
Plotting this function for A = 1 and watching the amplitude, it can be con-
cluded that the true amplitude should be A ≈ 2/π. The frequency is, of course
f1 = 5 Hz.
A small note is appropriate: A more common definition of a triangle wave
is perhaps the odd function obtained by time shifting the signal in the current

Copyright ©, 2013 Anders Brandt 36


Solutions to Book Problems

Problem a quarter period to the left. This function can easily be seen to be
composed of two straight lines, with positive slope from −π/2 to π/2, and
negative slope from pi/2 3π/2. Setting this up in Eq. (8.2) is rather straight-
forward, and the Fourier series expression then becomes the, perhaps, more
well-known
!
8 sin(6πf1 t sin(10πf1 t
xt (t) = 2 sin(2πf1 t) − ...
π 32 32

Problem 8.3. We start by proving Eq. (4.37) by using Eq. (4.32). It follows
that since
Ryx (τ ) = E [y(t)x(t − τ )]
then by substitution we have that

Rxy (τ ) = E [x(t)y(t − τ )] =
{u = t − τ ⇒ t = u + τ }
= E [y(u)x(u + τ )] = Ryx (−τ )

Next we look at the autospectral density Sxx (f ) where we have that, because
Rxx (−τ ) = Rxx (τ ) then,
Z ∞
Sxx (−f ) = Rxx (τ )e−j2π(−f )τ dτ =
−∞
{u = −τ ⇒ du = −dτ ; τ = −∞ ⇒ u = ∞; τ = ∞ ⇒ u = −∞; }.
Z −∞ Z ∞
−j2πf u
= Rxx (−u)e (−du) = Rxx (u)e−j2πf u du = Sxx (f )
∞ −∞

We now prove that Syx (−f ) = Sxy (f ) by a similar substitution


Z ∞
Syx (−f ) = Ryx (τ )e−j2π(−f )τ dτ =
−∞
{u = −τ ⇒ du = −dτ ; τ = −∞ ⇒ u = ∞; τ = ∞ ⇒ u = −∞; }
Z −∞ Z ∞ .
−j2πf u −j2πf u
= Ryx (−u)e (−du) = Ryx (−u)e du
∞ −∞
= F [Ryx (−τ )] = F [Rxy (τ )] = Sxy (f )

Finally, we prove that Syx (−f ) = Syx



(f )
Z ∞
Syx (−f ) = Ryx (τ )e−j2π(−f )τ dτ
−∞
Z ∞ Z ∞ .
= Ryx (τ ) cos (j2πf τ )dτ + j Ryx (τ ) sin (j2πf τ )dτ = Syx

(f )
−∞ −∞

Copyright ©, 2013 Anders Brandt 37


Solutions to Book Problems

Copyright ©, 2013 Anders Brandt 38


Chapter 9

Experimental Frequency
Analysis

Problem 9.1. The difference between the correct (periodic) and the incorrect
(non-periodic) time windows is most easily seen in the real and imaginary
parts. The following MATLAB/Octave code thus produces the data plotted
in Fig. 9.1. As can be seen in the plot, for a non-periodic time window, the
imaginary part does not equal zero (within numerical resolution) despite the
fact that the actual signal is even.

1 A1=3; f1=20;
2 A2=5; f2=40;
3 fs=512;
4 N=1024;
5 t=(0:1/fs:(N−1)/fs)';
6 y=A1*cos(2*pi*f1*t)+A2*cos(2*pi*f2*t);
7 % Correct (i.e. periodic) Hanning window
8 Y1=fft(ahann(N).*y)/N;
9 % Incorrect (i.e. non−periodic) Hanning window
10 Y2=fft(hann(N).*y)/N;
11 % Scale for amplitude (2 for single−sided, 2 for Hanning ...
amplitude
12 % compensation; DC bin is zero so nevermind to treat ...
separately)
13 Y1=Y1(1:N/2+1);
14 Y1=4*Y1;
15 Y2=Y2(1:N/2+1);
16 Y2=4*Y2;

Problem 9.2. Two harmonic components with different frequencies are or-
thogonal. Therefore the RMS value of the sum, given the two RMS levels

39
Solutions to Book Problems

Real part −14


x 10 Imaginary part
5 5

0 0

−5 −5
0 100 200 300 0 100 200 300

5 0.01

0 0

−5 −0.01
0 100 200 300 0 100 200 300

Figure 9.1: Plots for Problem 9.1


√ √
R1 = 3 2 and R2 = 5 2 is
q q
RM Stot = R12 + R22 = 9/2 + 25/2 ≈ 4.12.

The RMS value of the time signal can be computed either using the standard
deviation std command (since the mean of the signal is zero), or by the
AbraVibe toolbox command arms, which gives the same value.
Problem 9.3. It is reasonable to try some frequencies either on, or right in
between, the bins of the DFT. The Problem can be thus be executed by the
following MATLAB/Octave code, which results in the plots in Fig. 9.2 and
Fig. 9.3. Other frequencies can, of course, also be used.

1 A1=3; f1=20;
2 A2=5;
3 fs=512;
4 N=1024;
5 t=(0:1/fs:(N−1)/fs)';
6 % First frequencies on DFT bins
7 f2=[21 22 23 24];
8 for n=1:length(f2)
9 y=A1*cos(2*pi*f1*t)+A2*cos(2*pi*f2(n)*t);
10 [Y1(:,n),f]=alinspec(y,fs,ahann(N));
11 end
12 % Then frequencies between DFT bins

Copyright ©, 2013 Anders Brandt 40


Solutions to Book Problems

f1 = 20, f2 = 21 Hz f1 = 20, f2 = 22 Hz
4 4

2 2

0 0
20 22 24 26 20 22 24 26
f1 = 20, f2 = 23 Hz f1 = 20, f2 = 24 Hz
4 4

2 2

0 0
20 22 24 26 20 22 24 26

Figure 9.2: Plots for Problem9.3 with frequencies of second harmonic com-
ponent exactly on DFT bins

13 f2=[21 22 23 24]−0.25;
14 for n=1:length(f2)
15 y=A1*cos(2*pi*f1*t)+A2*cos(2*pi*f2(n)*t);
16 [Y2(:,n),f]=alinspec(y,fs,ahann(N));
17 end

The conclusion from the plots is that it is impossible to give any exact number
for the difference in frequencies which can be resolved, because it depends on
the amplitudes and frequencies of the involved harmonics (for example leakage
has a significant effect). To be safe, several analyses with different frequency
increment should be made.
Problem 9.4. This problem is easily executed by replacing the time window
ahann(N)in the call to alinspec command from Problem 9.3 by the flattop
command aflattop(N). The results should look like plots in Figs. 9.4 and
9.5.
Problem 9.5. To obtain correct convolution result when using DFT and
multiplication in the frequency domain, zero padding has to be used prior
to the DFT computation. This Problem can thus be executed by the MAT-
LAB/Octave code below, where for comparison, also the (erroneous) cyclic
convolution result is included.

Copyright ©, 2013 Anders Brandt 41


Solutions to Book Problems

f1 = 20, f2 = 20.50 Hz f1 = 20, f2 = 21.50 Hz


3 4

2
2
1

0 0
20 22 24 26 20 22 24 26
f1 = 20, f2 = 22.50 Hz f1 = 20, f2 = 23.50 Hz
4 4

2 2

0 0
20 22 24 26 20 22 24 26

Figure 9.3: Plots for Problem9.3 with frequencies of second harmonic com-
ponent between DFT bins

f1 = 20, f2 = 21 Hz f1 = 20, f2 = 22 Hz
6 4

4
2
2

0 0
20 22 24 26 20 22 24 26
f1 = 20, f2 = 23 Hz f1 = 20, f2 = 24 Hz
4 4

2 2

0 0
20 22 24 26 20 22 24 26

Figure 9.4: Plots for Problem9.4 with frequencies of second harmonic com-
ponent exactly on DFT bins

Copyright ©, 2013 Anders Brandt 42


Solutions to Book Problems

f1 = 20, f2 = 20.50 Hz f1 = 20, f2 = 21.50 Hz


3 4

2
2
1

0 0
20 22 24 26 20 22 24 26
f1 = 20, f2 = 22.50 Hz f1 = 20, f2 = 23.50 Hz
4 4

2 2

0 0
20 22 24 26 20 22 24 26

Figure 9.5: Plots for Problem9.4 with frequencies of second harmonic com-
ponent between DFT bins

1 x1=ones(1,8)
2 x2=[1 2 3 4 3 2 1 1]
3 disp('Regular convolution gives:')
4 c1=conv(x1,x2)
5 % With DFT:
6 disp('DFT convolution with zero padding gives')
7 c2=real(ifft(fft(x1,16).*fft(x2,16)));
8 round(c2)
9 % Compare this with cyclic convolution
10 c3=real(ifft(fft(x1).*fft(x2)))

Copyright ©, 2013 Anders Brandt 43


Solutions to Book Problems

Copyright ©, 2013 Anders Brandt 44


Chapter 10

Spectrum and Correlation


Estimates Using the DFT

Problem 10.1. A scaled autopower spectrum followed by a linear spectrum,


are computed by the following lines, where the AbraVibe toolbox command
winacf is used for the time window correction.

1 fs=1024;
2 N=1024;
3 A=5; f0=5;
4 % Create time axis and funtion
5 t=(0:1/fs:(N−1)/fs)';
6 % One block of data is enough as the signal is deterministic
7 x=A*sin(2*pi*f0*t);
8 % Autopower spectrum, Eqs. (10.1) and (10.3)
9 X=fft(x.*ahann(N));
10 Sxx=abs(X).^2; % Double−sided power conversion
11 Sa=2*winacf(ahann(64))^2/N^2; % Eq. (10.3)
12 Axx=Sa*Sxx(1:N/2+1); % Save up to fs/2
13 % Final autopower spectrum
14 Axx(1)=Axx(1)/2; % DC correction
15 % Linear spectrum
16 X_L=sqrt(Axx);

Problem 10.2. The flattop window is easily implemented by replacing the


two occations of the command ahann in Problem 10.1 by the command
aflattop.

Problem 10.3. To compute the RMS level from a linear spectrum, we have
to take care of the equivalent noise bandwidth, which can be computed using
the winenbw command from the AbraVibe toolbox. The RMS summation

45
Solutions to Book Problems

is thus made by running the code listed for Problem 10.1 followed by the
command line

1 Rx=sqrt(sum(X_L.^2)/winenbw(ahann(256)))

To test it, compare the value with the true value of 5/ 2 ≈ 3.5355.

Problem 10.4. This Problem is solved by running the code from Prob-
lem 10.2 and then replacing the time window in Problem 10.3 by the
aflattop command. The results should, of course, be the same RMS level,
3.5355 as in the previous Problems.

Problem 10.5. Here we will use the AbraVibe command apsdw to compute
the PSD. See inside this command for details of the implementation. To
evaluate the command you have developed in this Problem, the following code
can be used (by replacing the apsdw command with the command you have
developed yourself).

1 x=randn(100*1024,1);
2 N=1024;
3 fs=100; % Can be anything
4 % Compute a PSD with 50% overlap and Hanning window
5 [Pxx,f]=apsdw(x,fs,N);
6 RMSx=arms(x)
7 df=f(2)−f(1);
8 RMS_p=sqrt(df*sum(Pxx))

Problem 10.6. The following code computes the random error two ways and
give reasonable good accuracy for the experimentally obtained value.

1 % Create random signal


2 x=randn(100*1024,1);
3 N=8*1024;
4 fs=100; % Can be anything
5 PSD_true=var(x)/(fs/2);
6 % Compute a PSD with 50% overlap and Hanning window
7 [Pxx,f,NB]=apsdw(x,fs,N);
8 % The random error is
9 er1=std(Pxx−PSD_true)/PSD_true
10 % The random error is also
11 er2=welcherr(ahann(N),50,NB)

Copyright ©, 2013 Anders Brandt 46


Chapter 11

Measurement and Analysis


Systems

Problem 11.1. See documentation of your measurement system.

Problem 11.2. The answers for the parts are


1. The full-scale output of IEPE sensors is always 5 V.
2. The SI sensitivity is Sa = 100.4/9.81 ≈ .10.23 mV/(m s−2 ).
For an acceleration of a = 34 m s−2 , the output voltage is

Va = Sa · a = 10.23 · 34 ≈ 348mV

Problem 11.3. The 60 dB gain is equivalent to an amplification factor solved


by
20 · log10 (x) = 60
i.e. x = 103 = 1000.
The voltage output of 10 V then gives the pressure p in
10
Vp = 0.038V/Pa · 1000 · p = 10V ⇒ p = Pa
38
Thus the sound pressure level is
!
10/38
Lp = 20 · log10 = 82.4dB
20 · 10−6

47
Solutions to Book Problems

Copyright ©, 2013 Anders Brandt 48


Chapter 12

Rotating Machinery Analysis

Problem 12.1. The following code solves this problem.

1 StartRPM=800;
2 EndRPM=5800;
3 RunUpTime=60;
4 RMS1min=1; RMS1max=2;
5 RMS2min=.5; RMS2max=8;
6 % Define sampling frequency
7 fs=4*EndRPM/60*2; % 2 because order two
8 % Create time axis and tacho signal
9 t=(0:1/fs:RunUpTime)';
10 Tacho=chirp(t,StartRPM/RunUpTime,t(end),EndRPM/60);
11 Order2=chirp(t,2*StartRPM/RunUpTime,t(end),2*EndRPM/60);
12 % Create envelopes for order 1 and 2
13 o1env=RMS1min+(RMS1max−RMS1min)*sin(pi*t/RunUpTime);
14 o2env=RMS2min+(RMS2max−RMS2min)*abs(sin(2*pi*t/RunUpTime));
15 % Create order 1 and 2 and sum to runup−variable
16 o1=sqrt(2)*Tacho.*o1env;
17 o2=sqrt(2)*Order2.*o2env;
18 x=o1+o2;
19 % Now extract and plot the rpm−time profile
20 rpm=tacho2rpm(Tacho,fs,0,1,1,fs,50);

The resulting vibration signal and rpm-time profile should look similar to the
plot in Figure 12.1 (a) and (b).
Problem 12.2. Assuming the MATLAB code in Problem 12.1 has first been
executed, the following lines of code solves the current problem.

1 N=1*1024;
2 % Produce and plot RPM map
3 [S,F,R] = rpmmap(x,fs,rpm,t,StartRPM,EndRPM,50,ahann(N));

49
Solutions to Book Problems

(a) (b)
20 6000

Acceleration [m/s2] 4000

RPM
0
2000

−20 0
0 20 40 60 0 20 40 60
Time [s] Time [s]
(c) (d)

Synchr. Orders [m/s2 rms]


10 10
Orders [m/s2 rms]

5 5

0 0
1000 2000 3000 4000 5000 1000 2000 3000 4000 5000
RPM RPM

Figure 12.1: Plots for the Problems of Chapter 12

4 figure
5 plotrpmmapc(S,F,R)
6 % Extract orders 1 and 2 and overlay with true values
7 orders=map2order(S,F,R,[1 2],'hann5');
8 plot(R,orders,rpm,[o1env o2env])

The resulting order tracks should look similar to Figure 12.1 (c). Changing
the blocksize N should result in the finding that 1K is the maximum blocksize
before smearing starts to seriously impact the order tracks.

Problem 12.3. Assuming Problem 12.1 has first been executed, the following
lines resamples the time data and extracts the two first orders.

1 % Resample signal using the rpm−time profile


2 [xs,rpms,ts] = synchsampr(x,fs,rpm,16);
3 [Ss,Fs,Rs] = ...
rpmmaps(xs,rpms,8,16,StartRPM,EndRPM,50,'aflattop');
4 % Extract orders 1 and 2 and overlay with true values
5 orderss=map2order(Ss,Fs,Rs,[1 2],'synch');

The resulting order tracks should look similar to Figure 12.1 (d).

Copyright ©, 2013 Anders Brandt 50


Chapter 13

Single-input Frequency
Response Measurements

Problem 13.1. Since we can usually remove the large part of any extrane-
ous noise in the force signal by using a force window, the suitable estimator
is the H1 estimator, which removes the effect of any noise in the output
(acceleration, typically) signal.

Problem 13.2. This problem can be solved with code similar to the following.
Note that due to the random nature of the excitation, every realization does
not give identical result. You should rerun the example a few times and
see what changes. This gives you an idea of the statistical spread when 100
averages are used. The results should look similar to the plot in Figure 13.1

1 % Define SDOF system


2 m=1; % Or anything; not specified
3 k=(2*pi*12.5)^2*m;
4 c=2*0.02*sqrt(m*k);
5 % Define three blocksizes and create enough data for 100 ...
averages of the
6 % largest blocksize.
7 fs=200;
8 N=4*1024*[1 2 4];
9 x=randn(100*N(end),1);
10 % Compute the response
11 y=timefresp(x,fs,m,c,k,1,1,'d');
12 % Now estimate the FRF and coherence for each blocksize
13 for n=1:length(N)
14 Nt=N(n);
15 xt=x(1:100*Nt); % 100 averages for each blocksize
16 [Gxx,Gyx,Gyy,ft]=time2xmtrx(xt,y,fs,ahann(Nt));
17 [Ht,Ct]=xmtrx2frf(Gxx,Gyx,Gyy);

51
Solutions to Book Problems

−2.35
10
4096
FRF [m/N] 8192
16384

−2.45
10
12 12.2 12.4 12.6 12.8 13
Frequency [Hz]
Coherence [−]

0.99

0.98
12 12.2 12.4 12.6 12.8 13
Frequency [Hz]

Figure 13.1: Plots for Problem 13.2

18 H{n}=Ht;
19 C{n}=Ct;
20 f{n}=ft;
21 end

Problem 13.3. You should note that this is an example without extraneous
noise on the signals. So, any imperfections in the estimate, will come from
leakage effects (or numerical accuracy at the highest frequencies). The inten-
tion with the first part of this problem, using blocksize N = 1024 samples, is
intended to show that this is an inappropriate blocksize; it is too small rela-
tive to the length of the impulse response (or rather, with the given sampling
frequency, the time length of the 1024 blocksize block is too short relative to
the length of the impulse response of the system). This is difficult to see
when you are running the example, but as soon as the blocksize is increased
to 2048 samples, it should be clear that the coherence really looks better (up to
approximately 80 Hz or so; higher up in frequency the simulation method is
affecting the results so this frequency range should not be considered). This is
an important situation which also occurs in real measurement cases, and thus
it has to be identified so one does not accidentally conclude that the imperfect
coherence is caused by sensor noise or some other inevitabile source.
The following code could be used to estimate the frequency response and
coherence. By changing the blocksize and burst length the different solutions
requested in the Problem definition can be obtained.

Copyright ©, 2013 Anders Brandt 52


Solutions to Book Problems

1 % Define SDOF system


2 m=1; % Or anything; not specified
3 k=(2*pi*12.5)^2*m;
4 c=2*0.02*sqrt(m*k);
5 fs=200;
6 N=1024;
7 % Compute FRF using different burst lengths by changing ...
next line and rerun
8 % script
9 BurstL=30;
10 x=abrand(N,50,BurstL);
11 % Compute the response
12 y=timefresp(x,fs,m,c,k,1,1,'d');
13 % Estimate the FRF
14 [Gxx,Gyx,Gyy,ft]=time2xmtrx(x,y,fs,boxcar(N));
15 [Ht,Ct]=xmtrx2frf(Gxx,Gyx,Gyy);

If this code is run several times, changing the burst length between each
run, it should be obvious that the maximum burst length is approximately
40 % after which the coherence gets much worse. Increasing the blocksize to
2048, and rerunning the code lines with different burst lengths, you should see
that the coherence now gets better, and that the burst length can be increased
at least up to 60 %. It is important to separate these two results; the reason
the coherence is better overall with this blocksize, is that the block length (in
seconds) is now large enough relative to the impulse response length which
causes the type of error discussed in Section 13.5.1 and illustrated in Figure
13.6 in the book. The second result, that is, the reason the burst length (in %)
can be longer when the blocksize is longer is, of course, that the time it takes
for the system to settle is determined in seconds (by the system damping), and
thus the longer the block time, the longer the burst length can be, in percent
of the block time without causing leakage. Increasing the blocksize to 4096,
you should see an even better coherence, around 70 to 80 Hz. The difference
is subtle, but it is clear that the blocksize of 2048 is also unsufficient for a
perfect coherence. And since we have no extraneous noise in this Problem,
the coherence should equal unity.
You may ask yourself: are these subtle errors in the coherence really
of any importance or is it just snobbery? The answer is, that these errors
are important to identify in real measurement cases as they result in biased
FRF estimates. In real measurement cases it is usually very clear when the
blocksize is made long enough, that suddenly the coherence goes from a rather
poor state to becoming one over the entire frequency range. Thus you need
to be aware of this type of error and make sure you avoid it!
Problem 13.4. This Problem illustrates the effect of the H1 estimator when

Copyright ©, 2013 Anders Brandt 53


Solutions to Book Problems

N=2048, burst length 60% N=4096, burst length 80%

Displacement [mm]

Displacement [mm]
0.5 0.5
0 0
−0.5 −0.5
0 5 10 0 10 20
Time [s] Time [s]
−2 −2
10 10
FRF [m/N]

FRF [m/N]
−4 −4
10 10
−6 −6
10 10
0 20 40 60 80 0 20 40 60 80
Frequency [Hz] Frequency [Hz]
Coherence [−]

Coherence [−]
1 1

0.995 0.995
0 20 40 60 80 0 20 40 60 80
Frequency [Hz] Frequency [Hz]

Figure 13.2: Plots for Problem 13.3

there is contaminating noise on the measured output signal. The following


lines of code can be used to illustrate the effects. Changing the factor 2e − 3
on the line defining the output noise n, the code can be re-executed.

1 % Define 2DOF system: use a modal model!


2 fr=[12.5 25]; zr=0.02*[1 1];
3 poles=fz2poles(fr,zr);
4 V=[1 1;1 −1];
5 % ABRAVIBE assumes all mode shapes scaled to unity modal A!
6 V=umm2uma(V,poles);
7 fs=200;
8 % We use the blocksize of 4K which was found best in ...
Problem 13.3
9 N=4*1024;
10 x=randn(50*N,1);
11 y=timefresp(x,fs,poles,V,1,1,'d');
12 n=randn(size(y))*2e−3*std(y);
13 y=y+n;
14 [Gxx,Gyx,Gyy,ft]=time2xmtrx(x,y,fs,ahann(N));
15 [Ht,Ct]=xmtrx2frf(Gxx,Gyx,Gyy);
16 Htrue=modal2frf(ft,poles,V,1,1,'d');

Copyright ©, 2013 Anders Brandt 54


Solutions to Book Problems

Problem 13.5. To solve the same example as in Problem 13.4, but with
burst random excitation instead, can be accomplished by the following lines
of code. A special note should be made about the ‘amount’ of noise as specified
in the Problem. The most realistic way to define the noise so that it can be
compared with the results of pure random excitation, is to use the same RMS
level (for the same excitation, level, of course). This can be accomplished if
the script for Problem 13.4 saves the generated noise, or its RMS level, so
that this level can be read by the script for the present problem.

1 % Define 2DOF system: use a modal model!


2 fr=[12.5 25]; zr=0.02*[1 1];
3 poles=fz2poles(fr,zr);
4 V=[1 1;1 −1];
5 V=umm2uma(V,poles); % ABRAVIBE assumes all mode shapes ...
scaled to unity modal A!
6 fs=200;
7 N=4*1024;
8 BurstL=60;
9 x=abrand(N,100,BurstL);
10 y=timefresp(x,fs,poles,V,1,1,'d');
11 % Now add some extraneous noise on the output.
12 load noisen
13 n=randn(size(y))*std(n);
14 y=y+n;
15 [Gxx,Gyx,Gyy,ft]=time2xmtrx(x,y,fs,boxcar(N));
16 [Ht,Ct]=xmtrx2frf(Gxx,Gyx,Gyy);
17 Htrue=modal2frf(ft,poles,V,1,1,'d');

The obvious result, when comparing with pure random excitation, is that the
bias error, causing the coherence to dip around the resonances in the case of
pure random excitation, is not present for burst random. This is a result of
the reduced bias with the latter method. It should be realized, though, that the
bias error can be removed also for pure random excitation, by using a very
long blocksize. Try that in the previous problem!

Problem 13.6. comparing Hanning window with 50 % overlap processing


with the half sine window with 67 % overlap can be used with the code from
Problem 13.2, complemented by the following lines in the spectrum processing.
With a blocksize of 4K the difference is very visible.

1 [Gxx,Gyx,Gyy,f]=time2xmtrx(xt,yt,fs,ahann(Nt));
2 [Hhann,Chann]=xmtrx2frf(Gxx,Gyx,Gyy);
3 [Gxx,Gyx,Gyy,f]=time2xmtrx(xt,yt,fs,hsinew(Nt),67);
4 [Hhsine,Chsine]=xmtrx2frf(Gxx,Gyx,Gyy);

Copyright ©, 2013 Anders Brandt 55


Solutions to Book Problems

Copyright ©, 2013 Anders Brandt 56


Chapter 14

Multiple-input Frequency
Response Measurement

Problem 14.1. It certainly can, although due to the bias error, very large
blocksizes need to be used compared to if self-windowing excitation signals are
used. If the choice is free, burst random is to prefer.

Problem 14.2. We start with the fundamental equation in the frequency


domain for the H2 case

{Y } = [H] ({X} − {M }) .

This equation is multiplied by {Y }H from the right-hand side which results


in  
{Y } {Y }H = [H] {X} {Y }H − {M } {Y }H .
By now taking the expected value of each term and scale properly, we get

[Gyy ] = [H] [Gxy ] − 0

where the zero term comes from the cross-spectral density between signals x
and m, which equals zero because those signals are uncorrelated. Finally, we
can thus obtain the H2 estimator for the frequency response as

[H2 ] = [Gyy ] [Gxy ]−1

which can only be solved if the matrix [Gxy ] is invertible, which means, first
of all, it must be square. Thus the number of inputs must equal the number
of outputs.
As a small sidenote, although the H2 estimator only works when the num-
ber of inputs equals the number of outputs, this does, of course, not limit its

57
Solutions to Book Problems

use to this very rare case. If the system has more outputs than inputs, you
can, of course, divide the outputs into a number of groups, each of which con-
tains as many outputs as there are inputs. Then you can estimate the FRFs
of each set of outputs using the H2 estimator. This estimator, however, still
remains relatively rarely used – perhaps partly due to this hassle.

Problem 14.3. This problem can be solved by using the code below plus some
plotting. It should be noted that with the blocksizes in the code, 2, 4, and 8K,
the peaks of the first mode will all be approximately the same height, so it
seems there is no leakage. Since the excitation is pure random, however, this
does not necessarily work. If you look at the coherence you see that there is
actually a dip in the coherence due to the blocksize being too short. You will
need to increase it to 32K for the dips in the coherence to (almost) disappear.

1 % Define 2DOF system: use a modal model


2 fr=[12.5 25]; zr=0.02*[1 1];
3 poles=fz2poles(fr,zr);
4 V=[1 1;1 −1];
5 V=umm2uma(V,poles); % ABRAVIBE assumes all mode shapes ...
scaled to unity modal A!
6 fs=200;
7 % We use the blocksize of 2, 4, and 8K
8 N=4*1024*[1 2 4]; %
9 % Add pure random noise in both DOFs
10 x=randn(50*N(end),2); % The problem says 100 average: ...
if 50% overlap
11 % Compute the response
12 y=timefresp(x,fs,poles,V,[1:2],[1:2],'d');
13 % Estimate FRFs and coherence for each blocksize
14 for n=1:length(N)
15 Nt=N(n);
16 [Gxx,Gyx,Gyy,ft]=time2xmtrx(x,y,fs,ahann(Nt));
17 [Ht,Ct]=xmtrx2frf(Gxx,Gyx,Gyy);
18 H{n}=Ht;
19 f{n}=ft;
20 C{n}=Ct;
21 end

Problem 14.4. If the code in the previous problem to create the system is
used, the following lines can be used to compute FRFs for some different
burst lengths.

1 BurstLength=[50 70 90];
2 % Estimate FRFs and coherence for each blocksize

Copyright ©, 2013 Anders Brandt 58


Solutions to Book Problems

3 for n=1:length(BurstLength)
4 BL=BurstLength(n);
5 x(:,1)=abrand(N,50,BL);
6 x(:,2)=abrand(N,50,BL);
7 % Compute the response
8 y=timefresp(x,fs,poles,V,[1:2],[1:2],'d');
9 [Gxx,Gyx,Gyy,ft]=time2xmtrx(x,y,fs,boxcar(N));
10 [Ht,Ct]=xmtrx2frf(Gxx,Gyx,Gyy);
11 H{n}=Ht;
12 f{n}=ft;
13 C{n}=Ct;
14 clear x
15 end

Problem 14.5. The following code can be used for the first part of this
Problem (with pure random excitation), assuming the lines defining the sys-
tem in Problem 14.3 have been entered already. Increasing the noise level
by increasing the factor 2e-5 in the code below, you will see the coherence be
increasingly affected, particularly at the high frequencies where the response
is low (because the noise n has constant spectral density).

1 N=16*1024; %
2 % Add pure random noise in both DOFs
3 x=randn(50*N(end),2); % The problem says 100 average: ...
if 50% overlap
4 % Compute the response
5 y=timefresp(x,fs,poles,V,[1:2],[1:2],'d');
6 n=randn(size(y))*2e−5*std(y(:,1));
7 y=y+n;
8 RMSn=std(n(:,1));
9 save noise14.5a RMSn
10 % Estimate FRFs and coherence for each blocksize
11 [Gxx,Gyx,Gyy,f]=time2xmtrx(x,y,fs,ahann(N));
12 [H,C]=xmtrx2frf(Gxx,Gyx,Gyy);

For burst random, the following lines can be used. You should rerun the
first lines and then the following lines after changing the noise levels. With
smaller burst length the signal-to-noise ratio is poorer, which causes a poorer
coherence.

1 N=4*1024; % This is enough for burst random


2 BurstLength=[50 70 90];
3 % Estimate FRFs and coherence for each blocksize
4 for nl=1:length(BurstLength)
5 BL=BurstLength(nl);

Copyright ©, 2013 Anders Brandt 59


Solutions to Book Problems

6 x(:,1)=abrand(N,50,BL);
7 x(:,2)=abrand(N,50,BL);
8 % Compute the response
9 y=timefresp(x,fs,poles,V,[1:2],[1:2],'d');
10 load('noise14.5a','−mat')
11 n=randn(size(y))*RMSn;
12 y=y+n;
13 [Gxx,Gyx,Gyy,ft]=time2xmtrx(x,y,fs,boxcar(N));
14 [Ht,Ct]=xmtrx2frf(Gxx,Gyx,Gyy);
15 H{nl}=Ht;
16 f{nl}=ft;
17 C{nl}=Ct;
18 clear x
19 end

Copyright ©, 2013 Anders Brandt 60


Chapter 15

Orthogonalization of Signals

Problem 15.1. This Problem can be solved using the following code.

1 % Define two random signals


2 x=randn(102400,3);
3 % Compute cross−spectral density matrix
4 [Gxx,f]=acsdw(x,x,100,ahann(1024));
5 % PCs by eigenvalues
6 PCeig=zeros(length(f),3);
7 tic
8 for n=1:length(f)
9 Gxxt=squeeze(Gxx(n,:,:));
10 E=real(eig(Gxxt));
11 E=sort(E,'descend');
12 PCeig(n,:)=E;
13 end
14 Teig=toc
15 % PCs by SVD
16 PCsvd=zeros(length(f),3);
17 tic
18 for n=1:length(f)
19 Gxxt=squeeze(Gxx(n,:,:));
20 S=svd(Gxxt);
21 PCsvd(n,:)=S;
22 end
23 M=max(PCeig−PCsvd)

The two loops take approximately the same time, with a slight advantage for
the SVD method. This is due to the extra sort command necessary for the eig
solution. The difference is in the order of 10−16 , i.e. only roundoff errors.
The two methods give ‘ identical’ results.

Problem 15.2. This problem can be solved by the following lines of code.

61
Solutions to Book Problems

1 % Define two random signals and the output


2 x=randn(102400,2);
3 y=x(:,1)+x(:,2);
4 % Compute cross−spectral density matrix
5 [Gxx,Gyx,Gyy,f]=time2xmtrx(x,y,800,ahann(1024));
6 % PCs
7 PC=apcax(Gxx);
8 figure
9 semilogy(f,PC)
10 xlabel('Frequency [Hz]')
11 ylabel('Principal components')
12 % Virtual coherence
13 % Start by cumulated virtual coherence as it is included ...
in ABRAVIBE
14 CVCyx = apcaxy(Gxx,Gyx,Gyy);
15 % Split the two cumulated into separate virt. coherences
16 VC(:,1)=CVCyx(:,1);
17 VC(:,2)=CVCyx(:,2)−CVCyx(:,1);
18 hf=figure;
19 plot(f,VC)
20 xlabel('Frequency [Hz]')
21 ylabel('Virtual Coherence')

The virtual coherence looks ‘weird’, either the one or the other virtual coher-
ence is unity and the other one zero at most frequencies. The reason for this
is, that the principle of principal components is to put the source with maxi-
mum energy at each frequency into the first principal component, etc. In this
case, however, the energy in both sources is equal, and thus it is arbitrary at
each frequency which one ‘wins’. This hardly happens in real life but is still
good to reflect over, if nothing else for demystifying the concept of principal
components.

Copyright ©, 2013 Anders Brandt 62


Chapter 16

Advanced Analysis Methods

Problem 16.1. This Problem can be solved by the following code. The re-
sulting shock response spectra should look like those in Figure 16.1

1 fs=2000;
2 f0=2400/60;
3 t=(0:1/fs:1);
4 % Define the periodic signal. Assume "vibration levels" ...
means RMS levels.
5 % It should have been specified in the Problem, see errata ...
list.
6 xp=1/sqrt(2)*(2*sin(2*pi*2*f0*t)+...
7 sin(2*pi*4*f0*t)+0.5*sin(2*pi*6*f0*t));
8 % Compute shock
9 xs=makepulse(length(t),fs,20e−3,'halfsine');
10 xs=20*xs/max(xs);
11 % Compute SRS of each
12 [Sxp,f]=asrs(xp,fs,5,800,200,10);
13 Sxs=asrs(xs,fs,5,800,200,10);
14 loglog(f,Sxp,f,Sxs)

Apparently the shock is much more severe than the periodic signal.

Problem 16.2. This Problem is losely defined when it comes to the shape etc.
of the pulses. But it is not unrealistic so produce half-sine shaped pulses. If
we use that, the following code produces the envelope spectrum. By adjusting
the bandwidth B variable, different numbers of harmonics can be included.

1 % Define the periodic signal with one pulse per ...


revolution. Assume a
2 % half−sine pulse shape with a width not specified in the ...
Problem so we

63
Solutions to Book Problems

2
10

Shock Response [g] maximax

1
10

0
10

−1
10
0 1 2 3
10 10 10 10
Frequency [Hz]

Figure 16.1: Plot of shock response spectra for Problem 16.1

3 % need to make it up. say the fault takes up 5 degrees of ...


the rotation,
4 % then the duration is approximately 1/(20*18) seconds.
5 fs=10000;
6 f0=1200/60;
7 tp=1/20/18;
8 t=(0:1/fs:1/20−1/fs); % One period of the shaft
9 % Define the force as the periodic repetition of the pulses
10 p=makepulse(length(t),fs,tp,'halfsine');
11 p=100*p/max(p);
12 F=[];
13 for n=1:5/t(end);
14 F=[F;p];
15 end
16 F=F−mean(F);
17 % Now define the SDOF system and excite it by the force
18 M=200;
19 K=(2*pi*400)^2*M;
20 C=2*0.05*sqrt(M*K);
21 y=timefresp(F,fs,M,C,K,1,1,'a');
22 t=makexaxis(y,1/fs);
23 % Compute envelope spectrum

Copyright ©, 2013 Anders Brandt 64


Solutions to Book Problems

24 B=100;
25 [E,f]=aenvspec(y,fs,16*1024,400,B);

Problem 16.3. The power cepstrum can be computed by the following lines
of code, provided the signal y is already defined as in Problem 16.2. The
cepstrum shows a clear peak at the quefrency 0.05, corresponding to the RPM
of 20 Hz (1200 RPM).

1 % Compute power cepstrum


2 [Gxx,f]=alinspec(y,fs,ahann(16*1024));
3 Sxx=fnegfreq(Gxx,'fft');
4 Pceps=abs(ifft(log(Sxx)));
5 Pceps(1)=0;
6 Pceps=Pceps(1:end/2+1);
7 t=makexaxis(Pceps,1/fs);

Problem 16.4. This Problem can be solved using the ABRAVIBE toolbox
command psd2time. The following lines of code will produce the requested
signal.

1 fs=2000;
2 N=2000; % Gives 1 Hz resolution
3 f=(0:fs/N:fs/2);
4 P=zeros(length(f),1);
5 P(1:400)=1;
6 P(401:600)=10;
7 P(601:end)=1;
8 P=400*P/(f(2)*sum(P));
9 y=psd2time(P,f,100*N);
10 Gyy=apsdw(y,fs,N);

Copyright ©, 2013 Anders Brandt 65


Solutions to Book Problems

Copyright ©, 2013 Anders Brandt 66


Bibliography

[1] A. Brandt. Noise and Vibration Analysis – Signal Analysis and Experi-
mental Procedures. John Wiley and Sons, 2011.

67

Вам также может понравиться