# MATLAB: Calculate the frequency response of acceleration data

hi to all,

I have a vector in Matlab which contains samples acquired at 10Hz from an accelerometer mounted on a frame's vehicle.
This vector contains the acceleration values along the Z-axis.
The acquisition time is 103 seconds.

I would like to plot the frequency values in Hz since I'm trying to study the terrain frequency response.

I tried to use the fft function available in Matlab, but I do not know how to proceed.

These are the values contained in my vector:

``````size(vibration)
ans =
1024           1
vibration =
-0.0005
-0.0006
-0.0007
-0.0008
-0.0010
-0.0011
-0.0012
-0.0013
-0.0014
-0.0015
-0.0016
-0.0017
-0.0018
-0.0019
-0.0020
-0.0021
-0.0022
-0.0023
-0.0024
-0.0026
-0.0027
-0.0025
-0.0003
-0.0038
-0.0089
-0.0035
-0.0018
-0.0022
0.0004
0.0034
0.0063
-0.0023
-0.0046
-0.0022
-0.0043
0.0041
0.0025
0.0024
0.0037
0.0050
0.0060
0.0012
0.0058
0.0019
0.0008
0.0009
-0.0060
0.0004
0.0032
-0.0005
-0.0008
-0.0024
0.0021
0.0009
-0.0019
0.0003
0.0012
0.0069
0.0125
0.0209
0.0262
0.0184
0.0100
0.0058
0.0136
0.0181
0.0089
0.0058
0.0077
0.0045
0.0024
0.0015
0.0044
0.0095
0.0096
0.0087
0.0019
0.0053
0.0066
0.0033
-0.0010
0.0010
0.0116
0.0059
0.0109
0.0151
0.0130
0.0152
0.0095
0.0127
0.0178
0.0180
0.0220
0.0234
0.0253
0.0288
0.0288
0.0263
0.0214
0.0119
0.0093
0.0074
0.0091
0.0182
0.0180
0.0144
0.0151
0.0192
0.0213
0.0212
0.0223
0.0183
0.0144
0.0203
0.0172
0.0158
0.0227
0.0189
0.0189
0.0219
0.0218
0.0262
0.0250
0.0178
0.0189
0.0147
0.0100
0.0128
0.0192
0.0197
0.0128
0.0148
0.0152
0.0144
0.0111
0.0067
0.0081
0.0040
0.0021
0.0086
0.0095
0.0098
0.0111
0.0102
0.0165
0.0163
0.0142
0.0146
0.0121
0.0107
0.0090
0.0095
0.0126
0.0155
0.0151
0.0114
0.0100
0.0045
0.0046
0.0052
-0.0068
-0.0033
-0.0055
-0.0136
-0.0035
-0.0038
-0.0029
0.0013
0.0043
0.0117
0.0176
0.0278
0.0228
0.0096
0.0099
0.0153
0.0119
0.0048
0.0104
0.0126
0.0064
0.0092
0.0088
0.0104
0.0113
0.0105
0.0249
0.0307
0.0266
0.0258
0.0254
0.0254
0.0258
0.0239
0.0224
0.0226
0.0229
0.0220
0.0197
0.0201
0.0169
0.0246
0.0264
0.0273
0.0366
0.0282
0.0300
0.0323
0.0320
0.0259
0.0097
0.0103
-0.0052
-0.0069
0.0156
0.0098
0.0025
0.0081
0.0118
0.0085
0.0094
0.0117
0.0091
0.0139
0.0135
0.0153
0.0103
-0.0005
-0.0056
-0.0039
0.0044
0.0014
0.0021
0.0019
-0.0011
-0.0018
0.0034
0.0083
0.0046
0.0173
0.0218
0.0203
0.0210
0.0144
0.0095
0.0044
0.0048
0.0014
-0.0001
0.0034
0.0065
0.0110
0.0081
0.0147
0.0218
0.0131
0.0167
0.0201
0.0207
0.0193
0.0188
0.0171
0.0170
0.0203
0.0079
0.0045
0.0063
0.0012
0.0011
0.0058
0.0094
0.0072
0.0143
0.0257
0.0265
0.0185
0.0149
0.0157
0.0158
0.0171
0.0093
0.0055
0.0091
0.0054
0.0061
0.0141
0.0177
0.0173
0.0172
0.0205
0.0189
0.0193
0.0289
0.0252
0.0202
0.0137
0.0122
0.0184
0.0085
0.0098
0.0220
0.0178
0.0205
0.0207
0.0192
0.0264
0.0236
0.0172
0.0221
0.0215
0.0175
0.0173
0.0129
0.0153
0.0024
-0.0026
0.0164
0.0173
0.0113
0.0095
0.0081
0.0149
0.0192
0.0118
0.0157
0.0196
0.0159
0.0136
0.0131
0.0137
0.0111
0.0108
0.0079
0.0020
0.0017
0.0067
0.0092
0.0067
0.0054
0.0130
0.0126
0.0064
0.0127
0.0097
0.0059
0.0081
0.0047
0.0089
0.0153
0.0047
0.0054
0.0121
0.0008
0.0005
0.0047
0.0051
0.0014
0.0026
0.0098
0.0038
0.0065
0.0128
0.0075
0.0034
0.0052
0.0041
0.0040
0.0053
0.0064
0.0067
0.0049
0.0057
0.0013
0.0045
0.0037
0.0038
0.0058
0.0010
0.0080
0.0058
0.0007
0.0040
0.0029
0.0024
0.0027
0.0019
0.0038
0.0033
0.0036
0.0020
0.0030
0.0036
-0.0048
0.0057
0.0095
0.0013
0.0047
0.0087
0.0048
0.0004
0.0053
0.0039
0.0027
0.0011
0.0040
0.0054
0.0060
0.0093
0.0071
0.0064
0.0033
0.0134
0.0111
0.0066
0.0141
0.0076
0.0062
0.0043
0.0098
0.0087
0.0038
0.0145
0.0082
0.0053
0.0106
0.0084
0.0088
0.0074
0.0121
0.0101
0.0079
0.0142
0.0111
0.0126
0.0126
0.0115
0.0068
0.0088
0.0098
0.0065
0.0096
0.0068
0.0088
0.0065
0.0086
0.0044
0.0038
0.0087
0.0021
0.0056
0.0088
0.0105
0.0016
0.0039
0.0111
0.0025
0.0090
0.0101
0.0102
0.0091
0.0067
0.0102
0.0023
0.0073
0.0106
0.0017
0.0022
0.0082
0.0072
0.0027
0.0022
0.0006
0.0064
0.0062
0.0050
0.0088
0.0085
0.0087
0.0003
0.0064
0.0046
-0.0037
0.0003
-0.0012
-0.0029
-0.0063
0.0063
0.0071
-0.0045
0.0051
0.0086
0.0078
0.0118
0.0137
0.0093
0.0064
0.0094
0.0054
0.0047
0.0058
0.0058
0.0062
0.0075
0.0082
0.0057
0.0068
0.0046
0.0070
0.0080
0.0041
0.0062
0.0108
0.0100
0.0009
0.0067
0.0135
0.0061
0.0082
0.0120
0.0148
0.0104
0.0125
0.0220
0.0127
0.0146
0.0190
0.0095
0.0083
0.0084
0.0131
0.0132
0.0002
-0.0040
0.0012
0.0045
0.0051
0.0055
0.0046
0.0081
0.0086
0.0079
0.0052
0.0028
0.0034
-0.0008
0.0059
0.0064
0.0060
0.0082
0.0058
0.0122
0.0072
0.0046
0.0115
0.0118
0.0114
0.0031
0.0011
-0.0032
-0.0014
0.0033
-0.0022
0.0088
0.0039
0.0071
0.0128
0.0110
0.0196
0.0114
0.0123
0.0129
0.0092
0.0138
0.0170
0.0156
0.0146
0.0208
0.0215
0.0171
0.0126
0.0147
0.0133
0.0117
0.0158
0.0104
0.0145
0.0085
0.0039
0.0119
0.0073
0.0041
0.0057
0.0145
0.0084
0.0030
0.0125
0.0096
0.0155
0.0187
0.0200
0.0217
0.0145
0.0115
-0.0015
0.0018
0.0021
0.0001
0.0045
0.0006
0.0078
0.0110
0.0117
0.0092
0.0061
0.0057
-0.0001
-0.0064
-0.0070
-0.0007
-0.0005
0.0008
0.0067
0.0059
0.0047
0.0020
0.0101
0.0121
0.0059
0.0056
0.0033
0.0066
0.0065
0.0019
0.0005
0.0009
0.0052
0.0013
0.0045
0.0151
0.0108
0.0069
0.0030
0.0069
0.0187
0.0201
0.0222
0.0242
0.0204
0.0176
0.0147
0.0175
0.0147
0.0150
0.0218
0.0237
0.0262
0.0246
0.0278
0.0273
0.0204
0.0219
0.0233
0.0134
0.0112
0.0210
0.0184
0.0173
0.0201
0.0220
0.0226
0.0170
0.0195
0.0241
0.0181
0.0173
0.0201
0.0163
0.0233
0.0109
-0.0011
0.0139
0.0114
0.0131
0.0152
0.0099
0.0145
0.0111
0.0166
0.0111
0.0042
0.0161
0.0044
0.0013
0.0024
-0.0080
-0.0007
-0.0046
-0.0063
0.0038
-0.0002
-0.0014
0.0060
0.0090
0.0099
0.0113
0.0059
0.0093
0.0050
0.0023
0.0084
0.0051
0.0116
0.0110
0.0049
0.0089
0.0079
0.0087
0.0056
0.0013
0.0107
0.0049
-0.0032
0.0029
0.0027
-0.0001
-0.0005
-0.0012
-0.0007
-0.0041
0.0029
0.0106
0.0028
0.0063
0.0067
0.0056
0.0080
0.0005
0.0041
0.0071
0.0016
0.0047
0.0013
-0.0083
-0.0093
-0.0066
-0.0048
-0.0084
-0.0041
0.0048
-0.0013
-0.0009
0.0054
0.0024
0.0044
0.0070
0.0092
0.0126
0.0105
0.0066
-0.0084
-0.0062
0.0009
-0.0096
0.0054
0.0046
-0.0007
0.0056
0.0027
0.0205
0.0265
0.0252
0.0249
0.0287
0.0363
0.0351
0.0355
0.0185
0.0079
0.0167
0.0228
0.0211
0.0137
0.0222
0.0297
0.0377
0.0416
0.0472
0.0668
0.0572
0.0566
0.0728
0.0675
0.0658
0.0705
0.0674
0.0652
0.0653
0.0617
0.0637
0.0714
0.0830
0.0796
0.0766
0.0861
0.0721
0.0707
0.0762
0.0722
0.0715
0.0530
0.0486
0.0456
0.0445
0.0452
0.0348
0.0395
0.0392
0.0562
0.0711
0.0595
0.0531
0.0511
0.0580
0.0545
0.0495
0.0416
0.0356
0.0306
0.0163
0.0207
0.0138
0.0025
0.0061
0.0047
0.0013
-0.0002
0.0014
0.0019
0.0013
0.0012
0.0009
0.0014
0.0011
0.0012
0.0014
0.0011
0.0013
0.0013
0.0013
0.0012
0.0012
0.0012
0.0011
0.0011
0.0010
0.0010
0.0011
0.0011
0.0010
0.0010
0.0012
0.0012
0.0012
0.0011
0.0010
0.0010
0.0009
0.0009
0.0009
0.0009
0.0009
0.0008
0.0007
0.0007
0.0007
0.0007
0.0008
0.0009
0.0009
0.0010
0.0010
0.0009
0.0009
0.0008
0.0007
0.0007
0.0007
0.0007
0.0007
0.0008
0.0008
0.0008
0.0007
0.0008
0.0009
0.0008
0.0008
0.0008
0.0008
0.0008
0.0008
0.0008
0.0007
0.0006
0.0007
0.0008
0.0008
0.0007
0.0007
0.0007
0.0007
0.0007
0.0006
0.0006
0.0006
0.0005
0.0006
0.0006
0.0005
0.0005
0.0004
0.0005
0.0006
0.0006
0.0007
0.0008
0.0008
0.0007
0.0006
0.0007
0.0007
0.0007
0.0007
0.0008
0.0007
0.0007
0.0007
0.0006
0.0004
0.0003
0.0003
0.0004
0.0003
0.0003
0.0003
0.0002
0.0002
0.0002
0.0002
0.0001
0.0001
0.0001
0.0002
0.0003
0.0003
0.0004
0.0004
0.0003
0.0003
0.0003
0.0001
0.0001
0.0001
0.0000
-0.0000
-0.0001
-0.0001
-0.0002
-0.0002
-0.0002
-0.0002
-0.0003
-0.0003
-0.0003
-0.0004
-0.0004
-0.0004
-0.0004
-0.0003
-0.0002
-0.0002
-0.0002
-0.0002
-0.0002
-0.0002
-0.0001
-0.0001
-0.0002
-0.0002
-0.0002
-0.0002
-0.0002
-0.0003
-0.0003
-0.0004
-0.0005
-0.0004
-0.0004
-0.0004
-0.0003
-0.0004
-0.0003
-0.0004
-0.0006
-0.0006
-0.0006
-0.0006
-0.0007
-0.0007
-0.0007
-0.0007
-0.0007
-0.0008
-0.0008
-0.0008
-0.0008
-0.0009
-0.0009
-0.0009
-0.0009
-0.0009
-0.0010
-0.0010
-0.0010
``````
###### Who is Participating?

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Commented:
This should be pretty simple:

