Integration of nonlinear numerical acceleration data to find displacement

7 次查看(过去 30 天)
I want to find displacement of a horizontal object subjected to an impact loading. I am using an b&k accelerometer, along with a signal conditionar and labview data acquisition module. Attached is part of the random time-acceleration data and the matlab code I am using currently. I have used cumtrapz, which is not good for integrating nonlinear data. Is there any better method I can adopt? TIA
t = data(:,1);
dt = mean(diff(t));
fs = 1/dt;
% Acceleration data
acc = data(:,2);
acc = detrend(acc);
N = 2;
fc = 14.5; % Hz
[B,A] = butter(N,2*fc/fs,'high');
acc = filter(B,A,acc);
velocity = cumtrapz(dt,acc);
velocity= detrend(velocity);
disp = cumtrapz(dt,velocity);
disp = detrend(disp);
figure(1)
subplot(311),plot(t,acc);
title('acceleration'); ylabel('m/s^2');xlabel('time (s)');
subplot(312),plot(t,velocity);
title('velocity'); ylabel('m/s');xlabel('time (s)');
subplot(313),plot(t,disp);
title('disp'); ylabel('m');xlabel('time (s)');
Here is the part of random data:
Time Avg Acc
6.451325 0.003012
6.453325 0.037054
6.455323 0.056475
6.457322 0.054647
6.459321 0.037797
6.46132 0.092066
6.463318 0.092933
6.465317 -0.00944
6.467317 0.301396
6.469316 0.288696
6.473313 0.121895
6.475312 0.503231
6.477312 0.373444
6.479311 0.317782
6.481308 0.387228
6.483307 0.165198
6.485306 0.385958
6.487307 0.316326
6.489304 0.259053
6.491302 0.329088
6.493301 0.241521
6.4953 0.304463
6.497298 -0.00699
6.499298 -0.12854
6.501297 0.459772
6.504295 -0.09465
6.506294 0.114058
6.506294 0.077879
6.508293 0.10712
6.510293 -0.08205
6.515289 -0.46168
6.517288 -0.24058
6.518288 -0.5196
6.520286 -0.61733
6.520286 -0.39084
6.522285 -0.72429
6.524284 -0.48633
6.526285 -0.48621
6.528282 -0.59481
6.53028 -0.87241
6.532278 -4.9192
6.534278 -183.414
6.536277 -854.641
6.538277 -424.772
6.540274 -452.27
6.542274 -591.437
6.544272 -646.52
6.546271 -722.656
6.548269 -683.694
6.550269 -681.5
6.552267 -703.934
6.557265 -718.37
6.559265 -707.032
6.560265 -700.216
6.562263 -652.975
6.562263 -646.437
6.56426 -635.972
6.566259 -636.907
6.568258 -651.909
6.570258 -645.747
6.572256 -636.96
6.574255 -628.006
6.576254 -619.058
6.578253 -610.372
6.580251 -601.722
6.58225 -593.129
6.585248 -584.606
6.587247 -576.156
6.589246 -567.795
6.592245 -559.53
6.592245 -551.362
6.594244 -543.3
6.60024 -535.322
6.60124 -527.423
6.60124 -519.569
6.604239 -511.794
6.604239 -504.081
6.606236 -496.454
6.608236 -488.941
6.610237 -481.509
6.612234 -474.169
6.614233 -466.906
6.61623 -459.686
6.618229 -452.529
6.620229 -444.29
6.622227 -438.431
6.624226 -418.453
6.626225 -376.641
6.628224 -293.612
6.630222 -372.172
6.632222 -370.207
6.634222 -342.622
6.63622 -387.704
6.638218 -388.784
6.640217 -382.948
6.642216 -376.25
6.644216 -370.363
6.646214 -364.2
6.648213 -358.086
6.650211 -352.007
6.652211 -345.991
6.65421 -340.022
6.656208 -334.119
6.658206 -328.317
6.660205 -322.595
6.662205 -316.902
6.664203 -311.301
6.666202 -305.742
6.668201 -300.225
6.6702 -294.75
6.672198 -289.323
6.674199 -283.993
6.676197 -278.724
6.678196 -273.545
6.680193 -268.413
6.682193 -263.319
6.684193 -258.272
6.687191 -253.271
6.689188 -248.292
6.691189 -243.394
6.695187 -238.568
6.695187 -233.808
6.697185 -229.108
6.699185 -224.46
6.701182 -219.839
6.703181 -215.258
6.70518 -210.723
6.707179 -206.232
6.709177 -201.805
6.711176 -197.453
6.713174 -193.161
6.715174 -188.925
6.717173 -184.707
6.719172 -180.517
6.721171 -176.358
6.723169 -172.246
6.725168 -168.209
6.730165 -164.222
6.734165 -160.285
6.734165 -156.382
6.735164 -154.328
6.737163 -151.844
6.737163 -147.996
6.739161 -144.119
6.741159 -140.215
6.743158 -136.106
6.745158 -131.595
6.747156 -127.462
6.749155 -123.92
6.751153 -120.148
6.753152 -115.721
6.755154 -112.003
6.75715 -107.719
6.759149 -103.546
6.761148 -99.7241
6.763149 -96.165
6.765145 -93.0234
6.767146 -88.5902
6.767146 -84.4235
6.773141 -79.1224
6.77614 -72.6124
6.77614 -68.0654
6.778139 -62.9195
6.778139 -59.5198
6.780138 -56.6111
6.782135 -53.937
6.784135 -50.3906
6.786133 -46.2572
6.788134 -42.3364
6.790131 -34.9261
6.79213 -26.0749
6.794128 -21.8548
6.796127 -18.9241
6.798126 -16.1219
6.800126 -12.2873
6.802125 -9.54045
6.805122 -5.08956
6.807121 -2.08658
6.809122 -0.04531
6.809122 4.366211
6.811119 7.647571
6.813118 10.77139
6.815117 13.486
6.817116 16.37893
6.819114 19.87792
6.821114 22.49086
6.823112 25.43032
6.825112 27.59332
6.82711 30.51719
6.82911 33.26129
6.831109 34.98137
6.833107 37.28277
6.835105 40.44568
6.837104 44.28815
6.839103 46.3599
6.841102 49.35477
6.843102 52.05956
6.8451 54.62616
6.8471 56.4586
6.850097 59.63188
6.853096 61.88437
6.855093 64.40225
6.861091 66.85651
6.86309 68.85804
6.864089 70.77302
6.864089 73.11574
6.866088 75.82446
6.866088 78.38586
6.868086 80.85267
6.870086 83.50539
6.872084 85.50301
6.874083 87.47917
6.876081 89.76604
6.878081 91.43018
6.880079 93.5584
6.882078 95.26148
6.884078 97.05516
6.886076 99.08549
6.888075 100.8353
6.890073 102.5426
6.892073 104.4462
6.894071 105.7351
6.89607 107.2711
6.89807 108.8058
6.903066 110.5969
6.905066 112.0763
6.905066 113.6704
6.907065 115.3641
6.909064 116.8518
6.909064 118.2229
6.911062 119.6783
6.913061 120.9934
6.91506 122.3841
6.917058 123.9788
6.919057 125.464
6.921056 126.631
6.923054 128.0014
6.925054 129.6026
6.927052 130.7827
6.929051 131.7979
6.93105 133.159
6.933049 134.3399
6.935048 135.2165
6.937048 136.1109
6.939045 137.2935
6.945042 138.235
6.948041 139.0824
6.948041 140.0449
6.95004 141.2205
6.95004 142.0929
6.952038 143.099
6.954038 144.2232
6.956038 145.0893
6.958037 145.9516
6.96005 146.9087
6.962034 147.5583
6.964034 148.3394
6.966032 149.2911
6.968032 150.0796
6.970028 150.7998
6.972027 151.6231
6.974026 152.4815
6.976025 153.1206
6.978024 153.533
6.980022 154.1727
6.986019 154.7068
6.989019 155.1737
6.989019 155.7696
6.990017 156.294
6.992015 156.8771
6.992015 157.4982
6.994014 157.9492
6.996013 158.5362
6.998012 159.0485
7.000011 159.5271
7.002009 160.0849
7.004009 160.6587
7.006008 161.0866
7.008006 161.5438
7.010005 162.0543
7.012004 162.3111
7.014002 162.6459
7.016003 163.197
7.018003 163.6098
7.019999 163.8961
7.021999 164.4491
7.026995 164.8175
7.029994 165.119
7.030993 165.6028
7.032994 165.9381
7.032994 166.1743
7.034991 166.6661
7.03699 167.0216
7.038989 167.1757
7.040989 167.5963
7.042985 167.9184
7.044985 168.1421
7.046985 168.3151
7.048982 168.4674
7.050982 168.6788
7.052981 168.8595
7.054979 169.1347
7.056979 169.3541
7.059976 169.5881
7.059976 169.8421
7.061975 169.8756
7.063975 169.8835
7.069971 170.0201
7.072969 170.081
7.073971 169.8862
7.073971 170.2223
7.075968 170.4187
7.075968 169.9634
7.077966 170.2005
7.079967 170.3453
7.081963 170.1
7.083963 170.0746
7.085961 170.1612
7.08796 170.2195
7.089958 170.0519
7.091958 169.9185
7.093956 170.0157
7.095956 169.6901
7.098953 169.6671
7.100953 169.8258
7.102952 169.6786
7.10495 169.4224
7.10695 169.5625
7.111946 169.4362
7.113945 169.1236
7.114945 168.9096
7.114945 168.823
7.116946 168.4672
7.118942 168.4161
7.120942 168.3383
7.12294 168.1032
7.124939 168.0498
7.126937 167.9284
7.128938 167.5371
7.130936 167.4433
7.132934 167.3786
7.134933 166.9073
7.136932 166.5702
7.138931 166.6945
7.14093 166.3292
7.142929 165.9293
7.144927 165.8595
7.146926 165.6535
7.148925 165.2087
7.153922 165.0613
7.156921 164.8679
7.156921 164.3869
7.156921 164.176
7.158922 163.939
7.160919 163.4177
7.162918 163.2695
7.164918 163.213
7.166915 162.6047
7.168913 162.3941
7.170913 162.3912
7.172911 161.8986
7.17491 161.4153
7.176908 161.3523
7.178908 160.9821
7.180907 160.3998
7.182906 160.278
7.184905 160.0473
7.186904 159.4666
7.188902 159.2784
7.190902 159.0804
7.195898 158.5516
7.197897 158.1809
7.197897 157.9026
7.199897 157.422
7.201896 157.0084
7.201896 156.7611
7.203894 156.3454
7.205893 155.9246
7.207891 155.6399
7.209889 155.2374
7.211889 154.7015
7.213888 154.3584
7.215886 154.0497
7.217887 153.6112
7.219884 153.185
7.221883 152.9069
7.223883 152.5624
7.225882 152.0973
7.22788 151.6786
7.229878 151.3029
7.231877 150.8857
7.233878 150.4329
7.238873 150.0656
7.242872 149.6794
7.242872 149.2617
7.242872 148.8169
7.244871 148.3509
7.24687 147.8903
7.24887 147.4539
7.250867 147.0196
7.252866 146.5736
7.254865 146.1978
7.256864 145.7908
7.258862 145.3437
7.260861 144.8409
7.262861 144.3478
7.264859 143.8838
7.266858 143.341
7.269856 142.8814
7.269856 142.5035
7.271854 141.9434
7.273857 141.4785
7.275854 141.1005
7.27985 140.5386
7.28385 139.9541
7.28485 139.5345
7.286847 139.025
7.286847 138.458
7.288846 138.048
7.290845 137.6063
7.292843 137.0192
7.294841 136.5222
7.296842 136.0165
7.29884 135.4328
7.300838 134.953
7.302838 134.5215
7.304836 134.0005
7.306834 133.5269
7.308834 133.1048
7.310833 132.5513
7.312831 131.992
7.31483 131.5622
7.31683 131.0893
7.318829 130.6033
7.322825 130.1884
7.324825 129.8079
7.324825 129.2779
7.326824 128.7917
7.328823 128.3614
7.330822 127.8725
7.332823 127.371
7.334819 126.9179
7.336817 126.4276
7.338817 125.9606
7.340816 125.5183
7.342814 124.9966
7.344813 124.4469
7.346812 123.9549
7.34881 123.4337
7.35081 122.8687
7.352808 122.3893
7.354807 121.9347
7.356805 121.4249
7.358805 120.9284
7.360806 120.4473
7.364801 119.9055
7.3688 119.3628
7.3688 118.8858
7.3688 118.3684
7.370799 117.856
7.372797 117.3925
7.374796 116.872
7.376796 116.3047
7.378794 115.774
7.380793 115.233
7.382793 114.6945
7.384789 114.1907
7.386789 113.6828
7.388788 113.1834
7.390786 112.6814
7.392786 112.1621
7.394784 111.6135
7.396783 111.0996
7.398781 110.5704
7.400781 110.0443
7.402781 109.5678
7.409777 109.1059
7.409777 108.6323
7.409777 108.1536
7.412774 107.6277
7.412774 107.1109
7.414773 106.6228
7.416772 106.1419
7.418771 105.6723
7.42077 105.2416
7.422768 104.834
7.424767 104.3555
7.426766 103.8537
7.428765 103.3712
7.430763 102.8606
7.432762 102.3579
7.434762 101.887
7.43676 101.408
7.438759 100.9246
7.441758 100.4705
7.443758 99.98105
7.447754 99.43892
7.449753 98.9369
7.449753 98.46317
7.449753 97.94021
7.452752 97.45898
7.454751 97.04469
7.456748 96.56067
7.458749 96.03065
7.460746 95.56767
7.462745 95.0264
7.464744 94.49927
7.466743 94.00122
7.468742 93.52367
  5 个评论
