/// <summary> /// Function creates a new linear-phase resampler object /// </summary> /// /// <param name="srcSampleRate">Source signal sample rate. Both sample rates can be /// specified as a ratio, e.g. SrcSampleRate = 1.0, DstSampleRate = 2.0.</param> /// /// <param name="dstSampleRate">Destination signal sample rate</param> /// /// <param name="maxInputBufferLength">The maximal planned length of the input buffer (in samples) /// that will be passed to the resampler. The resampler relies on this value as /// it allocates intermediate buffers. Input buffers longer than this value /// should never be supplied to the resampler. Note that the resampler may use /// the input buffer itself for intermediate sample data storage.</param> /// /// <param name="reqTransBand">Required transition band, in percent of the /// spectral space of the input signal (or the output signal if /// downsampling is performed) between filter's -3 dB point and the Nyquist /// frequency. The range is from CDSPFIRFilter::getLPMinTransBand() to /// CDSPFIRFilter::getLPMaxTransBand(), inclusive. When upsampling 88200 or /// 96000 audio to a higher sample rates the ReqTransBand can be /// considerably increased, up to 30. The selection of ReqTransBand depends /// on the level of desire to preserve the high-frequency content. While /// values 0.5 to 2 are extremely "greedy" settings, not necessary in most /// cases, values 2 to 3 can be used in most cases. Values 3 to 4 are /// relaxed settings, but they still offer a flat frequency response up to /// 21kHz with 44.1k source or destination sample rate.</param> /// /// <param name="resolution">Resampler's required resolution</param> public R8BrainSampleRateConverter(double srcSampleRate, double dstSampleRate, int maxInputBufferLength, double reqTransBand, R8BrainResamplerResolution resolution) { FUnmanagedInstance = R8BrainDLLWrapper.Create(srcSampleRate, dstSampleRate, maxInputBufferLength, reqTransBand, resolution); FSourcRate = srcSampleRate; FDestinationRate = dstSampleRate; FRequiredTransitionBand = reqTransBand; }
/// <summary> /// Function creates a new linear-phase resampler object /// </summary> /// /// <param name="srcSampleRate">Source signal sample rate. Both sample rates can be /// specified as a ratio, e.g. SrcSampleRate = 1.0, DstSampleRate = 2.0.</param> /// /// <param name="dstSampleRate">Destination signal sample rate</param> /// /// <param name="maxInputBufferLength">The maximal planned length of the input buffer (in samples) /// that will be passed to the resampler. The resampler relies on this value as /// it allocates intermediate buffers. Input buffers longer than this value /// should never be supplied to the resampler. Note that the resampler may use /// the input buffer itself for intermediate sample data storage.</param> /// /// <param name="reqTransBand">Required transition band, in percent of the /// spectral space of the input signal (or the output signal if /// downsampling is performed) between filter's -3 dB point and the Nyquist /// frequency. The range is from CDSPFIRFilter::getLPMinTransBand() to /// CDSPFIRFilter::getLPMaxTransBand(), inclusive. When upsampling 88200 or /// 96000 audio to a higher sample rates the ReqTransBand can be /// considerably increased, up to 30. The selection of ReqTransBand depends /// on the level of desire to preserve the high-frequency content. While /// values 0.5 to 2 are extremely "greedy" settings, not necessary in most /// cases, values 2 to 3 can be used in most cases. Values 3 to 4 are /// relaxed settings, but they still offer a flat frequency response up to /// 21kHz with 44.1k source or destination sample rate.</param> /// /// <param name="resolution">Resampler's required resolution</param> public R8BrainSampleRateConverter(double srcSampleRate, double dstSampleRate, int maxInputBufferLength, double reqTransBand, R8BrainResamplerResolution resolution) { FUnmanagedInstance = R8BrainDLLWrapper.Create(srcSampleRate, dstSampleRate, maxInputBufferLength, reqTransBand, resolution); FSourcRate = srcSampleRate; FDestinationRate = dstSampleRate; FRequiredTransitionBand = reqTransBand; }
public static extern IntPtr Create(double SrcSampleRate, double DstSampleRate, int MaxInLen, double ReqTransBand, R8BrainResamplerResolution Resolution);
public static extern IntPtr Create(double SrcSampleRate, double DstSampleRate, int MaxInLen, double ReqTransBand, R8BrainResamplerResolution Resolution);