X = [ Your data ... ]
Y = fft( X)         This the complex FFT of your data
plot( abs( Y))   You take the absolute value to get amplitude

This is the plot:
Commented:
Did you witness this test?  If so, how would you describe the vehicle motion?
Have you plotted the raw acceleration data?  How well does this relate to the observed motion?
Do you understand how to interpret the output of the an FFT?
R&D EngineerAuthor Commented:
Thank you for your help, d-glitch.

I plotted the raw data and this is the result:

The vehicle was moving in the mud, so I expect to see "soft and smooth" values compared to the asphalt case.
The peak at the end of the graph is caused by a terrain change (from mud to grass).
I studied the FFT when I was at the university even if I do not remember it very well (i studied it in 2009).

I would like to find the Fundamental frequency in order to check if I'm able to compare the frequency in different tests.
If this is true, it would be possible to use the fundamental frequency as a criteria to detect the terrain type.
Commented:
Looking at the raw data:
• You were accelerating in the mud for 7.5 seconds.  The signal is noisy but almost always positive.
• You transition from mud to asphalt between 7.5 and 8.5 seconds.  The signal peaks, since you suddenly have more power than you need.
• You drive on asphalt between 8.5 and 10.2 seconds.  Minimal and smooth acceleration.
I think you can probably interpret the raw data better than the FFT.
What sort of "fundamental frequency" were you expecting to see?

What sort of time resolution do you need for the terrain classification?
In this case it looks like the terrain transition takes 1 second.  How fast were you moving?