Jan
Jan 2022-7-24
@MAB: The format, you have posted your data in, is not useable. It impedes the reading of the question only.
Please explain, what this exactly means: "cumtrapz, which is not good for integrating nonlinear data". You are not only using the cumtrapz function, but apply some filters in different steps. Do you have good physical reasons for the coice of the parameters?
If you do not have an underlying model, the pure measurement data are the best you have. The noise in the results cannot vanish magically and you cannot simple obtain clean data, if the input is noisy.
Walter Roberson
Walter Roberson 2023-10-27
cumtrapz is quite vectorized. If it is too "inefficient" for your purposes, then you are not likely going to be able to find an faster integration method (that does not involve skipping data without examining it.)

请先登录,再进行评论。

回答(1 个)

Binaya
Binaya 2023-10-27
Hi,
Based on the provided description, it appears that you are seeking an alternative method to perform numerical integration on non-linear acceleration data, distinct from the utilization of the "cumtrapz" function. Please find the below suggestions for your query:
  • To evaluate non-linear acceleration data,one possible approach is to employ a spline interpolant.
  • By utilizing a spline interpolant, the data can be represented by a smoother curve, facilitating the subsequent integration using the "cumtrapz" function.
  • Integrating a spline interpolant can yield more accurate results compared to directly integrating the original non-linear data.
  • This is due to the nature of spline interpolation, which constructs a piecewise polynomial representation that closely approximates the data points.
  • By employing this two-step process, involving spline interpolation followed by integration using "cumtrapz," you can potentially achieve improved accuracy and reliability in the estimation of the displacement from non-linear acceleration data.
Please find the below documentation for more details on ‘Data interpolation with “spline”,”pchip” and “makima:https://www.mathworks.com/help/matlab/ref/pchip.html#:~:text=Data%20Interpolation%20with%20spline%2C%20pchip%2C%20and%20makima
I hope this helps.
Regards
Binaya

类别

Help CenterFile Exchange 中查找有关 Interpolation 的更多信息

产品


版本

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by