Package simulatedAcquisition
Class PistonModel
java.lang.Object
simulatedAcquisition.PistonModel
Calculations associated with a piston model.
- Author:
- Doug Gillespie
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic double[]
conv
(double[] wave, double[] ir) Convolve the impulse response with the wave.static double[]
getImpulseResponse
(double a, double theta, double sr, double c, double binOffset) Calculate the impulse response for a sound emitted from a baffled piston of radius a at angle theta.
-
Constructor Details
-
PistonModel
public PistonModel()
-
-
Method Details
-
getImpulseResponse
public static double[] getImpulseResponse(double a, double theta, double sr, double c, double binOffset) Calculate the impulse response for a sound emitted from a baffled piston of radius a at angle theta.
This function returns IR's of the same length regardless of angle so that timing offset is the same whatever the length of the function.- Parameters:
a
- radius of piston in metrestheta
- angle in radians.sr
- sample ratec
- speed of soundbinOFfset
- offset from integer sample of the first bin.- Returns:
- impulse response.
-
conv
public static double[] conv(double[] wave, double[] ir) Convolve the impulse response with the wave.
Note that the IR may have a lot of zeros, so be efficient !- Parameters:
wave
- input waveformir
- impulse response- Returns:
- array of length (length(wave) + length(ir) -1)
-