public OverlappingWindows(ISoundObj input, int length, double overlap, CosWindow window) { _input = input; _length = length; _overlap = overlap; _window = window; }
public OverlappingWindows(ISoundObj input, int length) { _input = input; _length = length; _overlap = 0.5; _window = new Hamming(length / 2, length / 2); }
/// <summary> /// Apply a window to the whole buffer. /// </summary> /// <param name="window">Cosine-based window to apply</param> public void ApplyWindow(CosWindow window) { window.Input = new CallbackSource(NumChannels, SampleRate, delegate(long j) { if (j >= _samples.Count) { return(null); } return(_samples[(int)j]); }); int n = 0; foreach (Sample s in window) { _samples[n++] = s; } }
public WindowedBuffer(ISoundObj input, CosWindow window, int start, int count) { _buff = new SoundBuffer(new SampleBuffer(input).Subset(start, count)); _buff.ApplyWindow(window); }
/// <summary> /// Apply a window to the whole buffer. /// </summary> /// <param name="window">Cosine-based window to apply</param> public void ApplyWindow(CosWindow window) { window.Input = new CallbackSource(NumChannels, SampleRate, delegate(long j) { if (j >= _samples.Count) { return null; } return _samples[(int)j]; }); int n=0; foreach (Sample s in window) { _samples[n++] = s; } }