필터 지우기
필터 지우기

how to down sample a vector?

조회 수: 37 (최근 30일)
fariba amini
fariba amini 2016년 4월 12일
댓글: Max Murphy 2017년 9월 10일
I have a vector which contain 60 elements. I want to down sample it to have 54 elements.how can I do this?
  댓글 수: 1
Max Murphy
Max Murphy 2017년 9월 10일
I am going to try using downsample: https://au.mathworks.com/help/signal/ref/downsample.html

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

채택된 답변

Star Strider
Star Strider 2016년 4월 12일
There are several ways, depending on what your vector is.
This approach is likely the simplest, and used interp1:
V = randi(99, 1, 60); % Vector
idx = 1:60; % Index
idxq = linspace(min(idx), max(idx), 54); % Interpolation Vector
Vi = interp1(idx, V, idxq, 'linear'); % Downsampled Vector
figure(1)
plot(idx, V, '-r')
hold on
plot(idxq, Vi, 'bp')
hold off
grid
legend('Original Vector', 'Downsampled Vector')

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by