Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

modalfit

Modal parameters from frequency-response functions

Syntax

fn = modalfit(frf,f,fs,mnum)
fn = modalfit(frf,f,fs,mnum,Name,Value)
[fn,dr,ms] = modalfit(___)
[fn,dr,ms,ofrf] = modalfit(___)
[___] = modalfit(sys,f,mnum,Name,Value)

Description

example

fn = modalfit(frf,f,fs,mnum) estimates the natural frequencies of mnum modes of a system with measured frequency-response functions frf defined at frequencies f and for a sample rate fs.

example

fn = modalfit(frf,f,fs,mnum,Name,Value) specifies additional options using name-value pair arguments.

example

[fn,dr,ms] = modalfit(___) also returns the damping ratios and mode-shape vectors corresponding to each natural frequency in fn, using any combination of inputs from previous syntaxes.

example

[fn,dr,ms,ofrf] = modalfit(___) also returns a reconstructed frequency-response function array based on the estimated modal parameters.

[___] = modalfit(sys,f,mnum,Name,Value) estimates the modal parameters of the identified model sys. Use estimation commands like ssest or tfest to create sys starting from a measured frequency-response function or from time-domain input and output signals. This syntax allows use of the 'DriveIndex', 'FreqRange', and 'PhysFreq' name-value pair arguments. It typically requires less data than syntaxes that use nonparametric methods. You must have a System Identification Toolbox™ license to use this syntax.

Examples

collapse all

Estimate the frequency-response function for a simple single-input/single-output system and compare it to the definition.

A one-dimensional discrete-time oscillating system consists of a unit mass, , attached to a wall by a spring with elastic constant . A sensor samples the displacement of the mass at Hz. A damper impedes the motion of the mass by exerting on it a force proportional to speed, with damping constant .

Generate 3000 time samples. Define the sampling interval .

Fs = 1;
dt = 1/Fs;
N = 3000;
t = dt*(0:N-1);
b = 0.01;

The system can be described by the state-space model

where is the state vector, and are respectively the displacement and velocity of the mass, is the driving force, and is the measured output. The state-space matrices are

is the identity, and the continuous-time state-space matrices are

Ac = [0 1;-1 -b];
A = expm(Ac*dt);

Bc = [0;1];
B = Ac\(A-eye(2))*Bc;

C = [1 0];
D = 0;

The mass is driven by random input for the first 2000 seconds and then left to return to rest. Use the state-space model to compute the time evolution of the system starting from an all-zero initial state. Plot the displacement of the mass as a function of time.

rng default
u = randn(1,N)/2;
u(2001:end) = 0;

y = 0;
x = [0;0];
for k = 1:N
    y(k) = C*x + D*u(k);
    x = A*x + B*u(k);
end

plot(t,y)

Estimate the modal frequency-response function of the system. Use a Hann window half as long as the measured signals. Specify that the output is the displacement of the mass.

wind = hann(N/2);

[frf,f] = modalfrf(u',y',Fs,wind,'Sensor','dis');

The frequency-response function of a discrete-time system can be expressed as the Z-transform of the time-domain transfer function of the system, evaluated at the unit circle. Compare the modalfrf estimate with the definition.

[b,a] = ss2tf(A,B,C,D);

nfs = 2048;
fz = 0:1/nfs:1/2-1/nfs;
z = exp(2j*pi*fz);
ztf = polyval(b,z)./polyval(a,z);

plot(f,20*log10(abs(frf)))
hold on
plot(fz*Fs,20*log10(abs(ztf)))
hold off
grid
ylim([-60 40])

Estimate the natural frequency and the damping ratio for the vibration mode.

[fn,dr] = modalfit(frf,f,Fs,1,'FitMethod','PP')
fn = 0.1593
dr = 0.0043

Compare the natural frequency to , which is the theoretical value for the undamped system.

theo = 1/(2*pi)
theo = 0.1592

Compute the modal parameters of a Space Station module starting from its frequency-response function (FRF) array.

Load a structure containing the three-input/three-output FRF array. The system is sampled at 320 Hz.

load modaldata SpaceStationFRF

frf = SpaceStationFRF.FRF;
f = SpaceStationFRF.f;
fs = SpaceStationFRF.Fs;

Extract the modal parameters of the lowest 24 modes using the least-squares rational function method.

[fn,dr,ms,ofrf] = modalfit(frf,f,fs,24,'FitMethod','lsrf');

Compare the reconstructed FRF array to the measured one.

for ij = 1:3
 for ji = 1:3
    subplot(3,3,3*(ij-1)+ji)
    loglog(f,abs(frf(:,ji,ij)))
    hold on
    loglog(f,abs(ofrf(:,ji,ij)))
    hold off
    axis tight
    title(sprintf('In%d -> Out%d',ij,ji))
    if ij==3
        xlabel('Frequency (Hz)')
    end
 end
