Schnittstelle Resampler

Alle bekannten Implementierungsklassen:
SincResampler, TwoPassSincResampler, ZeroOrderResampler

public interface Resampler
Abstraction of a resampling process. Given enough input, produces output. Constructors take additional arguments that configure these objects.
Autor:
Antti Lankila
  • Methodenübersicht

    Modifizierer und Typ
    Methode
    Beschreibung
    static Resampler
    createResampler(double clockFrequency, SamplingMethod method, double samplingFrequency, double highestAccurateFrequency)
    Setting of SID sampling parameters.
    boolean
    input(int sample)
    Input a sample into resampler.
    int
    Output a sample from resampler
    void
    Resets this resampler.
  • Methodendetails

    • input

      boolean input(int sample)
      Input a sample into resampler. Output "true" when resampler is ready with new sample.
      Parameter:
      sample - The sample to input into the resampler.
      Gibt zurück:
      true when a sample is ready
    • output

      int output()
      Output a sample from resampler
      Gibt zurück:
      resampled sample
    • reset

      void reset()
      Resets this resampler.
    • createResampler

      static Resampler createResampler(double clockFrequency, SamplingMethod method, double samplingFrequency, double highestAccurateFrequency)
      Setting of SID sampling parameters.

      Use a clock freqency of 985248Hz for PAL C64, 1022730Hz for NTSC C64. The default end of passband frequency is pass_freq = 0.9*sample_freq/2 for sample frequencies up to ~ 44.1kHz, and 20kHz for higher sample frequencies.

      For resampling, the ratio between the clock frequency and the sample frequency is limited as follows: 125*clock_freq/sample_freq < 16384 E.g. provided a clock frequency of ~ 1MHz, the sample frequency can not be set lower than ~ 8kHz. A lower sample frequency would make the resampling code overfill its 16k sample ring buffer.

      The end of passband frequency is also limited: pass_freq <= 0.9*sample_freq/2

      E.g. for a 44.1kHz sampling rate the end of passband frequency is limited to slightly below 20kHz. This constraint ensures that the FIR table is not overfilled.

      Parameter:
      clockFrequency - System clock frequency at Hz
      method - sampling method to use
      samplingFrequency - Desired output sampling rate
      highestAccurateFrequency - end of passband frequency