On Sun, 22 Jun 2014 21:01:15 -0500, "Dan25" <98432@dsprelated> wrote:
>Hi All,
>
>I would like to re-sample a vector using different sample rates. But I
>would want to keep the symmetry as it is.
>
>E.g. h = [ 0.1 0.3 0.7 0.3 0.1]; % Original vector with 5 samples h2 =
>resample(h,4,5); % Re-sampled vector into 4 samples
>
>But the above command doesn't give a symmetric vector as the original one.
>Is there any way to re-sample keeping the symmetry around the center sample
>?
>
>Thanks in advance.
Hi Dan25,
Matlab's 'resample' command performs all sorts
of processing that doesn't give reasonable results
on such a short-length sequence as your 'h' sequence.
How about you just perform simple linear interpolation?
Such as:
h3(1) = h(1) + (h(2)-h(1))/2,
h3(2) = h(2) + (h(3)-h(2))/2,
h3(3) = h(3) + (h(4)-h(3))/2,
h3(4) = h(4) + (h(5)-h(4))/2,
Now plot the following:
figure(1)
plot(h,'-bo')
hold on
plot([1.5,2.5,3.5,4.5], h3,'-go')
hold off
Good Luck,
[-Rick-]
Reply by kaz●June 23, 20142014-06-23
>Hi All,
>
>I would like to re-sample a vector using different sample rates. But I
>would want to keep the symmetry as it is.
>
>E.g. h = [ 0.1 0.3 0.7 0.3 0.1]; % Original vector with 5 samples h2 =
>resample(h,4,5); % Re-sampled vector into 4 samples
>
>But the above command doesn't give a symmetric vector as the original
one.
>Is there any way to re-sample keeping the symmetry around the center
sample
>?
>
>Thanks in advance.
>
>
>_____________________________
>Posted through www.DSPRelated.com
>
use even (h) e.g 6 samples then you get symmetry on 5 samples
_____________________________
Posted through www.DSPRelated.com
Reply by Dan25●June 22, 20142014-06-22
Hi All,
I would like to re-sample a vector using different sample rates. But I
would want to keep the symmetry as it is.
E.g. h = [ 0.1 0.3 0.7 0.3 0.1]; % Original vector with 5 samples h2 =
resample(h,4,5); % Re-sampled vector into 4 samples
But the above command doesn't give a symmetric vector as the original one.
Is there any way to re-sample keeping the symmetry around the center sample
?
Thanks in advance.
_____________________________
Posted through www.DSPRelated.com