10 seconds is clearly the wrong size chunk of data to analyze.
The sample size should probably cover no more that the time required to travel one wheel base distance.
R&D EngineerAuthor Commented:
I'm working at 10Hz, so I expect to have 10 samples per second and this should be enough for terrain classification.
The raw acceleration data comes from the Z-axis, so the graph of the raw data shows the interaction between the terrain and the robot.

I expect to see high values when the vehicle travels on gravel and lower values when it moves on sandy terrains.
The vehicle moves about 0.8 - 1 m/s and it uses tracks and not wheels so in this case I expect to see lower values along the Z axis since the tracks offer more stability than the wheels.

I would like to check if the fundamental frequency changes significantly depending on the terrain.
R&D EngineerAuthor Commented:
Take a look at these data coming from a test over the asphalt.
The first picture is related to the raw data while the second comes from the FFT.

Commented:
I think there is no question that this will work, but you have some work to do.
The closest thing you have to a fundamental frequency is track segments per second.
The right sample size for the FFT is still going to be the time required to travel one vehicle length.

If you run FFT's for the the first 128 sample you will find a MUD signature.
If you run FFT's for the the last 128 sample you will find a ASPH signature.
You may have to do tests for gravel, sand, snow, ...

And you may be able to find signatures for the transitions: half the track in mud, and half on gravel.
R&D EngineerAuthor Commented:
I already did all the test on different terrains/surfaces and now I would like to find a way to compare them by using some kind of signature.

Honestly, I already successfully considered the currents, the torque, the pitch and roll angle, the slip effects and with these parameters I'm already able to detect the terrain, but I would like to add also the information about the frequency.

Please, can you explain me what you mean with:

If you run FFT's for the the first 128 sample you will find a MUD signature.
If you run FFT's for the the last 128 sample you will find a ASPH signature.

Why do you suggest to consider the first 128 samples?

The vehicle takes about 2.5 seconds to cover the track length (the track contact surface is about 100 cm)
Commented:
Your last two plots are examples of way to much data.
That little peak around 750 probably corresponds to track_segments/second.  Everything else is noise.

Do you know why you don't see much in the way of negative signals?  You may have an offset issue.

The secret to interpreting an FFT is to look at the results of perfect data.  For example: Assume 16 samples at 10Hz.
The fastest signal you can see is:
[ +1  -1  +1  -1  +1  -1  +1  -1  +1  -1  +1  -1  +1  -1  +1  -1 ]  => 5.000 Hz
The slowest signal you can see is:
[ +1  +1  +1  +1  +1  +1  +1  +1  -1  -1  -1  -1  -1  -1  -1  -1 ]  =>0.625 Hz
R&D EngineerAuthor Commented:
in effect, I do not know if it is a coincidence or not, but the same peak is present again at 1500, exactly after 750.

What do you mean when you say "track_segments/second"?
Are you referring to the numbers of track links/pad which touch the terrain in a second?
Commented:
It is not a coincidence. The FFT is symmetric, with the lower half mirroring the upper half.
R&D EngineerAuthor Commented:
How the FFT window is connected to the time and the number of samples?
For example, why the FFT goes from 0 to 1000 and then it mirrors from 1000 to 2000?

What is the relation?
Commented:
Looking at your 1024 sample Mud/Asphalt case:  You can hope to find a signature here because the FFT combines both cases and smears everything out.

Your 2200 sample case also seems to have a terrain change at the beginning.  How many samples were there in this case?
I am not sure what Matlab does with odd sample sizes (not 1024 or 2048) so I don't know exactly what frequency is associate with the 750 spike.

If the sample size was 2048  =>  204.8 s   then the lowest freq would be  1/204.8 s  =  4.883 mHz
That would put the peak at 750 x 4.883 mHz =>  3.66 Hz

Are you running Matlab on the robot?  I'm sure running smaller samples will save you processing time and give you less confusing results.
Commented:
We are a little out of synch.

Lock again my 16-sample max and min freq case.  There are 16 samples, but there are only 8 possible frequency values in the result.

What the 16-sample FFT does is take 16 amplitude values and return 16 complex numbers, corresponding to 8 frequency and 8 phase values.
This matrix is always symmetric, since you can reverse the time signal and not change the FFT.

When you take the absolute value, you basically discard the phase information.
R&D EngineerAuthor Commented:
The total time for the second case is 219 seconds and the elements in the raw acceleration vector are 2182.

I don't know why it seems that there is a terrain change since the only difference is that in some area the asphalt was wet.
I'm not running Matlab on the robot since I analyze the data offline on a different computer.

So, what I should do is: running short tests and check for the signature by finding the lowest and the highest frequency for each terrain and then use these two "parameters" to detect the terrain features?

These are the values for the second case:

