how to down sample a vector?
27 次查看(过去 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!