1.元音分析
用Audacity软件来分析 a o e 元音
a
o
e
由图可以看出 ,这些元音的频谱都在特定的频率点上出现峰值,但是不同元音出现峰值的频率与峰值的幅度不相同,有明显的共振峰。
放大其时域波形,可以看出其有短时平稳性的特点。
二、实现RGB文件三通道分量的信息熵计算。
代码实现如下:
#include<stdio.h>
#include<malloc.h>
#include<string.h>
#include<math.h>
int main(){
FILE *fp=fopen("C://数据压缩//第一次作业//rgbtest//test.rgb","rb")
int shape = 256*256;
int s = shape *3;
int count[3][256];
float percent[3][256];
float H[3];
unsigned char * img = (unsigned char *) malloc(size);
fread(img, 1, size, fp);
for(int i=0;i<256;i++){
for(j=0;j<3;j++) count[j][i] = 0;
}
for(int j=0;j<3;j++){
for(i=0;i<shape;i++){
unsigned char px = img[i*3 + j];
count[j][px] += 1;
}
H[j] = 0;
}
for(i=0;i<256;i++){
for(j=0;j<3;j++){
double c = (double) count[j][i];
double res = c / shape;
if(res>0) H[j] += res*log2(1.0/res);
}
}
printf("Hr=%lf, Hg=%lf, Hb=%lf\n", H[0], H[1], H[2]);
}
结果:Hr=6.856861, Hg=7.178462, Hb=7.229553