``````vibration =
0.0010
0.0010
0.0010
0.0009
0.0009
0.0009
0.0009
0.0008
0.0008
0.0008
0.0007
0.0007
0.0007
0.0006
0.0006
0.0006
0.0006
0.0005
0.0005
0.0005
0.0004
0.0004
0.0004
0.0004
0.0003
0.0002
0.0003
0.0003
0.0003
0.0004
0.0003
0.0002
0.0002
0.0002
0.0002
0.0001
0.0001
0.0000
0.0000
0.0000
0.0000
-0.0000
0.0000
-0.0000
-0.0001
-0.0001
-0.0001
-0.0001
-0.0001
-0.0001
-0.0001
-0.0002
-0.0002
-0.0001
-0.0000
0.0000
0.0001
-0.0000
0.0000
0.0001
0.0001
-0.0000
-0.0001
-0.0000
0.0000
0.0000
0.0001
0.0001
0.0001
0.0001
0.0001
0.0001
0.0001
0.0002
0.0001
0.0001
0.0002
0.0002
0.0002
0.0002
0.0002
0.0002
0.0002
0.0001
0.0001
0.0001
0.0002
0.0002
0.0003
0.0004
0.0004
0.0004
0.0004
0.0004
0.0004
0.0003
0.0003
0.0003
0.0005
0.0004
0.0004
0.0004
0.0005
0.0005
0.0004
0.0003
0.0002
0.0002
0.0002
0.0002
0.0002
0.0002
0.0002
0.0002
0.0002
0.0003
0.0003
0.0003
0.0003
0.0003
0.0002
0.0003
0.0003
0.0004
0.0003
0.0003
0.0004
0.0003
0.0003
0.0003
0.0003
0.0003
0.0004
0.0004
0.0003
0.0003
0.0002
0.0002
0.0001
0.0001
0.0002
0.0002
0.0003
0.0002
0.0001
0.0002
0.0002
0.0002
0.0002
0.0001
0.0001
0.0001
-0.0001
-0.0001
-0.0001
-0.0001
-0.0001
-0.0000
-0.0000
-0.0001
-0.0000
-0.0001
-0.0001
-0.0000
-0.0001
-0.0000
-0.0001
-0.0002
-0.0003
-0.0003
-0.0005
-0.0006
-0.0004
-0.0008
-0.0005
-0.0009
-0.0006
-0.0005
-0.0009
0.0001
-0.0024
-0.0006
-0.0035
-0.0021
0.0056
-0.0040
-0.0014
0.0002
0.0008
0.0054
-0.0012
0.0001
0.0044
0.0045
0.0029
0.0061
0.0048
0.0036
0.0079
0.0074
0.0072
0.0026
0.0045
0.0077
0.0083
0.0116
0.0071
0.0107
0.0140
0.0118
0.0147
0.0146
0.0154
0.0145
0.0117
0.0127
0.0130
0.0126
0.0108
0.0133
0.0143
0.0169
0.0149
0.0169
0.0175
0.0086
0.0192
0.0177
0.0154
0.0169
0.0099
0.0180
0.0164
0.0113
0.0114
0.0144
0.0125
0.0111
0.0150
0.0141
0.0136
0.0112
0.0153
0.0138
0.0124
0.0125
0.0097
0.0140
0.0110
0.0081
0.0084
0.0056
0.0036
0.0039
0.0073
0.0079
0.0091
0.0089
0.0113
0.0134
0.0129
0.0107
0.0113
0.0163
0.0138
0.0107
0.0097
0.0082
0.0100
0.0083
0.0076
0.0080
0.0092
0.0083
0.0071
0.0089
0.0090
0.0088
0.0115
0.0099
0.0048
0.0097
0.0168
0.0156
0.0145
0.0123
0.0118
0.0078
0.0078
0.0100
0.0078
0.0105
0.0085
0.0131
0.0136
0.0136
0.0174
0.0128
0.0143
0.0121
0.0154
0.0166
0.0132
0.0150
0.0122
0.0142
0.0152
0.0193
0.0174
0.0157
0.0147
0.0152
0.0226
0.0184
0.0190
0.0195
0.0228
0.0180
0.0148
0.0198
0.0160
0.0158
0.0146
0.0103
0.0105
0.0135
0.0129
0.0120
0.0169
0.0155
0.0131
0.0175
0.0179
0.0176
0.0174
0.0145
0.0107
0.0097
0.0126
0.0163
0.0149
0.0114
0.0113
0.0115
0.0114
0.0078
0.0107
0.0114
0.0059
0.0117
0.0120
0.0185
0.0145
0.0047
0.0048
0.0067
0.0109
0.0035
0.0118
0.0163
0.0130
0.0180
0.0167
0.0139
0.0131
0.0145
0.0068
0.0109
0.0135
0.0094
0.0139
0.0127
0.0110
0.0091
0.0130
0.0126
0.0124
0.0160
0.0139
0.0134
0.0088
0.0078
0.0072
0.0082
0.0119
0.0053
0.0088
0.0077
0.0072
0.0085
0.0056
0.0049
0.0022
0.0066
0.0086
0.0123
0.0124
0.0110
0.0149
0.0045
0.0073
0.0050
0.0035
0.0053
0.0018
0.0041
0.0034
0.0095
0.0020
0.0006
0.0055
0.0018
0.0100
0.0122
0.0128
0.0119
0.0111
0.0110
0.0068
0.0090
0.0063
0.0076
0.0103
0.0093
0.0101
0.0138
0.0127
0.0133
0.0141
0.0113
0.0151
0.0151
0.0125
0.0121
0.0117
0.0123
0.0093
0.0120
0.0097
0.0068
0.0141
0.0073
0.0068
0.0114
0.0106
0.0112
0.0138
0.0134
0.0124
0.0197
0.0175
0.0163
0.0209
0.0111
0.0085
0.0107
0.0114
0.0081
0.0088
0.0093
0.0033
0.0090
0.0095
0.0052
0.0113
0.0095
0.0048
0.0110
0.0131
0.0102
0.0141
0.0178
0.0123
0.0142
0.0144
0.0105
0.0116
0.0140
0.0095
0.0092
0.0139
0.0122
0.0130
0.0173
0.0106
0.0120
0.0189
0.0150
0.0138
0.0177
0.0143
0.0140
0.0146
0.0118
0.0087
0.0134
0.0153
0.0091
0.0170
0.0168
0.0159
0.0230
0.0228
0.0182
0.0228
0.0216
0.0127
0.0178
0.0185
0.0094
0.0150
0.0126
0.0080
0.0125
0.0140
0.0114
0.0127
0.0165
0.0151
0.0154
0.0168
0.0121
0.0103
0.0159
0.0112
0.0108
0.0173
0.0095
0.0111
0.0164
0.0098
0.0100
0.0158
0.0128
0.0117
0.0192
0.0129
0.0087
0.0138
0.0087
0.0076
0.0124
0.0114
0.0067
0.0109
0.0084
0.0046
0.0112
0.0084
0.0033
0.0094
0.0086
0.0031
0.0063
0.0058
0.0023
0.0061
0.0101
0.0067
0.0058
0.0116
0.0110
0.0181
0.0232
0.0141
0.0166
0.0164
0.0086
0.0052
0.0034
0.0017
0.0027
0.0059
0.0038
0.0050
0.0088
0.0109
0.0102
0.0114
0.0139
0.0126
0.0148
0.0111
0.0106
0.0126
0.0110
0.0139
0.0138
0.0159
0.0138
0.0174
0.0184
0.0176
0.0225
0.0180
0.0188
0.0219
0.0209
0.0175
0.0177
0.0200
0.0155
0.0158
0.0107
0.0092
0.0104
0.0093
0.0125
0.0118
0.0195
0.0204
0.0200
0.0233
0.0227
0.0181
0.0180
0.0202
0.0177
0.0165
0.0151
0.0110
0.0103
0.0097
0.0136
0.0115
0.0121
0.0162
0.0118
0.0129
0.0126
0.0127
0.0123
0.0097
0.0073
0.0102
0.0142
0.0142
0.0101
0.0110
0.0110
0.0097
0.0095
0.0101
0.0082
0.0109
0.0086
0.0068
0.0137
0.0141
0.0120
0.0140
0.0132
0.0103
0.0106
0.0082
0.0081
0.0089
0.0048
0.0024
0.0059
0.0069
0.0057
0.0104
0.0112
0.0107
0.0157
0.0118
0.0088
0.0114
0.0133
0.0102
0.0102
0.0150
0.0159
0.0138
0.0115
0.0084
0.0098
0.0115
0.0083
0.0101
0.0150
0.0129
0.0104
0.0161
0.0117
0.0094
0.0180
0.0087
0.0052
0.0159
0.0106
0.0084
0.0161
0.0116
0.0121
0.0167
0.0149
0.0122
0.0117
0.0140
0.0139
0.0169
0.0127
0.0119
0.0114
0.0069
0.0135
0.0133
0.0099
0.0071
0.0123
0.0131
0.0029
0.0065
0.0111
0.0085
0.0130
0.0127
0.0146
0.0148
0.0131
0.0104
0.0102
0.0125
0.0102
0.0103
0.0148
0.0108
0.0119
0.0171
0.0097
0.0123
0.0196
0.0152
0.0136
0.0183
0.0169
0.0174
0.0224
0.0262
0.0241
0.0196
0.0176
0.0213
0.0264
0.0231
0.0221
0.0226
0.0226
0.0257
0.0235
0.0175
0.0147
0.0272
0.0310
0.0233
0.0286
0.0255
0.0185
0.0181
0.0232
0.0225
0.0208
0.0246
0.0241
0.0217
0.0258
0.0208
0.0207
0.0265
0.0203
0.0193
0.0228
0.0158
0.0134
0.0188
0.0140
0.0120
0.0165
0.0145
0.0078
0.0129
0.0185
0.0156
0.0087
0.0020
0.0063
0.0056
0.0049
0.0082
0.0089
0.0159
0.0166
0.0224
0.0157
0.0048
0.0082
0.0062
0.0048
0.0115
0.0126
0.0061
0.0049
0.0038
0.0054
0.0085
0.0082
0.0023
0.0102
0.0064
0.0044
0.0122
0.0113
0.0084
0.0071
0.0101
0.0100
0.0136
0.0195
0.0149
0.0151
0.0175
0.0071
0.0072
0.0145
0.0162
0.0201
0.0199
0.0205
0.0199
0.0152
0.0146
0.0119
0.0127
0.0078
0.0072
0.0117
0.0081
0.0113
0.0134
0.0119
0.0132
0.0198
0.0225
0.0229
0.0232
0.0194
0.0159
0.0178
0.0092
0.0122
0.0073
0.0036
0.0089
0.0107
0.0176
0.0143
0.0159
0.0127
0.0079
0.0089
0.0063
0.0078
0.0119
0.0112
0.0094
0.0131
0.0101
0.0078
0.0123
0.0093
0.0099
0.0077
0.0078
0.0076
0.0088
0.0095
0.0091
0.0174
0.0153
0.0143
0.0143
0.0139
0.0137
0.0131
0.0114
0.0038
0.0049
0.0052
0.0042
0.0119
0.0110
0.0214
0.0226
0.0195
0.0213
0.0166
0.0185
0.0143
0.0161
0.0160
0.0148
0.0205
0.0175
0.0182
0.0208
0.0178
0.0163
0.0190
0.0165
0.0120
0.0160
0.0138
0.0178
0.0184
0.0226
0.0221
0.0208
0.0223
0.0160
0.0205
0.0176
0.0102
0.0127
0.0091
0.0087
0.0097
0.0150
0.0173
0.0267
0.0334
0.0232
0.0288
0.0219
0.0160
0.0150
0.0122
0.0151
0.0120
0.0182
0.0158
0.0150
0.0208
0.0141
0.0173
0.0182
0.0148
0.0138
0.0167
0.0143
0.0137
0.0201
0.0184
0.0197
0.0195
0.0181
0.0114
0.0170
0.0199
0.0093
0.0116
0.0050
0.0080
0.0174
0.0141
0.0152
0.0175
0.0262
0.0192
0.0175
0.0167
0.0087
0.0138
0.0098
0.0089
0.0117
0.0127
0.0113
0.0086
0.0140
0.0117
0.0112
0.0168
0.0141
0.0137
0.0145
0.0102
0.0069
0.0128
0.0117
0.0113
0.0140
0.0133
0.0102
0.0086
0.0135
0.0059
0.0028
0.0056
0.0030
0.0122
0.0147
0.0172
0.0172
0.0192
0.0182
0.0144
0.0154
0.0101
0.0096
0.0068
0.0046
0.0075
0.0109
0.0140
0.0095
0.0090
0.0134
0.0130
0.0157
0.0155
0.0141
0.0143
0.0123
0.0074
0.0050
0.0082
0.0106
0.0081
0.0099
0.0100
0.0092
0.0138
0.0126
0.0138
0.0196
0.0157
0.0216
0.0272
0.0170
0.0130
0.0120
0.0120
0.0091
0.0091
0.0101
0.0101
0.0117
0.0121
0.0075
0.0099
0.0176
0.0193
0.0161
0.0136
0.0120
0.0151
0.0135
0.0137
0.0136
0.0141
0.0146
0.0114
0.0134
0.0141
0.0168
0.0179
0.0161
0.0135
0.0198
0.0198
0.0139
0.0175
0.0147
0.0112
0.0111
0.0083
0.0059
0.0052
0.0109
0.0107
0.0150
0.0182
0.0161
0.0197
0.0185
0.0130
0.0130
0.0156
0.0109
0.0112
0.0166
0.0101
0.0072
0.0126
0.0111
0.0086
0.0134
0.0138
0.0036
0.0036
-0.0037
-0.0047
0.0141
0.0150
0.0109
0.0148
0.0191
0.0172
0.0190
0.0193
0.0157
0.0158
0.0140
0.0102
0.0118
0.0178
0.0148
0.0197
0.0266
0.0216
0.0244
0.0216
0.0187
0.0190
0.0139
0.0175
0.0189
0.0214
0.0214
0.0203
0.0262
0.0223
0.0228
0.0222
0.0195
0.0197
0.0213
0.0180
0.0218
0.0325
0.0322
0.0344
0.0341
0.0188
0.0167
0.0166
0.0153
0.0164
0.0130
0.0191
0.0165
0.0124
0.0193
0.0207
0.0218
0.0193
0.0184
0.0202
0.0100
0.0077
0.0112
0.0112
0.0085
0.0117
0.0140
0.0150
0.0130
0.0110
0.0118
0.0080
0.0097
0.0069
0.0088
0.0106
0.0074
0.0082
0.0110
0.0090
0.0108
0.0096
0.0061
0.0033
0.0103
0.0094
0.0035
0.0081
0.0077
0.0069
0.0090
0.0093
0.0082
0.0170
0.0164
0.0075
0.0097
0.0151
0.0160
0.0167
0.0192
0.0193
0.0187
0.0174
0.0118
0.0191
0.0161
0.0105
0.0132
0.0163
0.0214
0.0188
0.0242
0.0227
0.0201
0.0210
0.0159
0.0151
0.0186
0.0170
0.0172
0.0196
0.0197
0.0198
0.0278
0.0261
0.0227
0.0306
0.0272
0.0214
0.0252
0.0228
0.0237
0.0213
0.0157
0.0200
0.0228
0.0232
0.0188
0.0183
0.0176
0.0139
0.0162
0.0180
0.0132
0.0199
0.0192
0.0140
0.0240
0.0226
0.0111
0.0147
0.0142
0.0065
0.0119
0.0147
0.0140
0.0166
0.0214
0.0135
0.0162
0.0205
0.0135
0.0175
0.0121
0.0108
0.0103
0.0113
0.0088
0.0066
0.0184
0.0065
0.0099
0.0150
0.0070
0.0083
0.0078
0.0147
0.0080
0.0061
0.0138
0.0109
0.0064
0.0104
0.0108
0.0072
0.0094
0.0129
0.0091
0.0072
0.0097
0.0122
0.0088
0.0072
0.0187
0.0161
0.0165
0.0146
0.0124
0.0174
0.0189
0.0152
0.0129
0.0175
0.0134
0.0188
0.0190
0.0140
0.0157
0.0181
0.0182
0.0165
0.0284
0.0207
0.0167
0.0273
0.0194
0.0205
0.0215
0.0215
0.0219
0.0208
0.0146
0.0174
0.0220
0.0116
0.0180
0.0189
0.0104
0.0210
0.0208
0.0204
0.0226
0.0221
0.0233
0.0135
0.0174
0.0157
0.0143
0.0188
0.0121
0.0134
0.0188
0.0167
0.0143
0.0153
0.0142
0.0145
0.0133
0.0122
0.0162
0.0104
0.0082
0.0103
0.0080
0.0128
0.0124
0.0128
0.0123
0.0074
0.0147
0.0191
0.0098
0.0133
0.0205
0.0181
0.0202
0.0199
0.0191
0.0199
0.0194
0.0146
0.0141
0.0175
0.0084
0.0152
0.0194
0.0133
0.0150
0.0190
0.0173
0.0099
0.0166
0.0181
0.0153
0.0194
0.0206
0.0179
0.0140
0.0259
0.0220
0.0143
0.0253
0.0165
0.0174
0.0188
0.0136
0.0165
0.0138
0.0170
0.0153
0.0164
0.0130
0.0110
0.0142
0.0099
0.0119
0.0183
0.0172
0.0082
0.0159
0.0171
0.0139
0.0127
0.0084
0.0157
0.0125
0.0170
0.0163
0.0171
0.0163
0.0145
0.0256
0.0155
0.0094
0.0130
0.0103
0.0133
0.0118
0.0174
0.0059
0.0077
0.0170
0.0078
0.0180
0.0094
0.0127
0.0154
0.0099
0.0240
0.0211
0.0236
0.0183
0.0177
0.0233
0.0215
0.0227
0.0152
0.0139
0.0151
0.0214
0.0183
0.0148
0.0189
0.0200
0.0252
0.0210
0.0196
0.0142
0.0152
0.0146
0.0112
0.0126
0.0105
0.0164
0.0182
0.0188
0.0199
0.0151
0.0213
0.0139
0.0187
0.0230
0.0148
0.0189
0.0165
0.0184
0.0197
0.0210
0.0187
0.0119
0.0096
0.0095
0.0109
0.0093
0.0125
0.0146
0.0139
0.0166
0.0144
0.0122
0.0119
0.0099
0.0096
0.0145
0.0085
0.0036
0.0116
0.0147
0.0137
0.0155
0.0142
0.0200
0.0300
0.0243
0.0167
0.0102
0.0144
0.0185
0.0128
0.0172
0.0177
0.0128
0.0119
0.0158
0.0163
0.0125
0.0154
0.0150
0.0115
0.0152
0.0142
0.0158
0.0178
0.0162
0.0169
0.0155
0.0131
0.0114
0.0136
0.0120
0.0128
0.0147
0.0168
0.0168
0.0141
0.0226
0.0216
0.0175
0.0154
0.0096
0.0109
0.0140
0.0077
-0.0022
0.0060
0.0136
0.0203
0.0205
0.0136
0.0184
0.0158
0.0125
0.0134
0.0156
0.0079
0.0078
0.0172
0.0084
0.0043
0.0112
0.0096
0.0091
0.0114
0.0124
0.0085
0.0126
0.0113
0.0063
0.0124
0.0105
0.0116
0.0147
0.0138
0.0104
0.0134
0.0156
0.0080
0.0136
0.0124
0.0053
0.0160
0.0113
0.0106
0.0162
0.0120
0.0083
0.0097
0.0101
0.0020
0.0041
0.0061
0.0009
0.0077
0.0081
0.0032
0.0096
0.0126
0.0086
0.0130
0.0188
0.0078
0.0051
0.0118
0.0079
0.0055
0.0121
0.0074
0.0126
0.0186
0.0161
0.0186
0.0128
0.0102
0.0120
0.0128
0.0105
0.0024
0.0040
0.0112
0.0112
0.0153
0.0157
0.0181
0.0224
0.0133
0.0168
0.0198
0.0139
0.0173
0.0209
0.0180
0.0168
0.0201
0.0186
0.0205
0.0226
0.0138
0.0125
0.0130
0.0126
0.0087
0.0155
0.0212
0.0140
0.0178
0.0162
0.0154
0.0216
0.0152
0.0119
0.0110
0.0092
0.0177
0.0226
0.0180
0.0204
0.0183
0.0202
0.0228
0.0125
0.0138
0.0098
0.0084
0.0094
0.0026
0.0104
0.0110
0.0087
0.0111
0.0076
0.0045
0.0080
0.0100
0.0056
0.0087
0.0096
0.0076
0.0147
0.0154
0.0094
0.0108
0.0141
0.0092
0.0067
0.0100
0.0065
0.0094
0.0098
0.0031
0.0075
0.0099
0.0083
0.0098
0.0065
0.0041
0.0037
0.0063
0.0065
0.0059
0.0128
0.0098
0.0078
0.0167
0.0104
0.0064
0.0121
0.0111
0.0060
0.0100
0.0104
0.0099
0.0186
0.0152
0.0117
0.0160
0.0153
0.0132
0.0166
0.0171
0.0109
0.0186
0.0207
0.0130
0.0158
0.0158
0.0103
0.0109
0.0120
0.0071
0.0103
0.0128
0.0115
0.0128
0.0152
0.0139
0.0132
0.0178
0.0106
0.0143
0.0202
0.0132
0.0166
0.0203
0.0130
0.0140
0.0195
0.0149
0.0148
0.0213
0.0171
0.0172
0.0189
0.0133
0.0141
0.0185
0.0150
0.0085
0.0142
0.0119
0.0080
0.0152
0.0097
0.0042
0.0133
0.0144
0.0104
0.0171
0.0161
0.0127
0.0175
0.0159
0.0108
0.0135
0.0133
0.0050
0.0124
0.0126
0.0096
0.0174
0.0117
0.0063
0.0083
0.0114
0.0068
0.0084
0.0129
0.0097
0.0124
0.0108
0.0078
0.0083
0.0082
0.0031
0.0031
0.0069
0.0017
0.0064
0.0172
0.0101
0.0111
0.0167
0.0108
0.0131
0.0199
0.0154
0.0161
0.0207
0.0181
0.0204
0.0226
0.0174
0.0162
0.0203
0.0171
0.0146
0.0186
0.0131
0.0129
0.0126
0.0087
0.0113
0.0144
0.0127
0.0105
0.0144
0.0149
0.0115
0.0150
0.0126
0.0127
0.0173
0.0180
0.0158
0.0175
0.0205
0.0143
0.0157
0.0168
0.0071
0.0116
0.0116
0.0074
0.0100
0.0095
0.0039
0.0046
0.0068
0.0020
0.0044
0.0036
-0.0003
0.0026
0.0051
0.0009
-0.0002
0.0075
0.0061
0.0059
0.0099
0.0073
0.0095
0.0102
0.0110
0.0111
0.0130
0.0115
0.0089
0.0133
0.0100
0.0099
0.0118
0.0056
0.0034
0.0081
0.0085
-0.0001
0.0078
0.0081
0.0041
0.0084
0.0067
0.0083
0.0108
0.0155
0.0156
0.0200
0.0212
0.0152
0.0194
0.0158
0.0159
0.0189
0.0204
0.0207
0.0191
0.0230
0.0157
0.0150
0.0168
0.0135
0.0164
0.0167
0.0166
0.0150
0.0174
0.0173
0.0160
0.0209
0.0165
0.0152
0.0198
0.0165
0.0179
0.0225
0.0184
0.0192
0.0242
0.0201
0.0184
0.0212
0.0195
0.0180
0.0197
0.0177
0.0131
0.0146
0.0102
0.0087
0.0135
0.0145
0.0136
0.0140
0.0121
0.0106
0.0110
0.0141
0.0111
0.0131
0.0171
0.0141
0.0144
0.0133
0.0101
0.0111
0.0107
0.0068
0.0059
0.0094
0.0021
0.0050
0.0074
0.0024
0.0062
0.0052
0.0039
0.0059
0.0068
0.0050
0.0059
0.0093
0.0057
0.0087
0.0093
0.0042
0.0064
0.0084
0.0078
0.0110
0.0122
0.0093
0.0073
0.0074
0.0059
0.0054
0.0090
0.0063
0.0050
0.0109
0.0119
0.0087
0.0084
0.0056
0.0081
0.0105
0.0071
0.0066
0.0086
0.0070
0.0059
0.0078
0.0066
0.0075
0.0084
0.0068
0.0092
0.0087
0.0078
0.0055
0.0059
0.0042
0.0022
0.0036
0.0040
0.0075
0.0121
0.0138
0.0133
0.0122
0.0109
0.0113
0.0137
0.0105
0.0086
0.0113
0.0150
0.0127
0.0135
0.0157
0.0112
0.0070
0.0085
0.0110
0.0090
0.0121
0.0093
0.0113
0.0176
0.0139
0.0120
0.0087
0.0130
0.0114
0.0115
0.0166
0.0163
0.0144
0.0148
0.0157
0.0127
0.0159
0.0189
0.0182
0.0227
0.0186
0.0178
0.0188
0.0154
0.0111
0.0123
0.0122
0.0080
0.0068
0.0098
0.0147
0.0164
0.0142
0.0072
0.0078
0.0098
0.0065
0.0134
0.0122
0.0096
0.0146
0.0094
0.0092
0.0085
0.0076
0.0058
0.0115
0.0216
0.0181
0.0179
0.0157
0.0127
0.0113
0.0110
0.0166
0.0198
0.0223
0.0208
0.0189
0.0212
0.0156
0.0163
0.0121
0.0111
0.0109
0.0094
0.0092
0.0096
0.0142
0.0132
0.0120
0.0087
0.0058
0.0089
0.0089
0.0116
0.0139
0.0173
0.0100
0.0110
0.0166
0.0094
0.0124
0.0175
0.0174
0.0161
0.0236
0.0165
0.0069
0.0114
0.0091
0.0101
0.0088
0.0057
0.0118
0.0082
0.0028
0.0055
0.0067
0.0054
0.0061
0.0076
0.0082
0.0116
0.0109
0.0140
0.0176
0.0203
0.0177
0.0148
0.0194
0.0164
0.0150
0.0189
0.0162
0.0174
0.0213
0.0131
0.0069
0.0184
0.0134
0.0065
0.0168
0.0147
0.0110
0.0143
0.0126
0.0082
0.0147
0.0153
0.0131
0.0201
0.0196
0.0202
0.0241
0.0216
0.0176
0.0205
0.0204
0.0203
0.0202
0.0201
0.0200
0.0199
0.0198
0.0197
0.0196
0.0195
0.0194
0.0193
0.0192
0.0191
0.0190
0.0189
0.0188
0.0187
0.0186
0.0185
``````
Commented:
In the 219 second case, some thing clearly happens around 20 seconds.  I don't know what it is.

