Class PistonModel

java.lang.Object
simulatedAcquisition.PistonModel

public class PistonModel extends Object
Calculations associated with a piston model.
Author:
Doug Gillespie
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static 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.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 metres
      theta - angle in radians.
      sr - sample rate
      c - speed of sound
      binOFfset - 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 waveform
      ir - impulse response
      Returns:
      array of length (length(wave) + length(ir) -1)