Skip to content

Commit a304101

Browse files
committed
initial commit (File Exchange to GitHub)
0 parents  commit a304101

File tree

5 files changed

+122
-0
lines changed

5 files changed

+122
-0
lines changed

README.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# DEMO: アプリを使用した特徴量調査
2+
3+
このプログラムでは、デモに使用するデータファイル sampleData.mat を作成します。もともとの1 日当たり 6 秒間の振動信号を連続 50 日間取得したものですが、ここでは計算量軽減のため、1 日当たり 1 秒間、1 日おき 25 日分のデータに削減します。
4+
5+
# Dataset
6+
7+
20 歯のピニオンギヤで駆動する 2 MW 風力タービン高速シャフトから収集されたデータを使用します[1]。まず、[https://github.com/mathworks/WindTurbineHighSpeedBearingPrognosis-Data](https://github.com/mathworks/WindTurbineHighSpeedBearingPrognosis-Data) からリポジトリ全体を zip ファイルとしてダウンロードして、本スクリプトと同じディレクトリに保存してください。以下のコマンドを使用してファイルを解凍します。こちらのデータでは計測間隔は 1 日間隔です。
8+
9+
```matlab:Code
10+
if exist('WindTurbineHighSpeedBearingPrognosis-Data-master.zip', 'file')
11+
unzip('WindTurbineHighSpeedBearingPrognosis-Data-master.zip')
12+
end
13+
```
14+
15+
# Data Import
16+
17+
まず風力タービンデータに対して fileDatastore を作成します。使用するデータには振動とタコメータの信号が含まれています。各 mat ファイルからcutomreader 関数で読み取りますが、1 秒分の振動データに加えてファイル名から日付情報も合わせて取得します。
18+
19+
```matlab:Code
20+
dir = 'WindTurbineHighSpeedBearingPrognosis-Data-master';
21+
ds = fileDatastore(fullfile('.', dir,'*.mat'),'ReadFcn',@customreader,'UniformRead',true);
22+
data = readall(ds)
23+
```
24+
25+
| |Date|vibration|
26+
|:--:|:--:|:--:|
27+
|1|2013/03/07|97656x1 timetable|
28+
|2|2013/03/08|97656x1 timetable|
29+
|3|2013/03/09|97656x1 timetable|
30+
|4|2013/03/10|97656x1 timetable|
31+
|5|2013/03/11|97656x1 timetable|
32+
|6|2013/03/12|97656x1 timetable|
33+
|7|2013/03/13|97656x1 timetable|
34+
|8|2013/03/14|97656x1 timetable|
35+
|9|2013/03/15|97656x1 timetable|
36+
|10|2013/03/16|97656x1 timetable|
37+
38+
# Data Reduction
39+
40+
ここでは計算量軽減のため、さらに1 日おき 25 日分のデータに削減します。
41+
42+
```matlab:Code
43+
sampleData = data;
44+
sampleData(1:2:end,:) = [];
45+
```
46+
47+
さらに前半のデータには faultCode = 0、後半のデータについては faultcode = 1 とラベル付けします。
48+
49+
```matlab:Code
50+
sampleData.faultcode = [zeros(13,1); ones(12,1)];
51+
save('sampleData.mat','sampleData');
52+
```
53+
54+
任意に変更して、他にもアプリで使用するサンプルデータを作成して試してみてください。
55+
56+
# References
57+
58+
[1] [<http://data-acoustics.com/measurements/bearing-faults/bearing-3/](http://data-acoustics.com/measurements/bearing-faults/bearing-3/)> Bechhoefer, Eric, Brandon Van Hecke, and David He. "Processing for improved spectral analysis." *Annual Conference of the Prognostics and Health Management Society, New Orleans, LA, Oct*. 2013.
59+
60+
# Helper Function
61+
62+
```matlab:Code
63+
function data = customreader(filename)
64+
% Read variables for the fileEnsemble
65+
% Inputs:
66+
% filename - a string of the mat file name to read from.
67+
% Output:
68+
% data - return a table with a single row
69+
% Copyright 2018 The MathWorks, Inc.
70+
71+
data = table;
72+
% Extract the datetime information from the file names
73+
[~, fname] = fileparts(filename);
74+
token = regexp(fname, 'data-(\d+)', 'tokens');
75+
data.Date = datetime(token{1}{1}, 'InputFormat', 'yyyyMMdd');
76+
77+
% Load the vibration signal from the mat file
78+
mfile = matfile(filename); % Allows partial loading
79+
vib = mfile.vibration;
80+
81+
% Extract the first 1s of signal and convert it to timetable
82+
fs = 97656; % Sampling rate
83+
tVibration = timetable(vib(1:fs),'SamplingRate',fs);
84+
data.vibration = {tVibration};
85+
86+
end
87+
88+
```
89+
90+
*Copyright 2018 The MathWorks, Inc.*

SECURITY.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Reporting Security Vulnerabilities
2+
3+
If you believe you have discovered a security vulnerability, please report it to
4+
[security@mathworks.com](mailto:security@mathworks.com). Please see
5+
[MathWorks Vulnerability Disclosure Policy for Security Researchers](https://www.mathworks.com/company/aboutus/policies_statements/vulnerability-disclosure-policy.html)
6+
for additional information.
5.42 KB
Binary file not shown.

license.txt

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
Copyright (c) 2020, The MathWorks, Inc.
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without
5+
modification, are permitted provided that the following conditions are met:
6+
7+
* Redistributions of source code must retain the above copyright notice, this
8+
list of conditions and the following disclaimer.
9+
10+
* Redistributions in binary form must reproduce the above copyright notice,
11+
this list of conditions and the following disclaimer in the documentation
12+
and/or other materials provided with the distribution.
13+
* In all cases, the software is, and all modifications and derivatives of the
14+
software shall be, licensed to you solely for use in conjunction with
15+
MathWorks products and service offerings.
16+
17+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
21+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
24+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

sampleData.mat

17.8 MB
Binary file not shown.

0 commit comments

Comments
 (0)