%% Frequency-Response Function Using Subspace Method
% Compute the frequency-response function of a two-input/six-output data set corresponding to a steel frame.
%
% Load a structure containing the input excitations and the output accelerometer measurements. The system is sampled at 1024 Hz for about 3.9 seconds.

load modaldata SteelFrame
X = SteelFrame.Input;
Y = SteelFrame.Output;
fs = SteelFrame.Fs;

%
% Use the subspace method to compute the frequency-response functions. Divide the input and output signals into nonoverlapping, 1000-sample segments. Window each segment using a rectangular window. Specify a model order of 36.

[frf,f] = modalfrf(X,Y,fs,1000,'Estimator','subspace','Order',36);

% Visualize the stabilization diagram for the system. Identify up to 15 physical modes.

modalsd(frf,f,fs,'MaxModes',15)

% Copyright 2012 The MathWorks, Inc.