Pitch Shifting / Sample Rate Conversion
-
- KVRist
- Topic Starter
- 89 posts since 25 Jan, 2010
http://en.wikipedia.org/wiki/Sample_rate_conversion
The algorithm described here is:
1. Under or Over sample audio data.
2. Sample back to original rate spacing each sample with 0's
3. FIR Low Pass to kill high frequencies.
4. Remove 0's
Wallah!
Now they don't seem to reccomend any interpolation, rather its suggested no interpolation is used?! Or do they mean, dont use interpolation without the FIR pass?
Now I imagine this could also be used as a real-time pitch shifting algorithm???
My main question is, allong my research, I have discovered STFT pitch shifting and ring buffer pitch shifting.
I have to say, ring buffer seems more popular, however, STFT would probably produce a better result, but is it feasable for a realtime keyboard VST?
The algorithm described here is:
1. Under or Over sample audio data.
2. Sample back to original rate spacing each sample with 0's
3. FIR Low Pass to kill high frequencies.
4. Remove 0's
Wallah!
Now they don't seem to reccomend any interpolation, rather its suggested no interpolation is used?! Or do they mean, dont use interpolation without the FIR pass?
Now I imagine this could also be used as a real-time pitch shifting algorithm???
My main question is, allong my research, I have discovered STFT pitch shifting and ring buffer pitch shifting.
I have to say, ring buffer seems more popular, however, STFT would probably produce a better result, but is it feasable for a realtime keyboard VST?
-
- KVRist
- Topic Starter
- 89 posts since 25 Jan, 2010
How about;
Whats the real difference between spacing the samples with 0's and doing a FIR and interpolating and using an IIR?
Also, is this a nice implementation of a ring buffer?
http://vrb.slashusr.org/
Whats the real difference between spacing the samples with 0's and doing a FIR and interpolating and using an IIR?
Also, is this a nice implementation of a ring buffer?
http://vrb.slashusr.org/
-
- KVRian
- 646 posts since 18 Feb, 2006 from California
I'm not an expert at this but I will try my best to explain.MrPuzzle wrote:Whats the real difference between spacing the samples with 0's and doing a FIR and interpolating and using an IIR?
"Sample rate conversion" as it's commonly known usually refers to FIR interpolation. Inserting 0s has the effect of "copying" the entire spectrum and shifting it up out of the audible band. By lowpass filtering with an FIR at nyquist, you approximate "ideal bandlimited interpolation", which in theory can reconstruct any band-limited signal perfectly using the sinc function. Since the sinc function is continuous, it must be windowed and therein lies the passband/stopband characteristics associated with FIR filter design. This method is suited to offline resampling and oversampling applications.
Polynomial interpolation (such as linear, lagrange, spline, etc) is cheap at low orders but does not fully suppress aliasing. The performance characteristics of these methods break down the higher you go, at which point FIR resampling is preferred. Low-order polynomial interpolation is suited to real-time sample playback/resampling.
You should read these links for a complete treatment of the topic:
http://src.infinitewave.ca/ (see Secret Rabit Code examples for zero-order hold and linear)
http://ldesoras.free.fr/doc/articles/resampler-en.pdf
https://ccrma.stanford.edu/~jos/resample/
http://yehar.com/blog/wp-content/upload ... 8/deip.pdf