我正在尝试获取并表示先前使用设备的内部麦克风录制的wav文件的SPL。 问题是,我得到的值似乎根本不是逻辑,因为我得到超过100分贝的值只是拍手,你可以看到这里:
image http://s2.subirimagenes.com/imagen/previo/thump_8946906screenshot2014060821.png
这就是我在做的事情:
你们知道我做错了什么吗?我认为这些值应该是获得的值的一半左右
这是一段代码:
protected void miThread() {
Thread t=new Thread() {
public void run(){
//Operaciones ope=new Operaciones();
double [] st =new double [arr.length];
int j=0;
try{
for (int i = 44; i < s; i+=2) {
// convert byte pair to int
double audioSample = (double) (array[i+1] << 8 | array[i] & 0xff)/ 32767.0;
arr[j]=audioSample; //double
n[j] = (Number)arr[j]; //Number
st[j]=10*Math.log10(Math.abs((audioSample/Math.pow(10, -12)))); //double
l[j]=(Number)(10*Math.log10(Math.abs((audioSample/Math.pow(10, -12))))); //Number
if(audioSample == 0.0 ){
if(j!=0){
l[j]=l[j-1];
st[j]=st[j-1];
}else{
l[j]=0.0;
st[j]=0.0;
}
}
j=j+1;}
min=Operaciones.minimum(arr);
max=Operaciones.maximum(arr);
min2=Operaciones.minimum(st);
max2=Operaciones.maximum(st);
}
catch (NullPointerException e){
e.printStackTrace();
}
handle.post(proceso);
} }; t.start();
}
final Runnable proceso=new Runnable(){
public void run(){
//plot.redraw();
//plot2.redraw();
Toast.makeText(Grafica.this,
"Ya se ha cargado todo el array", Toast.LENGTH_LONG).show();
}
};
答案 0 :(得分:1)
Isn t SPL standing for sound pressure level compared to the absolute reference?. So the microphone is plugged into a 16bit precision port I think it
没问题。 SNR应该在60dB左右,因此语音间隔大约为44dB。因此,当麦克风收到任何声音时,信号应该会上升(如果我记得为16位,则大约为104dB)。
SPL = 20log(Pascal / 2e-5)