我有大约 32 秒的加速度计数据,基本驾驶场景为 25MPH 正常道路,同时撞到大约 7 个坑洼和崎岖不平的道路。加速度计用双面胶带安装在我汽车的仪表板上。
问题:我有所有来自加速度计的噪声数据,我需要用一种简单的方法来检测是否发生了坑洞事件。下面是时域和 FFT 中的几张数据图。加速度计在 GForce 中测量
基本上我希望我的 arduino 知道一个坑洼已经发生了,而且准确度很高,而不是使用研究生水平的数学和技术。
以 100hz 采样的加速度计在 Z 轴上有一个简单的 50HZ RC 低通滤波器
Here is the CSV data for the 32 seconds of accelerometer readings TIME, GFORCE format:
http://hamiltoncomputer.us/50HZLPFDATA.CSV
更新:这是加速度计 1000HZ 的原始全带宽,以我可以在 Arduino 上获得的最高采样率进行采样。直接下载 CSV 文件:大约 112 秒的数据
http://hamiltoncomputer.us/RAWUNFILTEREDFULLBANDWIDTH500HZ.csv
黑色迹线是未经过滤的原始加速度计数据:蓝色迹线由带阻滤波器根据 FFT、Dominate 2HZ 和 12HZ 中发现的极端频率进行过滤。

Pothole 事件在时域中如下所示:

不确定 FFT 中的 10 到 15HZ 分量是什么,是实际的坑洼,还是车轮对路面的跳动,还是汽车的共振频率?
快速傅里叶变换:

似乎这是实际的坑洞事件,这是一个 HPF @ 13HZ 坑洞的主要特征似乎得到了增强

我希望能够实时检测和计算坑洼
似乎违反直觉的是,悬架的移动速度应该比 10 到 13 赫兹慢很多,我相信这会导致晕车
更新:
根据 AngryEE 的建议,我使用了 1000HZ 加速度计的全带宽和我可以在 arduino 上获得的最大采样率。
快速傅里叶变换:

这是坑洼事件的样本数据及其周围的一些颠簸和道路噪音:

添加了二极管包络检测器电路,输出看起来一样...加速度计始终输出 0 到 3.3 伏而不是负...
 
更新:
在许多道路测试中,我的汽车在 Z 轴上的速度从未超过 1.6G,最高可达 45 MPH,我使用 rand() 生成伪随机 Gforce 加速度。
我的想法是,如果我可以查看 1 到 3 秒的数据窗口,我可以计算 Z 轴的位移,但我担心加速度计漂移和积分误差。我在这里甚至不需要 90% 的准确度,> 70% 会很好,但是如果我一次查看 1 到 3 秒的位移,那可以实时进行吗?这样我可以看到位移是否大于 1 英寸、2 英寸、5 英寸。位移越大,凹凸或坑洞越粗糙:
你能检查一下我这样做是否正确,我基本上是在桌面上设置的,使用 rand() 生成从 -1.6 到 1.6 G 的随机加速度,以模拟 50HZ 采样率捕获 3 秒数据
如果像你运行 *nix,我使用 Windows.h 中的 Sleep() 来实现 20mS 延迟,50HZ 采样率
我只是想看看代码对你来说是否合适,我还没有做 cicular 缓冲区,我对如何实现它有点困惑:注释掉的代码来自我正在为它工作的类,但我还没有 100% 理解它。循环缓冲区将允许连续移动数据窗口吗?
#include <cstdlib>
#include <iostream>
#include <iomanip>
#include <ctime> // USED BY RAND
#include <windows.h> // Used for delay
using namespace std;
#define SAMPLE_RATE   0.020 // Sample rate in Milliseconds
#define GRAVITYFT_SEC 32 // Gravity velocity 32 feet/sec
#define INCH_FOOT     12 // 12 inches in foot, from velocity to inch displacement calculation
int main(int argc, char *argv[])
{
    srand((unsigned)time(0)); // SEED RAND() for simulation of Geforce Readings
    // SIMULATING ACCELERATION READINGS INTO A CIRCULAR BUFFER
   // circular_buffer Acceleration; // Create a new Circular buffer for Acceleration
   // cb_init(&Acceleration, 150, 4); // Sampling @ 50HZ, 3 seconds of data = 150, size is float data of 4 bytes
    //Simulate a sample run of Acceleration data using Rand()
    // WE WILL BE SIMULATING "RANDOM" GEFORCE RATINGS using the rand() function constraining to -1.6 to 1.6 GFORCE 
    // These ratings are consistent with our road tests of apparently random vibration and Geforce readings not exceeding about 1.6 G's
    float Gforce[150]; // Random Geforce for 3 second window of data
    float velocity[150]; // Hold velocity information
    float displacement[150]; // Hold Displacement information
    float LO = -1.6; // Low GForce limit recorded from 6 road tests at different speeds
    float HI = 1.6; // High GForce limit recorded from 6 road tests at different speeds
    for(int i = 0; i < 150; i++) // 3 Second iwndow of random acceleration data
    {  
            Gforce[i] = LO + (float)rand()/((float)RAND_MAX/(HI-LO)); // Borrowed from Stackexchange : http://stackoverflow.com/questions/686353/c-random-float
            if( i == 0) // Initial values @ first Acceleration
            {
                velocity[i] = Gforce[i] * SAMPLE_RATE * GRAVITYFT_SEC; // Initial velocity
                displacement[i] = velocity[i] * SAMPLE_RATE * INCH_FOOT; // Initial Displacement
            }
            else
            {
                velocity[i] = velocity[i-1] + (Gforce[i] * SAMPLE_RATE * GRAVITYFT_SEC); // Calculate running velocity into buffer
                displacement[i] = displacement[i-1] +(velocity[i] * SAMPLE_RATE * INCH_FOOT); // Calculate running displacement into buffer
            }
            //cout << endl << Gforce[i]; // Debugging
            //cb_push_back(&Acceleration, &Gforce[i]);                   // Push the GeForce into the circular buffer
            Sleep(SAMPLE_RATE*1000); // 20mS delay simulates 50HZ sampling rate Sleep() expects number in mS already so * 1000
    }
    // PRINT RESULTS
    for (int j = 0; j < 150; j++)
            {
                cout << setprecision (3) << Gforce[j] << "\t\t" << velocity[j] << "\t\t" << displacement[j] << endl;
            }
    // READ THE BUFFER
    //cb_free(&Acceleration); // Pervent Memory leaks
    system("PAUSE");
    return EXIT_SUCCESS;
}
样品运行:
    GFORCE          FT/SEC          Inch Displacement Z axis