end

Estimate the frequency-response function and modal parameters of a simple multi-input/multi-output system.

An ideal one-dimensional oscillating system consists of two masses, and , confined between two walls. The units are such that and . Each mass is attached to the nearest wall by a spring with an elastic constant . An identical spring connects the two masses. Three dampers impede the motion of the masses by exerting on them forces proportional to speed, with damping constant . Sensors sample and , the displacements of the masses, at Hz.

Generate 30000 time samples, equivalent to 600 seconds. Define the sampling interval .

Fs = 50;
dt = 1/Fs;
N = 30000;
t = dt*(0:N-1);

The system can be described by the state-space model

where is the state vector, and are respectively the location and the velocity of the th mass, is the vector of input driving forces, and is the output vector. The state-space matrices are

is the identity, and the continuous-time state-space matrices are

Set , , and .

k = 400;
b = 0.1;
m = 1/10;

Ac = [0 1 0 0;-2*k -2*b k b;0 0 0 1;k/m b/m -2*k/m -2*b/m];
A = expm(Ac*dt);
Bc = [0 0;1 0;0 0;0 1/m];
B = Ac\(A-eye(4))*Bc;
C = [1 0 0 0;0 0 1 0];
D = zeros(2);

The masses are driven by random input throughout the measurement. Use the state-space model to compute the time evolution of the system starting from an all-zero initial state.

rng default
u = randn(2,N);

y = [0;0];
x = [0;0;0;0];
for kk = 1:N
    y(:,kk) = C*x + D*u(:,kk);
    x = A*x + B*u(:,kk);
end

Use the input and output data to estimate the transfer function of the system as a function of frequency. Use a 5000-sample Hann window with 3000 samples of overlap between adjoining segments. Specify that the measured outputs are displacements.

wind = hann(15000);
nove = 9000;
[FRF,f] = modalfrf(u',y',Fs,wind,nove,'Sensor','dis');

Compute the theoretical transfer function as the Z-transform of the time-domain transfer function, evaluated at the unit circle.

nfs = 2048;
fz = 0:1/nfs:1/2-1/nfs;
z = exp(2j*pi*fz);

[b1,a1] = ss2tf(A,B,C,D,1);
[b2,a2] = ss2tf(A,B,C,D,2);

frf(1,:,1) = polyval(b1(1,:),z)./polyval(a1,z);
frf(1,:,2) = polyval(b1(2,:),z)./polyval(a1,z);
frf(2,:,1) = polyval(b2(1,:),z)./polyval(a2,z);
frf(2,:,2) = polyval(b2(2,:),z)./polyval(a2,z);

Plot the estimates and overlay the theoretical predictions.

for jk = 1:2
    for kj = 1:2
        subplot(2,2,2*(jk-1)+kj)
        plot(f,20*log10(abs(FRF(:,jk,kj))))
        hold on
        plot(fz*Fs,20*log10(abs(frf(jk,:,kj))))
        hold off
        axis([0 Fs/2 -100 0])
        title(sprintf('Input %d, Output %d',jk,kj))
    end
end

Plot the estimates by using the syntax of modalfrf with no output arguments.

figure
modalfrf(u',y',Fs,wind,nove,'Sensor','dis')

Estimate the natural frequencies, damping ratios, and mode shapes of the system. Use the peak-picking method for the calculation.

[fn,dr,ms] = modalfit(FRF,f,Fs,2,'FitMethod','pp');
fn
fn = 
fn(:,:,1) =

    3.8466    3.8466
    3.8495    3.8495


fn(:,:,2) =

    3.8492    3.8490
    3.8552   14.4684

Compare the natural frequencies to the theoretical predictions for the undamped system.

undamped = sqrt(eig([2*k -k;-k/m 2*k/m]))/2/pi
undamped = 

    3.8470
   14.4259

Compute the natural frequencies, the damping ratios, and the mode shapes for a two-input/three-output system excited by several bursts of random noise. Each burst lasts for 1 second, and there are 2 seconds between the end of each burst and the start of the next. The data are sampled at 4 kHz.

Load the data file. Plot the input signals and the output signals.

load modaldata

subplot(2,1,1)
plot(Xburst)
title('Input Signals')
subplot(2,1,2)
plot(Yburst)
title('Output Signals')

Compute the frequency-response functions. Specify a rectangular window with length equal to the burst period and no overlap between adjoining segments.

burstLen = 12000;
[frf,f] = modalfrf(Xburst,Yburst,fs,burstLen);

