Quantcast
Channel: KVR Audio
Viewing all articles
Browse latest Browse all 5152

DSP and Plugin Development • Fractional Resampling artifacts occur when upsampling (lowering pitch)

$
0
0
This is by no means optimized i just read about fractional windowed sincs and windowed sincs from dspguide. Most resamplers have artifacts when the pitch is really low soxR, quest for perfect resampler, some others i have tried like the lagrange in Juce. My question is do I interpolate further to handle low frequency resampling artifacts. I want about 8 octaves down. How do I appropriately set my cutoff in the windowed sinc maybe thats what i am missing?


Code:

    std::pair<double,double> get_next_sample() {                double outL = 0.0;        double outR = 0.0;                double sum = 0;        double fraction = sample_position - (int)sample_position;        for(int i = 0; i < (int)M; i++) {            const double w = 0.42 - 0.5*cos(TWO_PI*cutoff*(i+fraction)/M) + 0.08*cos(4*M_PI*((i+fraction))/M);            if(abs(i+fraction-M2) <= 0.000000001){                SINC[i] = w*TWO_PI*cutoff;            }else{                SINC[i] = w*(sin(TWO_PI*cutoff*(i+fraction-M2))/(i+fraction-M2));            }            sum += SINC[i];        }                        for(int i = 0; i < (int)M; i++){            auto norm = SINC[i]/sum;                        float l = inL[(int)sample_position-i];            float r = inR[(int)sample_position-i];                        outL += l * norm;            outR += r * norm;        }                sample_position += pitch_ratio;        if(sample_position >= len) {            sample_position = 0;        }                return std::make_pair(outL, outR);    }    

Statistics: Posted by Marvinh — Sat May 18, 2024 8:06 pm — Replies 3 — Views 79



Viewing all articles
Browse latest Browse all 5152

Trending Articles