double array[];
int count, depth;
// 1 < depth < count
for (int i = 0; i < count - depth; i++)
{
double sum = 0;
for (int j = 0; j < depth; j++)
{
sum += array[i + j];
}
array[i] = sum / depth;
}
您可以通过谷歌搜索中值滤波和噪声抑制来获取更多信息。