Im trying to spline 2 different samplerates to desired samplerate and I get a tiny error.The 2 samplerates are 50kHz,200kHz and desired samplerate is 300kHz.
factor = lcm([50000,200000],300000);
upSamp = 50000/factor;
upSamp2 = 200000/factor;
sample1 = s1;
x = 1:size(sample1,2);
y = sample1(1,:);
tx = 1:upSamp:size(sample1,2);
sample2 = s2
x = 1:size(sample2,2);
y = sample2(1,:);
tx = 1:upSamp2:size(sample2,2);
sNew1 = [];
sNew2 = [];
sNew1 = [spline(x,y,tx); sNew1];
sNew2 = [spline(x2,y2,tx2); sNew2];
sNew1 = 1 X 3061 array , the 50kHz array splined to a 600kHz array
sNew2 = 1 X 3070 array , the 200kHz array splined to a 600kHz array
Both arrays are very close to 0.00512 milli seconds but arnt exact. Am I missing something? Because I was under the impression by using the LCM(least common multiple) of all samplerates. Arrays should both be same size. I know I could just pad the arrays so thery're the same size. The size of the arrays are only off by a very small margin. But just curious if im doing something wrong?Also after I plan on downsampling both arrays to 300kHz but had this minor error.
Thanks
0 Comments
Sign in to comment.