6b4ec42c01
Switching from INSA svn to GitHub
26 lines
618 B
Java
26 lines
618 B
Java
package processing;
|
|
|
|
import conteneurs.Spectre;
|
|
|
|
/**
|
|
* Created by gaby on 29/04/14.
|
|
*/
|
|
public class SpectreFilterFactory {
|
|
static public SpectreFilter hearingCorrection(){
|
|
return new SpectreFilter() {
|
|
@Override
|
|
protected void init() {
|
|
autoIntensity = false;
|
|
}
|
|
|
|
@Override
|
|
protected float filter(int idFreq, Spectre spectre) {
|
|
float f = spectre.getGamme().getFreq(idFreq)/1000f;
|
|
float e = f-3.3f;
|
|
return Spectre.dBToAmpli(spectre.getdBAmplitude(idFreq)-filterIntensity*(3.64f*(float)Math.pow(f,-.08f)-6.5f*(float)Math.exp(-.06*e*e)+(float)Math.pow(10f,-3f*f*f*f*f)));
|
|
}
|
|
};
|
|
}
|
|
|
|
}
|