I have a question about RESAMPLE

조회 수: 3 (최근 30일)
Can
Can 2014년 11월 25일
댓글: Youssef Khmou 2014년 11월 26일
when I resample some data,I found that the picture of the start and the end of the resampled-data maybe error,they are shaking,just like drifting
my code:
data2 = resample(data,2,1);
this is the image of the raw data
this is the image of the data after RESAMPLE
U can see some lines are not on the ring.the under part of the ring is the start of the 'data2'. on the right side of the ring is the end of the 'data2'.
this picture is the (1:100) of the 'data2' and 'data' and the red line is the 'data',the blue line is the 'data2'
my question is why can see the fluctuation.

채택된 답변

Youssef  Khmou
Youssef Khmou 2014년 11월 25일
편집: Youssef Khmou 2014년 11월 25일
This is an interesting remark, however in Documentation, it was mentioned that re-sampling has side effect because of filtering process, the edges of the re sampled vector are deviated.
  댓글 수: 2
Can
Can 2014년 11월 25일
Thank you very much for your answer. how to avoid the deviation?
Youssef  Khmou
Youssef Khmou 2014년 11월 26일
you can study the variation of that deviation with a fourth parameter n, resample(data,2,1,n) the default value is 10, try with zero. But there no definite answer on how to avoid the error.
Remark : you want to re-sample the data with double, you can use the function interp, like in this example :
t=[1e-4:0.1:2*pi]';
data=[cos(t),sin(t)];
x2=interp(data(:,1),2);
y2=interp(data(:,2),2);
figure; plot(data(:,1),data(:,2),'k+');
hold on
plot(x2,y2,'r')
legend(' original','re sampled');

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Multirate Signal Processing에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by