-0.882          -0.565          -0.136
0.199           -0.437          -0.24
-1.32           -1.29           -0.549
0.928           -0.691          -0.715
0.6             -0.307          -0.788
1.47            0.635           -0.636
0.849           1.18            -0.353
-0.247          1.02            -0.108
1.29            1.85            0.335
0.298           2.04            0.824
-1.04           1.37            1.15
1.1             2.08            1.65
1.52            3.05            2.38
0.078           3.1             3.12
-0.0125         3.09            3.87
1.24            3.88            4.8
0.845           4.42            5.86
0.25            4.58            6.96
0.0463          4.61            8.06
1.37            5.49            9.38
-0.15           5.39            10.7
0.947           6               12.1
1.18            6.75            13.7
-0.791          6.25            15.2
-1.43           5.33            16.5
-1.58           4.32            17.5
1.52            5.29            18.8
-0.208          5.16            20.1
1.36            6.03            21.5
-0.294          5.84            22.9
1.22            6.62            24.5
1.14            7.35            26.3
1.01            8               28.2
0.284           8.18            30.1
1.18            8.93            32.3
-1.43           8.02            34.2
-0.167          7.91            36.1
1.14            8.64            38.2
-1.4            7.74            40
-1.49           6.79            41.7
-0.926          6.2             43.2
-0.575          5.83            44.6
0.978           6.46            46.1
-0.909          5.87            47.5
1.46            6.81            49.2
0.353           7.04            50.8
-1.12           6.32            52.4
-1.12           5.6             53.7
-0.141          5.51            55
0.463           5.8             56.4
-1.1            5.1             57.6
0.591           5.48            59
0.0912          5.54            60.3
-0.47           5.23            61.5
-0.437          4.96            62.7
0.734           5.42            64
-0.343          5.21            65.3
0.836           5.74            66.7
-1.11           5.03            67.9
-0.771          4.54            69
-0.783          4.04            69.9
-0.501          3.72            70.8
-0.569          3.35            71.6
0.765           3.84            72.5
0.568           4.21            73.5
-1.45           3.28            74.3
0.391           3.53            75.2
0.339           3.75            76.1
0.797           4.26            77.1
1.3             5.09            78.3
0.237           5.24            79.6
1.52            6.21            81.1
0.314           6.41            82.6
0.369           6.65            84.2
-0.598          6.26            85.7
-0.905          5.68            87.1
-0.732          5.22            88.3
-1.47           4.27            89.4
0.828           4.8             90.5
0.261           4.97            91.7
0.0473          5               92.9
1.53            5.98            94.3
1.24            6.77            96
-0.0228         6.76            97.6
-0.0453         6.73            99.2
-1.07           6.04            101
-0.345          5.82            102
0.652           6.24            104
1.37            7.12            105
1.15            7.85            107
0.0238          7.87            109
1.43            8.79            111
1.08            9.48            113
1.53            10.5            116
-0.709          10              118
-0.811          9.48            121
-1.06           8.8             123
-1.22           8.02            125
-1.4            7.13            126
0.129           7.21            128
0.199           7.34            130
-0.182          7.22            132
0.135           7.31            133
0.885           7.87            135
0.678           8.31            137
0.922           8.9             139
-1.54           7.91            141
-1.16           7.16            143
-0.632          6.76            145
1.3             7.59            146
-0.67           7.16            148
0.124           7.24            150
-1.19           6.48            151
-0.728          6.01            153
1.22            6.79            154
-1.33           5.94            156
-0.402          5.69            157
-0.532          5.35            159
1.27            6.16            160
0.323           6.37            162
0.428           6.64            163
0.414           6.91            165
-0.614          6.51            166
1.37            7.39            168
0.449           7.68            170
0.55            8.03            172
1.33            8.88            174
-1.2            8.11            176
-0.641          7.7             178
-1.59           6.69            179
1.02            7.34            181
-0.86           6.79            183
-1.55           5.79            184
-0.515          5.46            186
0.352           5.69            187
0.824           6.22            188
1.14            6.94            190
-1.03           6.29            192
-1.13           5.56            193
0.139           5.65            194
0.293           5.84            196
1.08            6.53            197
-1.23           5.75            199
-1.1            5.04            200
-1.17           4.29            201
-0.8            3.78            202
-0.905          3.2             203
-0.0769         3.15            203
-0.323          2.95            204
-0.0186         2.93            205
Press any key to continue . . .






