필터 지우기
필터 지우기

Down-sampling with interp1

조회 수: 45 (최근 30일)
PPM
PPM 2016년 1월 8일
댓글: PPM 2016년 1월 8일
Hi,
I have a vector with 1500 rows, and I am trying to down-sample this using interp1 like this:
downsampled = interp1([1:length(original)],original,1:1:100);
However, it looks like the output "downsampled' is just a copy of the first 100 rows of original. Any hints on this?
Cheers

채택된 답변

Walter Roberson
Walter Roberson 2016년 1월 8일
oL = length(original);
downsampled = interp1(1:oL, original, linspace(1,oL,100));
However please think about whether you want 100 points output or 101 points output. If you want to divide into 100 segments of equal length then you want 101 points output.
  댓글 수: 1
PPM
PPM 2016년 1월 8일
Thanks Walter. Indeed, I need 101 points. Regards

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

추가 답변 (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