If the robot is 1m long and travels 2.5 m/s, then you should probably look at clean data files of 64, 128, and 256 samples for each of your terains.  By clean, I mean the vehicle should spend all the time on the same terrain.
If you can look at the raw data and see any artifacts, then the data is not clean.

Once you have the FFT's of these data files you should be able to look at them, and pick out a few artifacts.
They won't be at the max or min frequencies, they will be in the middle.
And they will be at the same real frequency, no matter what the sample size is.
These few artifacts are the signature you are looking for.

If you rerun clean 64, 128, and 256 samples from your 219 second file (skip the first 20s), you should see the same peak around 3.66 Hz in every case.
R&D EngineerAuthor Commented:
Thank you a lot for all your support! I really appreciate it!

If the robot is 1m long and travels 2.5 m/s, then you should probably look at clean data files of 64, 128, and 256 samples for each of your terains.  By clean, I mean the vehicle should spend all the time on the same terrain.

I'm sorry if this is a stupid question, but how did you calculate the 64, 128 and 256 values?
I would like to better understand your considerations since they are very interesting!

However, there is another aspect I'm not able to understand very well: when the robot moves, the number of track pads which are in contact with the terrain is always the same and also the track's fingerprint is always the same size.

These are the tracks I'm using for my robot (in total, I use two tracks, one for each side and the robot is a skid-steer)