Visualize a stabilization diagram and return the stable natural frequencies. Specify a maximum model order of 30 modes.

figure
modalsd(frf,f,fs,'MaxModes',30);

Zoom in on the plot. The averaged response function has maxima at 373 Hz, 852 Hz, and 1371 Hz, which correspond to the physical frequencies of the system. Save the maxima to a variable.

phfr = [373 852 1371];

Compute the modal parameters using the least-squares complex exponential (LSCE) algorithm. Specify a model order of 6 modes and specify physical frequencies for the 3 modes determined from the stabilization diagram. The function generates one set of natural frequencies and damping ratios for each input reference.

[fn,dr,ms,ofrf] = modalfit(frf,f,fs,6,'PhysFreq',phfr);

Plot the reconstructed frequency-response functions and compare them to the original ones.

for k = 1:2
    for m = 1:3
        subplot(2,3,m+3*(k-1))
        plot(f/1000,10*log10(abs(frf(:,m,k))))
        hold on
        plot(f/1000,10*log10(abs(ofrf(:,m,k))))
        hold off
        text(1,-50,[['Output ';' Input '] num2str([m k]')])
        ylim([-100 -40])
    end
end
subplot(2,3,2)
title('Frequency-Response Functions')

Input Arguments

collapse all

Frequency-response functions, specified as a vector, matrix, or 3-D array. frf has size p-by-m-by-n, where p is the number of frequency bins, m is the number of response signals, and n is the number of excitation signals used to estimate the transfer function.

Example: tfestimate(randn(1,1000),sin(2*pi*(1:1000)/4)+randn(1,1000)/10) approximates the frequency response of an oscillator.

Data Types: single | double
Complex Number Support: Yes

Frequencies, specified as a vector. The number of elements of f must equal the number of rows of frf.

Data Types: single | double

Sample rate of measurement data, specified as a positive scalar expressed in hertz.

Data Types: single | double

Number of modes, specified as a positive integer.

Data Types: single | double

Identified system, specified as a model with identified parameters. Use estimation commands like ssest, n4sid, or tfest to create sys starting from a measured frequency-response function or from time-domain input and output signals. See Modal Analysis of Identified Models for an example. You must have a System Identification Toolbox license to use this input argument.

Example: idss([0.5418 0.8373;-0.8373 0.5334],[0.4852;0.8373],[1 0],0,[0;0],[0;0],1) generates an identified state-space model corresponding to a unit mass attached to a wall by a spring of unit elastic constant and a damper with constant 0.01. The displacement of the mass is sampled at 1 Hz.

Example: idtf([0 0.4582 0.4566],[1 -1.0752 0.99],1) generates an identified transfer-function model corresponding to a unit mass attached to a wall by a spring of unit elastic constant and a damper with constant 0.01. The displacement of the mass is sampled at 1 Hz.

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: 'FitMethod','pp','FreqRange',[0 500] uses the peak-picking method to perform the fit and restricts the frequency range to between 0 and 500 Hz.

collapse all

Presence of feedthrough in estimated transfer function, specified as the comma-separated pair consisting of 'Feedthrough' and a logical value. This argument is available only if 'FitMethod' is specified as 'lsrf'.

Data Types: logical

Fitting algorithm, specified as the comma-separated pair consisting of 'FitMethod' and 'lsce', 'lsrf', or 'pp'.

Data Types: char

Frequency range, specified as the comma-separated pair consisting of 'FreqRange' and a two-element vector of increasing positive values contained within the range specified in f.

Data Types: single | double

Natural frequencies for physical modes to include in the analysis, specified as the comma-separated pair consisting of 'PhysFreq' and a vector of frequency values within the range spanned by f. The function includes in the analysis those modes with natural frequencies closest to the values specified in the vector. If the vector contains m frequency values, then fn and dr have m rows each, and ms has m columns. If you do not specify this argument, then the function uses the entire frequency range in f.

Data Types: single | double

Indices of the driving-point frequency-response function, specified as the comma-separated pair consisting of 'DriveIndex' and a two-element vector of positive integers. The first element of the vector must be less than or equal to the number of system responses. The second element of the vector must be less than or equal to the number of system excitations. Mode shapes are normalized to unity modal based on the driving point.

Example: 'DriveIndex',[2 3] specifies that the driving-point frequency-response function is frf(:,2,3).

Data Types: single | double

Output Arguments

collapse all

Natural frequencies, returned as a matrix or 3-D array. The size of fn depends on the choice of fitting algorithm specified with 'FitMethod':

  • If you specify 'lsce' or 'lsrf', then fn is a vector with mnum elements, independent of the size of frf. If the system has more than mnum oscillatory modes, then the 'lsrf' method returns the first mnum least-damped modes sorted in order of increasing natural frequency.

  • If you specify 'pp', then fn is an array of size mnum-by-m-by-n with one estimate of fn and one estimate of dr per frf.

Damping ratios for the natural frequencies in fn, returned as a matrix or 3-D array of the same size as fn.

Mode-shape vectors, returned as a matrix. ms has mnum columns, each containing a mode-shape vector of length q, where q is the larger of the number of excitation channels and the number of response channels.

Reconstructed frequency-response functions, returned as a vector, matrix, or 3-D array with the same size as frf.

Algorithms

collapse all

Least-Squares Complex Exponential Method

The least-squares complex exponential method computes the impulse response corresponding to each frequency-response function and fits to the response a set of complex damped sinusoids using Prony’s method.

A sampled damped sinusoid can be cast in the form

si(n)=Aiebin/fscos(2πfin/fs+ϕi)=12Aiejϕiexp((bi/fsj2πfi/fs)n)+12Aiejϕiexp((bi/fs+j2πfi/fs)n)ai+xi+n+aixin,

where:

  • fs is the sample rate.

  • fi is the sinusoid frequency.

  • bi is the damping coefficient.

  • Ai and ϕi are the amplitude and phase of the sinusoid.

The ai are called amplitudes and the xi are called poles. Prony’s method expresses a sampled function h(n) as a superposition of N/2 modes (and thus N amplitudes and poles):

h(0)=a1x10+a2x20+aNxN0h(1)=a1x11+a2x21++aNxN1h(N1)=a1x1N1+a2x2N1++aNxNN1.

The poles are the roots of a polynomial with coefficients c0c1, …, cN–1:

xiN+cN1xiN1++c1xi1+c0xi0=0.

The coefficients are found using an autoregressive model of L = 2N samples of h:

[h(0)h(1)h(N1)h(1)h(2)h(N)h(LN1)h(LN)h(L2)][c0c1cN1]=[h(N)h(N+1)h(L1)].

To find the poles, the algorithm uses the roots function. Once the poles are known, it is possible to determine the frequencies and damping factors by identifying the imaginary and real parts of the pole logarithms. The final step is solving for the amplitudes and reconstructing the impulse response using

[h(0)h(N1)]=[x10xN0x1N1xNN1][a1aN].

The following naive MATLAB® implementation summarizes the procedure:
N = 4;
L = 2*N;
h = rand(L,1);
c = hankel(h(1:N),h(L-N:L-1))\-h(N+1:L);
x = roots([1;c(N:-1:1)]).';
p = log(x);
hrec = x.^((0:L-1)')*(x.^((0:L-1)')\h(1:L));
sum(h-hrec)
ans =

   3.2613e-15 - 1.9297e-16i
The system can also be constructed to contain samples from multiple frequency-response functions and solved using least squares.

Peak-Picking Method

The peak-picking method assumes that each significant peak in the frequency-response function corresponds to exactly one natural mode. Close to a peak, the system is assumed to behave like a one-degree-of-freedom damped harmonic oscillator:

H(f)=1(2π)21/mf2+j2ζrfrf+fr2H(f)fr2+j2ζrfrfH(f)1(2π)2m=f2H(f),

where H is the frequency-response function, fr is the undamped resonance frequency, ζr = b/(4mk)1/2 is the relative damping, b is the damping constant, k is the elastic constant, and m is the mass.

Given a peak located at fp, the procedure takes the peak and a fixed number of points to either side, replaces the mass term with a dummy variable, d, and computes the modal parameters by solving the system of equations

[H(fpk)j2fpkH(fpk)1H(fp)j2fpH(fp)1H(fp+k)j2fp+kH(fp+k)1][fr2ζrfrd]=[fpk2H(fpk)fp2H(fp)fp+k2H(fp+k)].

References

[1] Allemang, Randall J., and David L. Brown. “Experimental Modal Analysis and Dynamic Component Synthesis, Vol. III: Modal Parameter Estimation.” Technical Report AFWAL-TR-87-3069. Air Force Wright Aeronautical Laboratories, Wright-Patterson Air Force Base, OH, December 1987.

[2] Brandt, Anders. Noise and Vibration Analysis: Signal Analysis and Experimental Procedures. Chichester, UK: John Wiley & Sons, 2011.

[3] Ozdemir, Ahmet Arda, and Suat Gumussoy. "Transfer Function Estimation in System Identification Toolbox via Vector Fitting." Proceedings of the 20th World Congress of the International Federation of Automatic Control, Toulouse, France, July 2017.

See Also

| | | |

Topics

Introduced in R2017a

Was this topic helpful?