void DWT(char *src,char *dst,int height,int width)
{
for (int y = 0; y < height - 1; y += 2)
{
for (int x = 0; x < width - 1; x += 2)
{
int s1 = src[y * width + x];
int s2 = src[y * width + x + 1];
int s3 = src[(y + 1) * width + x];
int s4 = src[(y + 1) * width + x + 1];
unsigned int tmp = abs(((s1 + s2) - (s3 + s4)) * (s1 - s2 + s3 - s4));
dst[y * width + x] = tmp;
dst[y * width + x + 1] = tmp;
dst[(y + 1) * width + x] = tmp;
dst[(y + 1) * width + x + 1] = tmp;
}
}
}
小波尺度和信号频率的关系:
大尺度对应信号的低频
小尺度对应信号的高频