The second picture shows the links for each tracks and if, for example, the robot moves straight forward, the number of links on the terrain is always the same.

So, why do you suggest to consider the "track_segments/second"? shouldn't this value be always the same?
Commented:
Your robot moves 2.5 m/s ==>  5.6 m/hr  which is pretty fast.
You have 1 meter of track on the ground and probably 2.5 meters of track total.

Is the track a straight belt with a coupling link or a continuous loop?
And how many links in total?  And how many teeth on the drive and guide wheels?  I will assume 30 and 12 for now.

What frequencies do you expect to see?
If you have one bad link you will see a bump every 2.5 s  or  0.4 Hz
If you have one bad tooth on the drive wheel you will see a bump every 1.0 s  or  1.0 Hz

The links hit the ground at a rate of 30 every 2.5 s  which is 12 Hz.
To see this component clearly you would have to sample faster, at least 24 /s and probably 40 /s.

You should also look at the RPM of you motor and gears.
These will contribute even higher frequencies which you can't resolve either.  But there will be noise.
It would be good to look at the output of the accelerometer and do an FFT at 10 kHz.
If you have a lot of noise at freq greater than 5 Hz you need to filter the signal before running the FFT.  You can do this in Matlab as well.

Suppose you have a bad tooth on a drive wheel.  You will see a spike on the FFT at 1 Hz on the FFT when you are running at 2.5 m/s.  But this is speed dependent.  The spike location will move with speed.  In fact the whole signature will move with speed.

