nass-micro-station-measurem.../modal-analysis/measurement.org

652 lines
24 KiB
Org Mode
Raw Normal View History

#+TITLE: Modal Analysis - Measurement
:DRAWER:
#+STARTUP: overview
#+LANGUAGE: en
#+EMAIL: dehaeze.thomas@gmail.com
#+AUTHOR: Dehaeze Thomas
#+HTML_LINK_HOME: ../index.html
#+HTML_LINK_UP: ./index.html
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="../css/htmlize.css"/>
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="../css/readtheorg.css"/>
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="../css/zenburn.css"/>
#+HTML_HEAD: <script type="text/javascript" src="../js/jquery.min.js"></script>
#+HTML_HEAD: <script type="text/javascript" src="../js/bootstrap.min.js"></script>
#+HTML_HEAD: <script type="text/javascript" src="../js/jquery.stickytableheaders.min.js"></script>
#+HTML_HEAD: <script type="text/javascript" src="../js/readtheorg.js"></script>
#+HTML_MATHJAX: align: center tagside: right font: TeX
#+PROPERTY: header-args:matlab :session *MATLAB*
#+PROPERTY: header-args:matlab+ :comments org
#+PROPERTY: header-args:matlab+ :results none
#+PROPERTY: header-args:matlab+ :exports both
#+PROPERTY: header-args:matlab+ :eval no-export
#+PROPERTY: header-args:matlab+ :output-dir figs
#+PROPERTY: header-args:matlab+ :tangle matlab/modal_frf_coh.m
#+PROPERTY: header-args:matlab+ :mkdirp yes
#+PROPERTY: header-args:shell :eval no-export
:END:
* ZIP file containing the data and matlab files :ignore:
#+begin_src bash :exports none :results none
if [ matlab/modal_frf_coh.m -nt data/modal_frf_coh.zip ]; then
cp matlab/modal_frf_coh.m modal_frf_coh.m;
zip data/modal_frf_coh \
mat/meas_raw_1.mat \
mat/meas_frf_coh_*.mat \
mat/id31_nanostation.cfg \
modal_frf_coh.m
rm modal_frf_coh.m;
fi
#+end_src
#+begin_note
All the files (data and Matlab scripts) are accessible [[file:data/modal_frf_coh.zip][here]].
#+end_note
* Matlab Init :noexport:ignore:
#+begin_src matlab :tangle no :exports none :results silent :noweb yes :var current_dir=(file-name-directory buffer-file-name)
<<matlab-dir>>
#+end_src
#+begin_src matlab :exports none :results silent :noweb yes
<<matlab-init>>
#+end_src
* Instrumentation Used
In order to perform to *Modal Analysis* and to obtain first a *Response Model*, the following devices are used:
- An *acquisition system* (OROS) with 24bits ADCs (figure [[fig:oros]])
- 3 tri-axis *Accelerometers* (figure [[fig:accelero_M393B05]]) with parameters shown on table [[tab:accelero_M393B05]]
- An *Instrumented Hammer* with various Tips (figure [[fig:instrumented_hammer]]) (figure [[fig:hammer_tips]])
#+name: fig:oros
#+caption: Acquisition system: OROS
#+attr_html: :width 500px
[[file:img/instrumentation/oros.png]]
The acquisition system permits to auto-range the inputs (probably using variable gain amplifiers) the obtain the maximum dynamic range.
This is done before each measurement.
Anti-aliasing filters are also included in the system.
#+name: fig:accelero_M393B05
#+caption: Accelerometer used: M393B05
#+attr_html: :width 500px
[[file:img/instrumentation/accelero_M393B05.png]]
#+name: tab:accelero_M393B05
#+caption: 393B05 Accelerometer Data Sheet
| Sensitivity | 10V/g |
| Measurement Range | 0.5 g pk |
| Broadband Resolution | 0.000004 g rms |
| Frequency Range | 0.7 to 450Hz |
| Resonance Frequency | > 2.5kHz |
Tests have been conducted to determine the most suitable Hammer tip.
This has been found that the softer tip gives the best results.
It excites more the low frequency range where the coherence is low, the overall coherence was improved.
#+name: fig:instrumented_hammer
#+caption: Instrumented Hammer
#+attr_html: :width 500px
[[file:img/instrumentation/instrumented_hammer.png]]
#+name: fig:hammer_tips
#+caption: Hammer tips
#+attr_html: :width 500px
[[file:img/instrumentation/hammer_tips.png]]
The accelerometers are glued on the structure.
* Structure Preparation and Test Planning
** Structure Preparation
All the stages are turned ON.
This is done for two reasons:
- Be closer to the real dynamic of the station in used
- If the control system of stages are turned OFF, this would results in very low frequency modes un-identifiable with the current setup, and this will also decouple the dynamics which would not be the case in practice
This is critical for the translation stage and the spindle as their is no stiffness in the free DOF (air-bearing for the spindle for instance).
The alternative would have been to mechanically block the stages with screws, but this may result in changing the modes.
The stages turned ON are:
- Translation Stage
- Tilt Stage
- Spindle and Slip-Ring
- Hexapod
The top part representing the NASS and the sample platform have been removed in order to reduce the complexity of the dynamics and also because this will be further added in the model inside Simscape.
All the stages are moved to their zero position (Ty, Ry, Rz, Slip-Ring, Hexapod).
All other elements have been remove from the granite such as another heavy positioning system.
** Test Planing
The goal is to identify the full $N \times N$ FRF matrix (where $N$ is the number of degree of freedom of the system).
However, the principle of reciprocity states that:
\[ H_{jk} = \frac{X_j}{F_k} = H_{kj} = \frac{X_k}{F_j} \]
Thus, only one column or one line of the matrix has to be identified.
Either we choose to identify $\frac{X_k}{F_i}$ or $\frac{X_i}{F_k}$ for any chosen $k$ and for $i = 1,\ ...,\ N$.
We here choose to identify $\frac{X_i}{F_k}$ for practical reasons:
- it is easier to glue the accelerometers on some stages than to excite this particular stage with the Hammer
The measurement thus consists of:
- always excite the structure at the same location with the Hammer
- Move the accelerometers to measure all the DOF of the structure
** Location of the Accelerometers
4 tri-axis accelerometers are used for each solid body.
Only 2 could have been used as only 6DOF have to be measured, however, we have chosen to have some *redundancy*.
This could also help us identify measurement problems or flexible modes is present.
The position of the accelerometers are:
- 4 on the first granite
- 4 on the second granite (figure [[fig:accelerometers_granite2_overview]])
- 4 on top of the translation stage (figure [[fig:accelerometers_ty_overview]])
- 4 on top of the tilt stage
- 3 on top of the spindle
- 4 on top of the hexapod (figure [[fig:accelerometers_hexa_overview]])
In total, 23 accelerometers are used: *69 DOFs are thus measured*.
The position and orientation of all the accelerometers used are shown on figure [[fig:nass-modal-test]].
The precise determination of the position of each accelerometer is done using the SolidWorks model (shown on figure [[fig:location_accelerometers]]).
#+name: fig:accelerometers_granite2_overview
#+caption: Accelerometers located on the top granite
#+attr_html: :width 500px
[[file:img/accelerometers/accelerometers_granite2_overview.jpg]]
#+name: fig:accelerometers_ty_overview
#+caption: Accelerometers located on top of the translation stage
#+attr_html: :width 500px
[[file:img/accelerometers/accelerometers_ty_overview.jpg]]
#+name: fig:accelerometers_hexa_overview
#+caption: Accelerometers located on the Hexapod
#+attr_html: :width 500px
[[file:img/accelerometers/accelerometers_hexa_overview.jpg]]
#+name: fig:nass-modal-test
#+caption: Position and orientation of the accelerometer used
#+attr_html: :width 800px
[[file:figs/nass-modal-test.png]]
#+name: fig:location_accelerometers
#+caption: Position of the accelerometers using SolidWorks
#+attr_html: :width 800px
[[file:img/location_accelerometers.png]]
The precise position of all the 23 accelerometer with respect to a frame located at the point of interest (located 270mm above the top platform of the hexapod) is shown below. The values are in meter.
They are contained in the =mat/id31_nanostation.cfg= file.
#+begin_src bash :exports results :eval no-export :post addhdr(*this*)
echo " ID X[m] Y[m] Z[m]"
cat mat/id31_nanostation.cfg | grep NODES -A 23 | sed '/\s\+[0-9]\+/!d' | sed 's/\(.*\)\s\+0\s\+.\+/\1/' | tac --
#+end_src
#+RESULTS:
| ID | X[m] | Y[m] | Z[m] |
|----+--------------+--------------+--------------|
| 1 | -6.4000e-002 | -6.4000e-002 | -2.7000e-001 |
| 2 | -6.4000e-002 | 6.4000e-002 | -2.7000e-001 |
| 3 | 6.4000e-002 | 6.4000e-002 | -2.7000e-001 |
| 4 | 6.4000e-002 | -6.4000e-002 | -2.7000e-001 |
| 5 | -3.8500e-001 | -3.0000e-001 | -4.1680e-001 |
| 6 | -4.2000e-001 | 2.8000e-001 | -4.1680e-001 |
| 7 | 4.2000e-001 | 2.8000e-001 | -4.1680e-001 |
| 8 | 3.8000e-001 | -3.0000e-001 | -4.1680e-001 |
| 9 | -4.7500e-001 | -4.1400e-001 | -4.2730e-001 |
| 10 | -4.6500e-001 | 4.0700e-001 | -4.2730e-001 |
| 11 | 4.7500e-001 | 4.2400e-001 | -4.2730e-001 |
| 12 | 4.7500e-001 | -4.1900e-001 | -4.2730e-001 |
| 13 | -3.2000e-001 | -4.4600e-001 | -7.8560e-001 |
| 14 | -4.8000e-001 | 5.3400e-001 | -7.8560e-001 |
| 15 | 4.5000e-001 | 5.3400e-001 | -7.8560e-001 |
| 16 | 2.9500e-001 | -4.8100e-001 | -7.8560e-001 |
| 17 | -7.3000e-001 | -5.2600e-001 | -9.5060e-001 |
| 18 | -7.3500e-001 | 8.1400e-001 | -9.5060e-001 |
| 19 | 8.7500e-001 | 7.9900e-001 | -9.5060e-001 |
| 20 | 8.6490e-001 | -5.0600e-001 | -9.5060e-001 |
| 21 | -1.5500e-001 | -9.0000e-002 | -5.9400e-001 |
| 22 | 0.0000e+000 | 1.8000e-001 | -5.9400e-001 |
| 23 | 1.5500e-001 | -9.0000e-002 | -5.9400e-001 |
** Hammer Impacts
Only 3 impact points are used.
The impact points are shown on figures [[fig:hammer_x]], [[fig:hammer_y]] and [[fig:hammer_z]].
We chose this excitation point as it seems to excite all the modes in the frequency band of interest and because it provides good coherence for all the accelerometers.
#+name: fig:hammer_x
#+caption: Hammer Blow in the X direction
#+attr_html: :width 300px
[[file:img/impacts/hammer_x.gif]]
#+name: fig:hammer_y
#+caption: Hammer Blow in the Y direction
#+attr_html: :width 300px
[[file:img/impacts/hammer_y.gif]]
#+name: fig:hammer_z
#+caption: Hammer Blow in the Z direction
#+attr_html: :width 300px
[[file:img/impacts/hammer_z.gif]]
* Signal Processing
** Averaging
The measurements are averaged 10 times corresponding to 10 hammer impacts in order to reduce the effect of random noise.
The parameters for the impact test are shown on table [[tab:meas_parameters]].
#+name: tab:meas_parameters
#+caption: Impact test parameters
| Start Delay | -5% |
| Number of lines | 801 lines |
| Trigger Threshold | 300N |
| Trigger Hysteresis | 100mN |
| FRF Average | 10 |
** Windowing
Windowing is used on the force and response signals.
A boxcar window (figure [[fig:windowing_force_signal]]) is used for the force signal as once the impact on the structure is done, the measured signal is meaningless.
The parameters are:
- *Start*: $3\%$
- *Stop*: $7\%$
#+begin_src matlab :exports none
figure;
plot(100*[0, 0.03, 0.03, 0.07, 0.07, 1], [0, 0, 1, 1, 0, 0]);
xlabel('Time [%]'); ylabel('Amplitude');
xlim([0, 100]); ylim([0, 1]);
#+end_src
#+HEADER: :tangle no :exports results :results none :noweb yes
#+begin_src matlab :var filepath="figs/windowing_force_signal.pdf" :var figsize="wide-normal" :post pdf2svg(file=*this*, ext="png")
<<plt-matlab>>
#+end_src
#+NAME: fig:windowing_force_signal
#+CAPTION: Window used for the force signal
[[file:figs/windowing_force_signal.png]]
An exponential window (figure [[fig:windowing_response_signal]]) is used for the response signal as we are measuring transient signals and most of the information is located at the beginning of the signal.
The parameters are:
- FlatTop:
- *Start*: $3\%$
- *Stop*: $2.96\%$
- Decreasing point:
- *X*: $60.4\%$
- *Y*: $14.7\%$
#+begin_src matlab :exports none
x0 = 0.296;
xd = 0.604;
yd = 0.147;
alpha = log(yd)/(x0 - xd);
t = x0:0.01:1.01;
y = exp(-alpha*(t-x0));
figure;
plot(100*[0, 0.03, 0.03, x0, t], [0, 0, 1, 1, y]);
xlabel('Time [%]'); ylabel('Amplitude');
xlim([0, 100]); ylim([0, 1]);
#+end_src
#+HEADER: :tangle no :exports results :results none :noweb yes
#+begin_src matlab :var filepath="figs/windowing_response_signal.pdf" :var figsize="wide-normal" :post pdf2svg(file=*this*, ext="png")
<<plt-matlab>>
#+end_src
#+NAME: fig:windowing_response_signal
#+CAPTION: Window used for the response signals
[[file:figs/windowing_response_signal.png]]
* Force and Response signals
Let's load some obtained data to look at the force and response signals.
#+begin_src matlab
meas1_raw = load('mat/meas_raw_1.mat');
#+end_src
** Raw Force Data
The force input for the first measurement is shown on figure [[fig:raw_data_force]]. We can see 10 impacts, one zoom on one impact is shown on figure [[fig:raw_data_force_zoom]].
The Fourier transform of the force is shown on figure [[fig:fourier_transfor_force_impact]]. This has been obtained without any windowing.
#+begin_src matlab :exports none
time = linspace(0, meas1_raw.Track1_X_Resolution*length(meas1_raw.Track1), length(meas1_raw.Track1));
#+end_src
#+begin_src matlab :exports none
figure;
plot(time, meas1_raw.Track1);
xlabel('Time [s]');
ylabel('Force [N]');
#+end_src
#+HEADER: :tangle no :exports results :results none :noweb yes
#+begin_src matlab :var filepath="figs/raw_data_force.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png")
<<plt-matlab>>
#+end_src
#+NAME: fig:raw_data_force
#+CAPTION: Raw Force Data from Hammer Blow
[[file:figs/raw_data_force.png]]
#+begin_src matlab :exports none
figure;
plot(time, meas1_raw.Track1);
xlabel('Time [s]');
ylabel('Force [N]');
xlim([22.1, 22.3]);
#+end_src
#+HEADER: :tangle no :exports results :results none :noweb yes
#+begin_src matlab :var filepath="figs/raw_data_force_zoom.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png")
<<plt-matlab>>
#+end_src
#+NAME: fig:raw_data_force_zoom
#+CAPTION: Raw Force Data from Hammer Blow - Zoom
[[file:figs/raw_data_force_zoom.png]]
#+begin_src matlab :exports none
Fs = 1/meas1_raw.Track1_X_Resolution; % Sampling Frequency [Hz]
impacts = [5.9, 11.2, 16.6, 22.2, 27.3, 32.7, 38.1, 43.8, 50.4]; % Time just before the impact occurs [s]
L = 8194;
f = Fs*(0:(L/2))/L; % Frequency vector [Hz]
F_fft = zeros((8193+1)/2+1, length(impacts));
for i = 1:length(impacts)
t0 = impacts(i);
[~, i_start] = min(abs(time-t0));
i_end = i_start + 8193;
Y = fft(meas1_raw.Track1(i_start:i_end));
P2 = abs(Y/L);
P1 = P2(1:L/2+1);
P1(2:end-1) = 2*P1(2:end-1);
F_fft(:, i) = P1;
end
#+end_src
#+begin_src matlab :exports none
figure;
hold on;
for i = 1:length(impacts)
plot(f, F_fft(:, i), '-k');
end
hold off;
xlim([0, 200]);
xlabel('Frequency [Hz]'); ylabel('Force [N]');
#+end_src
#+HEADER: :tangle no :exports results :results none :noweb yes
#+begin_src matlab :var filepath="figs/fourier_transfor_force_impact.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png")
<<plt-matlab>>
#+end_src
#+NAME: fig:fourier_transfor_force_impact
#+CAPTION: Fourier Transform of the 10 force impacts for the first measurement
[[file:figs/fourier_transfor_force_impact.png]]
** Raw Response Data
The response signal for the first measurement is shown on figure [[fig:raw_data_acceleration]]. One zoom on one response is shown on figure [[fig:raw_data_acceleration_zoom]].
The Fourier transform of the response signals is shown on figure [[fig:fourier_transform_response_signals]]. This has been obtained without any windowing.
#+begin_src matlab :exports none
figure;
plot(time, meas1_raw.Track2);
xlabel('Time [s]');
ylabel('Acceleration [m/s2]');
#+end_src
#+HEADER: :tangle no :exports results :results none :noweb yes
#+begin_src matlab :var filepath="figs/raw_data_acceleration.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png")
<<plt-matlab>>
#+end_src
#+NAME: fig:raw_data_acceleration
#+CAPTION: Raw Acceleration Data from Accelerometer
[[file:figs/raw_data_acceleration.png]]
#+begin_src matlab :exports none
figure;
plot(time, meas1_raw.Track2);
xlabel('Time [s]');
ylabel('Acceleration [m/s2]');
xlim([22.1, 22.5]);
#+end_src
#+HEADER: :tangle no :exports results :results none :noweb yes
#+begin_src matlab :var filepath="figs/raw_data_acceleration_zoom.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png")
<<plt-matlab>>
#+end_src
#+NAME: fig:raw_data_acceleration_zoom
#+CAPTION: Raw Acceleration Data from Accelerometer - Zoom
[[file:figs/raw_data_acceleration_zoom.png]]
#+begin_src matlab :exports none
X_fft = zeros((8193+1)/2+1, length(impacts));
for i = 1:length(impacts)
t0 = impacts(i);
[~, i_start] = min(abs(time-t0));
i_end = i_start + 8193;
Y = fft(meas1_raw.Track2(i_start:i_end));
P2 = abs(Y/L);
P1 = P2(1:L/2+1);
P1(2:end-1) = 2*P1(2:end-1);
X_fft(:, i) = P1;
end
#+end_src
#+begin_src matlab :exports none
figure;
hold on;
for i = 1:length(impacts)
plot(f, X_fft(:, i), '-k');
end
hold off;
xlim([0, 200]);
set(gca, 'Yscale', 'log');
xlabel('Frequency [Hz]'); ylabel('Acceleration [$m/s^2$]');
#+end_src
#+HEADER: :tangle no :exports results :results none :noweb yes
#+begin_src matlab :var filepath="figs/fourier_transform_response_signals.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png")
<<plt-matlab>>
#+end_src
#+NAME: fig:fourier_transform_response_signals
#+CAPTION: Fourier transform of the measured response signals
[[file:figs/fourier_transform_response_signals.png]]
** Computation of one Frequency Response Function
Now that we have obtained the Fourier transform of both the force input and the response signal, we can compute the Frequency Response Function from the force to the acceleration.
We then compare the result obtained with the FRF computed by the modal software (figure [[fig:frf_comparison_software]]).
The slight difference can probably be explained by the use of windows.
In the following analysis, FRF computed from the software will be used.
#+begin_src matlab
meas1 = load('mat/meas_frf_coh_1.mat');
#+end_src
#+begin_src matlab :exports none
figure;
hold on;
for i = 1:length(impacts)
plot(f, X_fft(:, i)./F_fft(:, i), '-k');
end
plot(meas1.FFT1_AvSpc_2_RMS_X_Val, meas1.FFT1_AvSpc_2_RMS_Y_Val)
hold off;
xlim([0, 200]);
set(gca, 'Yscale', 'log');
xlabel('Frequency [Hz]'); ylabel('Acceleration/Force [$m/s^2/N$]');
#+end_src
#+HEADER: :tangle no :exports results :results none :noweb yes
#+begin_src matlab :var filepath="figs/frf_comparison_software.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png")
<<plt-matlab>>
#+end_src
#+NAME: fig:frf_comparison_software
#+CAPTION: Comparison of the computed FRF from the Fourier transform and using the modal software
[[file:figs/frf_comparison_software.png]]
* Frequency Response Functions and Coherence Results
Let's see one computed Frequency Response Function and one coherence in order to attest the quality of the measurement.
First, we load the data.
#+begin_src matlab
meas1 = load('mat/meas_frf_coh_1.mat');
#+end_src
And we plot on figure [[fig:frf_result_example]] the frequency response function from the force applied in the $X$ direction at the location of the accelerometer number 11 to the acceleration in the $X$ direction as measured by the first accelerometer located on the top platform of the hexapod.
The coherence associated is shown on figure [[fig:frf_result_example]].
#+begin_src matlab :exports none
figure;
ax1 = subplot(2, 1, 1);
plot(meas1.FFT1_AvSpc_2_RMS_X_Val, meas1.FFT1_AvXSpc_2_1_RMS_Y_Mod);
set(gca, 'Yscale', 'log');
set(gca, 'XTickLabel',[]);
ylabel('Magnitude');
ax2 = subplot(2, 1, 2);
plot(meas1.FFT1_AvSpc_2_RMS_X_Val, meas1.FFT1_AvXSpc_2_1_RMS_Y_Phas);
ylim([-180, 180]);
yticks([-180, -90, 0, 90, 180]);
xlabel('Frequency [Hz]'); ylabel('Phase [deg]');
linkaxes([ax1,ax2],'x');
#+end_src
#+HEADER: :tangle no :exports results :results none :noweb yes
#+begin_src matlab :var filepath="figs/frf_result_example.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png")
<<plt-matlab>>
#+end_src
#+NAME: fig:frf_result_example
#+CAPTION: Example of one measured FRF
[[file:figs/frf_result_example.png]]
#+begin_src matlab :exports none
figure;
plot(meas1.FFT1_AvSpc_2_RMS_X_Val, meas1.FFT1_Coh_2_1_RMS_Y_Val);
xlabel('Frequency [Hz]');
ylabel('Coherence');
#+end_src
#+HEADER: :tangle no :exports results :results none :noweb yes
#+begin_src matlab :var filepath="figs/coh_result_example.pdf" :var figsize="full-normal" :post pdf2svg(file=*this*, ext="png")
<<plt-matlab>>
#+end_src
#+NAME: fig:coh_result_example
#+CAPTION: Example of one measured Coherence
[[file:figs/coh_result_example.png]]
* Generation of a FRF matrix and a Coherence matrix from the measurements
We want here to combine all the Frequency Response Functions measured into one big array called the *Frequency Response Matrix*.
The frequency response matrix is an $n \times p \times q$:
- $n$ is the number of measurements: $23 \times 3$ (23 accelerometers measuring 3 directions each)
- $p$ is the number of excitation inputs: $3$
- $q$ is the number of frequency points $\omega_i$
Thus, the FRF matrix is an $69 \times 3 \times 801$ matrix.
#+begin_important
For each frequency point $\omega_i$, we obtain a 2D matrix:
\begin{equation}
\text{FRF}(\omega_i) = \begin{bmatrix}
\frac{D_{1_x}}{F_x}(\omega_i) & \frac{D_{1_x}}{F_y}(\omega_i) & \frac{D_{1_x}}{F_z}(\omega_i) \\
\frac{D_{1_y}}{F_x}(\omega_i) & \frac{D_{1_y}}{F_y}(\omega_i) & \frac{D_{1_y}}{F_z}(\omega_i) \\
\frac{D_{1_z}}{F_x}(\omega_i) & \frac{D_{1_z}}{F_y}(\omega_i) & \frac{D_{1_z}}{F_z}(\omega_i) \\
\frac{D_{2_x}}{F_x}(\omega_i) & \frac{D_{2_x}}{F_y}(\omega_i) & \frac{D_{2_x}}{F_z}(\omega_i) \\
\vdots & \vdots & \vdots \\
\frac{D_{23_z}}{F_x}(\omega_i) & \frac{D_{23_z}}{F_y}(\omega_i) & \frac{D_{23_z}}{F_z}(\omega_i) \\
\end{bmatrix}
\end{equation}
#+end_important
We generate such FRF matrix from the measurements using the following script.
#+begin_src matlab
n_meas = 24;
n_acc = 23;
dirs = 'XYZ';
% Number of Accelerometer * DOF for each acccelerometer / Number of excitation / frequency points
FRFs = zeros(3*n_acc, 3, 801);
COHs = zeros(3*n_acc, 3, 801);
% Loop through measurements
for i = 1:n_meas
% Load the measurement file
meas = load(sprintf('mat/meas_frf_coh_%i.mat', i));
% First: determine what is the exitation (direction and sign)
exc_dir = meas.FFT1_AvXSpc_2_1_RMS_RfName(end);
exc_sign = meas.FFT1_AvXSpc_2_1_RMS_RfName(end-1);
% Determine what is the correct excitation sign
exc_factor = str2num([exc_sign, '1']);
if exc_dir ~= 'Z'
exc_factor = exc_factor*(-1);
end
% Then: loop through the nine measurements and store them at the correct location
for j = 2:10
% Determine what is the accelerometer and direction
[indices_acc_i] = strfind(meas.(sprintf('FFT1_H1_%i_1_RpName', j)), '.');
acc_i = str2num(meas.(sprintf('FFT1_H1_%i_1_RpName', j))(indices_acc_i(1)+1:indices_acc_i(2)-1));
meas_dir = meas.(sprintf('FFT1_H1_%i_1_RpName', j))(end);
meas_sign = meas.(sprintf('FFT1_H1_%i_1_RpName', j))(end-1);
% Determine what is the correct measurement sign
meas_factor = str2num([meas_sign, '1']);
if meas_dir ~= 'Z'
meas_factor = meas_factor*(-1);
end
% FRFs(acc_i+n_acc*(find(dirs==meas_dir)-1), find(dirs==exc_dir), :) = exc_factor*meas_factor*meas.(sprintf('FFT1_H1_%i_1_Y_ReIm', j));
% COHs(acc_i+n_acc*(find(dirs==meas_dir)-1), find(dirs==exc_dir), :) = meas.(sprintf('FFT1_Coh_%i_1_RMS_Y_Val', j));
FRFs(find(dirs==meas_dir)+3*(acc_i-1), find(dirs==exc_dir), :) = exc_factor*meas_factor*meas.(sprintf('FFT1_H1_%i_1_Y_ReIm', j));
COHs(find(dirs==meas_dir)+3*(acc_i-1), find(dirs==exc_dir), :) = meas.(sprintf('FFT1_Coh_%i_1_RMS_Y_Val', j));
end
end
freqs = meas.FFT1_Coh_10_1_RMS_X_Val;
#+end_src
And we save the obtained FRF matrix and Coherence matrix in a =.mat= file.
#+begin_src matlab
save('./mat/frf_coh_matrices.mat', 'FRFs', 'COHs', 'freqs');
#+end_src