how to down sample a vector?
25 ビュー (過去 30 日間)
古いコメントを表示
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
2017 年 9 月 10 日
I am going to try using downsample: https://au.mathworks.com/help/signal/ref/downsample.html
採用された回答
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 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Multirate Signal Processing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!