Do you expect to see more vibration at harder terrain from links hitting the ground?  If so this would be my prescription:
Set your sample size to 256.  This will give 20 Hz max frequency and 20/128 => 0.16 Hz resolution.
Once you find a signature, you can change the filter size to speed up processing or increase resolution.
R&D EngineerAuthor Commented:
Thank you again for your time.

These are the real tracks I'm using.

The vehicle can move with a velocity up to 1 m/s, its weight is about 300 Kg.
It uses two tracks with 36 links and the main sprocket has 15 teeth, the weighs for each track is 34 Kg.
The tracks use a continuous chain and they are made in 100% natural rubber.
The overall length the each rubber track is 254 cm and each lug is 3 centimeters height.
The track has a width of 33 cm and the contact ground patch has a length of 100 cm.
The pitch is about 7 cm and so there are 100/7 = 14 links on the ground.

The ratio of the gear box is 1:60 and the maximum velocity for the sprocket is 330RPM (the maximum RPMs for the motors are 2200).

The tracks are pretty new so they do not have any bad link or bad tooth, but each one moves in a very specific way for various reasons (different tension on the belts, different velocity, different rubber response to stress,..).

I expect to have high vibrations on harder terrains: on the sand, for example, I expect less vibrations than on the asphalt.

I acquire the accelerations at 160 Hz, so I have 160 samples for each second.

Here you can find the velocity vectors (vs, vd), the vibration vector and the raw Z acceleration vector sampled at 160 Hz.

Unfortunately, I still do not understand how you are able to calculate the values and the frequencies.

For example, with my data, if I have a bad link, I should see a peak every 1.5 seconds or at 0.66Hz.
Then, the links hit the ground in a group of 13 each 1.5 seconds or at 19.5Hz.
Is it correct?

EDIT:
This is what I get when I plot the fft of the raw acceleration data without any filtering and at 160 Hz (asphalt case - the second one)
\Commented:
In order to keep your zero frequency , that is your DC component , at the center of your frequency axis, you can use fftshift. I think these plots are easier to interpret.
https://www.mathworks.com/help/matlab/ref/fftshift.html?s_tid=gn_loc_drop

But this is good only for an even number of samples if you are a perfectionist. To be general for even or odd number sample, be aware of ifftshift:
https://www.mathworks.com/help/matlab/ref/ifftshift.html

Here is a discussion on how to use both:
\Commented:
>> If you run FFT's for the the first 128 sample you will find a MUD signature.
>> If you run FFT's for the the last 128 sample you will find a ASPH signature.

You can get the first window, the last window, and lots of other windows in between . Take a look at all of these options in this link.
https://www.mathworks.com/help/signal/ref/spectrogram.html

This command does not work on my very old computer so most part you're on your own with glitches help.
\Commented:
Also , I think you should make your X axis show frequencies rather than samples in order to interpret them better.

Following has a similar idea, but is one-sided

As you search online about frequency scaling , what may be confusing is that sometimes you'll see +0.5 or +pi. These are just two-sided values of the same thing; namely, the highest frequency content - call it Fmax (Hz). Fmax = Fs/2 where Fs is the sampling rate (samples/second). So, .5 or pi are just scaled values that represent Fmax (Hz).
Commented:
Wildly busy yesterday, but I am back.  phoffric seems to be much better at Matlab than I am.  Useful info.

