Add figures
This commit is contained in:
parent
c2fec7b236
commit
4e780d6b82
BIN
figs/apa95ml_5kg_10V_coh.pdf
Normal file
BIN
figs/apa95ml_5kg_10V_coh.pdf
Normal file
Binary file not shown.
BIN
figs/apa95ml_5kg_10V_coh.png
Normal file
BIN
figs/apa95ml_5kg_10V_coh.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 44 KiB |
BIN
figs/apa95ml_5kg_10V_pdf_comp_huddle.pdf
Normal file
BIN
figs/apa95ml_5kg_10V_pdf_comp_huddle.pdf
Normal file
Binary file not shown.
BIN
figs/apa95ml_5kg_10V_pdf_comp_huddle.png
Normal file
BIN
figs/apa95ml_5kg_10V_pdf_comp_huddle.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 118 KiB |
1635
figs/apa95ml_5kg_10V_tf.pdf
Normal file
1635
figs/apa95ml_5kg_10V_tf.pdf
Normal file
File diff suppressed because it is too large
Load Diff
BIN
figs/apa95ml_5kg_10V_tf.png
Normal file
BIN
figs/apa95ml_5kg_10V_tf.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 115 KiB |
BIN
figs/apa95ml_5kg_10V_time_domain.pdf
Normal file
BIN
figs/apa95ml_5kg_10V_time_domain.pdf
Normal file
Binary file not shown.
BIN
figs/apa95ml_5kg_10V_time_domain.png
Normal file
BIN
figs/apa95ml_5kg_10V_time_domain.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 37 KiB |
BIN
figs/huddle_test_pdf.pdf
Normal file
BIN
figs/huddle_test_pdf.pdf
Normal file
Binary file not shown.
BIN
figs/huddle_test_pdf.png
Normal file
BIN
figs/huddle_test_pdf.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 103 KiB |
BIN
figs/huddle_test_time_domain.pdf
Normal file
BIN
figs/huddle_test_time_domain.pdf
Normal file
Binary file not shown.
BIN
figs/huddle_test_time_domain.png
Normal file
BIN
figs/huddle_test_time_domain.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 26 KiB |
246
index.html
246
index.html
@ -3,18 +3,18 @@
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
||||
<head>
|
||||
<!-- 2020-07-17 ven. 11:55 -->
|
||||
<!-- 2020-07-20 lun. 11:27 -->
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
|
||||
<title>Test Bench APA</title>
|
||||
<meta name="generator" content="Org mode" />
|
||||
<meta name="author" content="Dehaeze Thomas" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/htmlize.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="../css/readtheorg.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="../css/zenburn.css"/>
|
||||
<script type="text/javascript" src="../js/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="../js/bootstrap.min.js"></script>
|
||||
<script type="text/javascript" src="../js/jquery.stickytableheaders.min.js"></script>
|
||||
<script type="text/javascript" src="../js/readtheorg.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="./css/htmlize.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="./css/readtheorg.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="./css/zenburn.css"/>
|
||||
<script type="text/javascript" src="./js/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="./js/bootstrap.min.js"></script>
|
||||
<script type="text/javascript" src="./js/jquery.stickytableheaders.min.js"></script>
|
||||
<script type="text/javascript" src="./js/readtheorg.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="org-div-home-and-up">
|
||||
@ -27,20 +27,43 @@
|
||||
<h2>Table of Contents</h2>
|
||||
<div id="text-table-of-contents">
|
||||
<ul>
|
||||
<li><a href="#orgf243093">1. Parameters</a></li>
|
||||
<li><a href="#org523b657">2. Filter White Noise</a></li>
|
||||
<li><a href="#org422b8fd">3. Load Data</a></li>
|
||||
<li><a href="#orgbbba70f">4. Time Domain Data</a></li>
|
||||
<li><a href="#org14d27d9">5. Compute TF estimate and Coherence</a></li>
|
||||
<li><a href="#orgf7c6889">6. Coherence</a></li>
|
||||
<li><a href="#org2153f21">7. Transfer Function</a></li>
|
||||
<li><a href="#orgc824287">1. Setup</a>
|
||||
<ul>
|
||||
<li><a href="#orgd7519f6">1.1. Parameters</a></li>
|
||||
<li><a href="#org6b6fba7">1.2. Filter White Noise</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#orge67785b">2. Run Experiment and Save Data</a>
|
||||
<ul>
|
||||
<li><a href="#orgb713921">2.1. Load Data</a></li>
|
||||
<li><a href="#org76c3b29">2.2. Save Data</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#org9fd96de">3. Huddle Test</a>
|
||||
<ul>
|
||||
<li><a href="#orgd57e28b">3.1. Time Domain Data</a></li>
|
||||
<li><a href="#org3bbc63e">3.2. PSD of Measurement Noise</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#org998c1cd">4. Transfer Function Estimation with m=5kg</a>
|
||||
<ul>
|
||||
<li><a href="#org9ef342c">4.1. Time Domain Data</a></li>
|
||||
<li><a href="#orgefdd95f">4.2. Comparison of the PSD with Huddle Test</a></li>
|
||||
<li><a href="#orge9cdeb9">4.3. Compute TF estimate and Coherence</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-orgf243093" class="outline-2">
|
||||
<h2 id="orgf243093"><span class="section-number-2">1</span> Parameters</h2>
|
||||
<div id="outline-container-orgc824287" class="outline-2">
|
||||
<h2 id="orgc824287"><span class="section-number-2">1</span> Setup</h2>
|
||||
<div class="outline-text-2" id="text-1">
|
||||
</div>
|
||||
|
||||
<div id="outline-container-orgd7519f6" class="outline-3">
|
||||
<h3 id="orgd7519f6"><span class="section-number-3">1.1</span> Parameters</h3>
|
||||
<div class="outline-text-3" id="text-1-1">
|
||||
<div class="org-src-container">
|
||||
<pre class="src src-matlab">Ts = 1e-4;
|
||||
</pre>
|
||||
@ -48,9 +71,9 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org523b657" class="outline-2">
|
||||
<h2 id="org523b657"><span class="section-number-2">2</span> Filter White Noise</h2>
|
||||
<div class="outline-text-2" id="text-2">
|
||||
<div id="outline-container-org6b6fba7" class="outline-3">
|
||||
<h3 id="org6b6fba7"><span class="section-number-3">1.2</span> Filter White Noise</h3>
|
||||
<div class="outline-text-3" id="text-1-2">
|
||||
<div class="org-src-container">
|
||||
<pre class="src src-matlab">Glpf = 1/(1 + s/2/pi/500);
|
||||
|
||||
@ -59,95 +82,158 @@ Gz = c2d(Glpf, Ts, 'tustin');
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org422b8fd" class="outline-2">
|
||||
<h2 id="org422b8fd"><span class="section-number-2">3</span> Load Data</h2>
|
||||
<div id="outline-container-orge67785b" class="outline-2">
|
||||
<h2 id="orge67785b"><span class="section-number-2">2</span> Run Experiment and Save Data</h2>
|
||||
<div class="outline-text-2" id="text-2">
|
||||
</div>
|
||||
|
||||
<div id="outline-container-orgb713921" class="outline-3">
|
||||
<h3 id="orgb713921"><span class="section-number-3">2.1</span> Load Data</h3>
|
||||
<div class="outline-text-3" id="text-2-1">
|
||||
<div class="org-src-container">
|
||||
<pre class="src src-matlab">data = SimulinkRealTime.utils.getFileScopeData('data/apa95ml.dat').data;
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org76c3b29" class="outline-3">
|
||||
<h3 id="org76c3b29"><span class="section-number-3">2.2</span> Save Data</h3>
|
||||
<div class="outline-text-3" id="text-2-2">
|
||||
<div class="org-src-container">
|
||||
<pre class="src src-matlab">u = data(:, 1); % Input Voltage [V]
|
||||
y = data(:, 2); % Output Displacement [m]
|
||||
t = data(:, 3); % Time [s]
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<div class="org-src-container">
|
||||
<pre class="src src-matlab">save('./mat/huddle_test.mat', 't', 'u', 'y', 'Glpf');
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org9fd96de" class="outline-2">
|
||||
<h2 id="org9fd96de"><span class="section-number-2">3</span> Huddle Test</h2>
|
||||
<div class="outline-text-2" id="text-3">
|
||||
<div class="org-src-container">
|
||||
<pre class="src src-matlab">data = SimulinkRealTime.utils.getFileScopeData('data/apa95ml_5kg.dat').data;
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-orgd57e28b" class="outline-3">
|
||||
<h3 id="orgd57e28b"><span class="section-number-3">3.1</span> Time Domain Data</h3>
|
||||
<div class="outline-text-3" id="text-3-1">
|
||||
|
||||
<div id="org892424c" class="figure">
|
||||
<p><img src="figs/huddle_test_time_domain.png" alt="huddle_test_time_domain.png" />
|
||||
</p>
|
||||
<p><span class="figure-number">Figure 1: </span>Measurement of the Mass displacement during Huddle Test</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-orgbbba70f" class="outline-2">
|
||||
<h2 id="orgbbba70f"><span class="section-number-2">4</span> Time Domain Data</h2>
|
||||
<div id="outline-container-org3bbc63e" class="outline-3">
|
||||
<h3 id="org3bbc63e"><span class="section-number-3">3.2</span> PSD of Measurement Noise</h3>
|
||||
<div class="outline-text-3" id="text-3-2">
|
||||
<div class="org-src-container">
|
||||
<pre class="src src-matlab">Ts = t(end)/(length(t)-1);
|
||||
Fs = 1/Ts;
|
||||
|
||||
win = hanning(ceil(1*Fs));
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<div class="org-src-container">
|
||||
<pre class="src src-matlab">[pxx, f] = pwelch(y, win, [], [], Fs);
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="orgcf40479" class="figure">
|
||||
<p><img src="figs/huddle_test_pdf.png" alt="huddle_test_pdf.png" />
|
||||
</p>
|
||||
<p><span class="figure-number">Figure 2: </span>Amplitude Spectral Density of the Displacement during Huddle Test</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org998c1cd" class="outline-2">
|
||||
<h2 id="org998c1cd"><span class="section-number-2">4</span> Transfer Function Estimation with m=5kg</h2>
|
||||
<div class="outline-text-2" id="text-4">
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org9ef342c" class="outline-3">
|
||||
<h3 id="org9ef342c"><span class="section-number-3">4.1</span> Time Domain Data</h3>
|
||||
<div class="outline-text-3" id="text-4-1">
|
||||
|
||||
<div id="orgf113201" class="figure">
|
||||
<p><img src="figs/apa95ml_5kg_10V_time_domain.png" alt="apa95ml_5kg_10V_time_domain.png" />
|
||||
</p>
|
||||
<p><span class="figure-number">Figure 3: </span>Time domain signals during the test</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-orgefdd95f" class="outline-3">
|
||||
<h3 id="orgefdd95f"><span class="section-number-3">4.2</span> Comparison of the PSD with Huddle Test</h3>
|
||||
<div class="outline-text-3" id="text-4-2">
|
||||
<div class="org-src-container">
|
||||
<pre class="src src-matlab">figure;
|
||||
<pre class="src src-matlab">Ts = t(end)/(length(t)-1);
|
||||
Fs = 1/Ts;
|
||||
|
||||
subplot(1,2,1);
|
||||
plot(data(:, 3), data(:, 1))
|
||||
ylabel('Input Voltage [V]'); xlabel('Time [s]');
|
||||
|
||||
|
||||
subplot(1,2,2);
|
||||
plot(data(:, 3), data(:, 2))
|
||||
ylabel('Output Displacement [m]'); xlabel('Time [s]');
|
||||
win = hanning(ceil(1*Fs));
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<div class="org-src-container">
|
||||
<pre class="src src-matlab">[pxx, f] = pwelch(y, win, [], [], Fs);
|
||||
[pht, ~] = pwelch(ht.y, win, [], [], Fs);
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="orgb2b9828" class="figure">
|
||||
<p><img src="figs/apa95ml_5kg_10V_pdf_comp_huddle.png" alt="apa95ml_5kg_10V_pdf_comp_huddle.png" />
|
||||
</p>
|
||||
<p><span class="figure-number">Figure 4: </span>Comparison of the ASD for the identification test and the huddle test</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org14d27d9" class="outline-2">
|
||||
<h2 id="org14d27d9"><span class="section-number-2">5</span> Compute TF estimate and Coherence</h2>
|
||||
<div class="outline-text-2" id="text-5">
|
||||
<div id="outline-container-orge9cdeb9" class="outline-3">
|
||||
<h3 id="orge9cdeb9"><span class="section-number-3">4.3</span> Compute TF estimate and Coherence</h3>
|
||||
<div class="outline-text-3" id="text-4-3">
|
||||
<div class="org-src-container">
|
||||
<pre class="src src-matlab">win = hann(ceil(1/Ts));
|
||||
|
||||
[tf_est, f] = tfestimate(data(:, 1), -data(:, 2), win, [], [], 1/Ts);
|
||||
[co_est, ~] = mscohere( data(:, 1), -data(:, 2), win, [], [], 1/Ts);
|
||||
[tf_est, f] = tfestimate(u, -y, win, [], [], 1/Ts);
|
||||
[co_est, ~] = mscohere( u, -y, win, [], [], 1/Ts);
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="org11f3e44" class="figure">
|
||||
<p><img src="figs/apa95ml_5kg_10V_coh.png" alt="apa95ml_5kg_10V_coh.png" />
|
||||
</p>
|
||||
<p><span class="figure-number">Figure 5: </span>Coherence</p>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-orgf7c6889" class="outline-2">
|
||||
<h2 id="orgf7c6889"><span class="section-number-2">6</span> Coherence</h2>
|
||||
<div class="outline-text-2" id="text-6">
|
||||
<div class="org-src-container">
|
||||
<pre class="src src-matlab">figure;
|
||||
|
||||
hold on;
|
||||
plot(f, co_est, 'k-')
|
||||
set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'lin');
|
||||
ylabel('Coherence'); xlabel('Frequency [Hz]');
|
||||
hold off;
|
||||
</pre>
|
||||
<div id="orge10c988" class="figure">
|
||||
<p><img src="figs/apa95ml_5kg_10V_tf.png" alt="apa95ml_5kg_10V_tf.png" />
|
||||
</p>
|
||||
<p><span class="figure-number">Figure 6: </span>Estimation of the transfer function from input voltage to displacement</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org2153f21" class="outline-2">
|
||||
<h2 id="org2153f21"><span class="section-number-2">7</span> Transfer Function</h2>
|
||||
<div class="outline-text-2" id="text-7">
|
||||
<div class="org-src-container">
|
||||
<pre class="src src-matlab">figure;
|
||||
ax1 = subplot(2, 1, 1);
|
||||
hold on;
|
||||
plot(f, abs(tf_est), 'k-')
|
||||
set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'log');
|
||||
ylabel('Amplitude'); xlabel('Frequency [Hz]');
|
||||
hold off;
|
||||
|
||||
ax2 = subplot(2, 1, 2);
|
||||
hold on;
|
||||
plot(f, 180/pi*angle(tf_est), 'k-')
|
||||
set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'lin');
|
||||
ylabel('Phase'); xlabel('Frequency [Hz]');
|
||||
legend();
|
||||
hold off;
|
||||
|
||||
linkaxes([ax1,ax2], 'x');
|
||||
xlim([10, 5000]);
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="postamble" class="status">
|
||||
<p class="author">Author: Dehaeze Thomas</p>
|
||||
<p class="date">Created: 2020-07-17 ven. 11:55</p>
|
||||
<p class="date">Created: 2020-07-20 lun. 11:27</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
127
index.org
127
index.org
@ -9,13 +9,13 @@
|
||||
#+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_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
|
||||
|
||||
@ -41,15 +41,6 @@
|
||||
#+PROPERTY: header-args:latex+ :output-dir figs
|
||||
:END:
|
||||
|
||||
* 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
|
||||
|
||||
* Setup
|
||||
:PROPERTIES:
|
||||
:header-args:matlab+: :tangle matlab/setup_experiment.m
|
||||
@ -96,18 +87,36 @@
|
||||
:header-args:matlab+: :comments org :mkdirp yes
|
||||
:END:
|
||||
|
||||
** Load Data
|
||||
** 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
|
||||
|
||||
** Load Data :noexport:
|
||||
#+begin_src matlab
|
||||
load('./mat/huddle_test.mat', 't', 'u', 'y');
|
||||
#+end_src
|
||||
|
||||
** Time Domain Data
|
||||
#+begin_src matlab
|
||||
#+begin_src matlab :exports none
|
||||
figure;
|
||||
plot(t, y)
|
||||
ylabel('Output Displacement [m]'); xlabel('Time [s]');
|
||||
#+end_src
|
||||
|
||||
#+begin_src matlab :tangle no :exports results :results file replace
|
||||
exportFig('figs/huddle_test_time_domain.pdf', 'width', 'wide', 'height', 'normal');
|
||||
#+end_src
|
||||
|
||||
#+name: fig:huddle_test_time_domain
|
||||
#+caption: Measurement of the Mass displacement during Huddle Test
|
||||
#+RESULTS:
|
||||
[[file:figs/huddle_test_time_domain.png]]
|
||||
|
||||
** PSD of Measurement Noise
|
||||
#+begin_src matlab
|
||||
Ts = t(end)/(length(t)-1);
|
||||
@ -120,27 +129,46 @@
|
||||
[pxx, f] = pwelch(y, win, [], [], Fs);
|
||||
#+end_src
|
||||
|
||||
#+begin_src matlab
|
||||
#+begin_src matlab :exports none
|
||||
figure;
|
||||
plot(f, sqrt(pxx));
|
||||
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
|
||||
xlabel('Frequency [Hz]'); ylabel('ASD [$m/\sqrt{Hz}$]');
|
||||
xlim([1, Fs/2]);
|
||||
#+end_src
|
||||
|
||||
#+begin_src matlab :tangle no :exports results :results file replace
|
||||
exportFig('figs/huddle_test_pdf.pdf', 'width', 'wide', 'height', 'tall');
|
||||
#+end_src
|
||||
|
||||
#+name: fig:huddle_test_pdf
|
||||
#+caption: Amplitude Spectral Density of the Displacement during Huddle Test
|
||||
#+RESULTS:
|
||||
[[file:figs/huddle_test_pdf.png]]
|
||||
|
||||
* Transfer Function Estimation with m=5kg
|
||||
:PROPERTIES:
|
||||
:header-args:matlab+: :tangle matlab/tf_estimation.m
|
||||
:header-args:matlab+: :comments org :mkdirp yes
|
||||
:END:
|
||||
|
||||
** Load Data
|
||||
** 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
|
||||
|
||||
** Load Data :noexport:
|
||||
#+begin_src matlab
|
||||
ht = load('./mat/huddle_test.mat', 't', 'u', 'y');
|
||||
load('./mat/apa95ml_5kg.mat', 't', 'u', 'y');
|
||||
load('./mat/apa95ml_5kg_10V.mat', 't', 'u', 'y');
|
||||
#+end_src
|
||||
|
||||
** Time Domain Data
|
||||
#+begin_src matlab
|
||||
#+begin_src matlab :exports none
|
||||
figure;
|
||||
|
||||
subplot(1,2,1);
|
||||
@ -153,6 +181,15 @@
|
||||
ylabel('Output Displacement [m]'); xlabel('Time [s]');
|
||||
#+end_src
|
||||
|
||||
#+begin_src matlab :tangle no :exports results :results file replace
|
||||
exportFig('figs/apa95ml_5kg_10V_time_domain.pdf', 'width', 'full', 'height', 'tall');
|
||||
#+end_src
|
||||
|
||||
#+name: fig:apa95ml_5kg_10V_time_domain
|
||||
#+caption: Time domain signals during the test
|
||||
#+RESULTS:
|
||||
[[file:figs/apa95ml_5kg_10V_time_domain.png]]
|
||||
|
||||
** Comparison of the PSD with Huddle Test
|
||||
#+begin_src matlab
|
||||
Ts = t(end)/(length(t)-1);
|
||||
@ -166,7 +203,7 @@
|
||||
[pht, ~] = pwelch(ht.y, win, [], [], Fs);
|
||||
#+end_src
|
||||
|
||||
#+begin_src matlab
|
||||
#+begin_src matlab :exports none
|
||||
figure;
|
||||
hold on;
|
||||
plot(f, sqrt(pxx), 'DisplayName', '5kg');
|
||||
@ -174,19 +211,28 @@
|
||||
hold off;
|
||||
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
|
||||
xlabel('Frequency [Hz]'); ylabel('ASD [$m/\sqrt{Hz}$]');
|
||||
legend('locaation', 'norteast');
|
||||
legend('location', 'northeast');
|
||||
xlim([1, Fs/2]);
|
||||
#+end_src
|
||||
|
||||
#+begin_src matlab :tangle no :exports results :results file replace
|
||||
exportFig('figs/apa95ml_5kg_10V_pdf_comp_huddle.pdf', 'width', 'wide', 'height', 'tall');
|
||||
#+end_src
|
||||
|
||||
#+name: fig:apa95ml_5kg_10V_pdf_comp_huddle
|
||||
#+caption: Comparison of the ASD for the identification test and the huddle test
|
||||
#+RESULTS:
|
||||
[[file:figs/apa95ml_5kg_10V_pdf_comp_huddle.png]]
|
||||
|
||||
** Compute TF estimate and Coherence
|
||||
#+begin_src matlab
|
||||
win = hann(ceil(1/Ts));
|
||||
|
||||
[tf_est, f] = tfestimate(data(:, 1), -data(:, 2), win, [], [], 1/Ts);
|
||||
[co_est, ~] = mscohere( data(:, 1), -data(:, 2), win, [], [], 1/Ts);
|
||||
[tf_est, f] = tfestimate(u, -y, win, [], [], 1/Ts);
|
||||
[co_est, ~] = mscohere( u, -y, win, [], [], 1/Ts);
|
||||
#+end_src
|
||||
|
||||
** Coherence
|
||||
#+begin_src matlab
|
||||
#+begin_src matlab :exports none
|
||||
figure;
|
||||
|
||||
hold on;
|
||||
@ -194,10 +240,19 @@
|
||||
set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'lin');
|
||||
ylabel('Coherence'); xlabel('Frequency [Hz]');
|
||||
hold off;
|
||||
xlim([10, 5e3]);
|
||||
#+end_src
|
||||
|
||||
** Transfer Function
|
||||
#+begin_src matlab
|
||||
#+begin_src matlab :tangle no :exports results :results file replace
|
||||
exportFig('figs/apa95ml_5kg_10V_coh.pdf', 'width', 'wide', 'height', 'normal');
|
||||
#+end_src
|
||||
|
||||
#+name: fig:apa95ml_5kg_10V_coh
|
||||
#+caption: Coherence
|
||||
#+RESULTS:
|
||||
[[file:figs/apa95ml_5kg_10V_coh.png]]
|
||||
|
||||
#+begin_src matlab :exports none
|
||||
figure;
|
||||
ax1 = subplot(2, 1, 1);
|
||||
hold on;
|
||||
@ -211,9 +266,17 @@
|
||||
plot(f, 180/pi*angle(tf_est), 'k-')
|
||||
set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'lin');
|
||||
ylabel('Phase'); xlabel('Frequency [Hz]');
|
||||
legend();
|
||||
hold off;
|
||||
|
||||
linkaxes([ax1,ax2], 'x');
|
||||
xlim([10, 5000]);
|
||||
xlim([10, 5e3]);
|
||||
#+end_src
|
||||
|
||||
#+begin_src matlab :tangle no :exports results :results file replace
|
||||
exportFig('figs/apa95ml_5kg_10V_tf.pdf', 'width', 'full', 'height', 'full');
|
||||
#+end_src
|
||||
|
||||
#+name: fig:apa95ml_5kg_10V_tf
|
||||
#+caption: Estimation of the transfer function from input voltage to displacement
|
||||
#+RESULTS:
|
||||
[[file:figs/apa95ml_5kg_10V_tf.png]]
|
||||
|
Loading…
Reference in New Issue
Block a user