Your last plot is excellent.  Probably all the information you need.
It shows a strong fundamental frequency and the odd harmonics.  Classic.

35k samples at 160 samples per second [sps]  ==>  218.8 seconds
The fastest freq you can see is (160Hz)/2 ==> 80 Hz
The slowest freq you can see is 1/(218.8s) ==> 4.571 mHz   <== This is also the resolution of the x-axis.

Your plot shows the fundamental (1st harmonic) and the 3rd, 5th, and 7th.  And then the mirror image.

The 7th harmonic is at approx 16,000  ==>  16k * 4.571 mHz  ==>  73.1 Hz
And the fundamental is at 10.45 Hz

The sort of information you might consider for a signature is the amplitude of the 1st harmonic and the ratio of the 1st and 3rd.  And let's say you are satisfied with a resolution of 0.1 Hz.
The minimum sample size required for this resolution is  T = 1/(0.1 Hz) = 10 s  ==>  1600 samples.
You should see a similar plot, with the same pattern if you run this smaller sample.

There are several opportunities for optimization:
• You might discover that you can get by with 0.2 or even 0.5 Hz resolution.  That would let you use 5 or 2 second samples for faster decisions.
• If you don't need all the harmonics, you can filter and decimate the data to reduce your FFT computation requirements.

If 0.2 Hz resolution and two harmonics are enough:
Sample time ==>  5s  ==>  800 samples     Filtering and decimation let you run a 400 sample FFT

If all you care about is the amplitude of the fundamental and 0.5 Hz resolution is enough:
Sample time ==>  2s  ==>  320 samples   Filter at 20Hz and decimate by 5 and for a 64 sample FFT.
Even a PIC or Arduino can handle this pretty easily.

It is crucial to filter before you decimate the data.  You can wind up with severe aliasing problems if you forget.
R&D EngineerAuthor Commented:
Hello guys, I'm sorry for my delay, but I spent several hours during this afternoon to try to understand all your suggestions.

First of all, thank you for all your assistance on this topic.

I set the frequency on the x-axis (as phoffric suggested) and I changed my Matlab code in this way:

``````Fs=160;
raw_accelerations = ts_imu_acc.data(:,3);
raw_accelerations_fft= fft(raw_accelerations);
raw_accelerations_abs = abs(raw_accelerations_fft);
N = length(raw_accelerations_abs);
freqHz = (0:1:length(raw_accelerations_abs)-1)*Fs/N;
figure(6)
plot(freqHz,raw_accelerations_abs);
grid on;
ylabel('Y(t)');
xlabel('Hz');
title('FFT');
``````

and I run it over different dataset and these are the results.
i changed the time windows according to the condition of each test, later, I will define a standard time window which will be always the same for all the tests.

Case 1: SAND

I get the first harmonic with a maximum value of 3102, the third at 1077, the fifth at 711 and the last at 588.

Case 2: GRAVEL

In this case, the data are: #1: 2087, #3: 683, #5:481, #69.85

Case 3: ASPHALT

In this case, the data are: #1: 6707, #3: 2394, #5:1665, #1433

Case 4: HEAVY MUD

This time, the data are: #1: 279, #3: 103, #5:70, #59

These values change significantly in each test and so I think I can use them as some kind of fingerprint for each terrain.
May be, I can consider only the first harmonic and then the ratio of the #3 and 5# harmonic as d-glitch suggested few posts ago.

Do you think these considerations can be correct?

Is there a way to accurately define the frequency of each harmonic?
At the moment, I can only approximately estimate their frequency, but how can I understand their correct value?
Should I consider the peak of each harmonic as its "position" on the frequency axis?

The amplitude values are still m/s^2 ?

P.S. Since I also have the pitch, yaw and roll rate and X,Y,Z accelerations I was thinking to include all of them in these considerations.
\Commented:
>> Should I consider the peak of each harmonic as its "position" on the frequency axis?
Depends how precise you need to be. Looking at the main frequency, there are two frequencies near the true peak. That is, the energy is divided almost equally in two adjacent frequency bins. So the true peak is likely at a frequency in between those two adjacent bins. You can append (i.e., pad) your time domain with lots of zeros (i.e., the number of samples appears to increase with the end being all zeros). Then your fft should have finer grained frequency interpolated resolution.
R&D EngineerAuthor Commented:
You can append (i.e., pad) your time domain with lots of zeros (i.e., the number of samples appears to increase with the end being all zeros). Then your fft should have finer grained frequency interpolated resolution.

What do you mean by this?
\Commented:
You can interpolate the FFT by zero padding. Zero padding enables you to obtain more accurate amplitude estimates of resolvable signal components. On the other hand, zero padding does not improve the spectral (frequency) resolution of the FFT. The resolution is determined by the number of samples and the sample rate.
\Commented:
Data file created using posted data in https:#a42430623
I also modified the raw data so that your plots in https:#a42430458 would look better.
``````raw_accelearation = csvread('data_42430623.txt');
N1 = length(raw_accelearation)

% remove the data before the motion
raw_accel2 = raw_accelearation(210:N1);
N = length(raw_accel2)

% remove the DC component in the frequency spectrum
% to improve the scaling in the plots
raw_accel = raw_accel2 - mean(raw_accel2);

figure
plot(raw_accel);
xlabel('Sample Number');
ylabel('Raw Acceleration');

Fs=160;

Y = fftshift( abs( fft(raw_accel) ) );
fshift = (-N/2:N/2-1)*(Fs/N); % zero-centered frequency range
figure
plot(fshift,Y)
grid on;
xlabel( ['Hz  (' num2str(N) ' bins)'] );
ylabel('Freq Energy');

Y = fftshift( abs( fft(raw_accel, 32768) ) );
N3 = length(Y)
fshift_pad = (-N3/2:N3/2-1)*(Fs/N3); % zero-centered frequency range
figure
grid on;
ylabel('Freq Energy');
xlabel( ['Hz  (' num2str(N3) ' bins)'] );

% Here is how to zero pad when using only 1 arg to fft:
fshift_pad = (-N2/2:N2/2-1)*(Fs/N2); % zero-centered frequency range
figure
grid on;
ylabel('Freq Energy');
xlabel( ['Hz  (' num2str(N2) ' bins)'] );
``````
\Commented:
Here are zoomed in sections of the fft using different number of bins. As the number of bins increase, you see a smoother interpolation of the discrete-time Fourier transform (DTFT) because more points are sampled from the DTFT.

Experts Exchange Solution brought to you by

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

R&D EngineerAuthor Commented:
Thank you for your help, phoffric!

Can you explain me the meaning of this instruction, please?

``````% remove the DC component in the frequency spectrum
% to improve the scaling in the plots
raw_accel = raw_accel2 - mean(raw_accel2);
``````

Why do you subtract the mean values from the same vector?

The vector posted in https:#a42430623 was a downsampled version of the original vector acquired at 160Hz.
I uploaded the original vector - here - and it contains 35103 elements.
\Commented:
Unfortunately, I am unable to load your .mat files.  I subtracted the mean from the signal because the fft that you plotted in post ID: 42430458 had a very large zero frequency energy that swamped out other data that you are interested in viewing.

Suppose that you had a very tiny signal on a DC voltage line. The mean of that signal is just going to be the DC value. By subtracting out the mean of the signal, all you are left with is the essential aspects of the signal. When taking the fft, the signal will no longer be swamped out by the DC energy level.
it may be that the mean and variance of your signal are also parameters that you can use to classify the terrain.
R&D EngineerAuthor Commented:
Thank you a lot, guys! You did help me a lot!
R&D EngineerAuthor Commented:
Thank you guys!
\Commented:
You're welcome. Glad that I could contribute a little bit.
\Commented: