What indices of the original sequence are retained in the output of the decimate function?
2 ビュー (過去 30 日間)
コメント済み: Gaëtan Garcia 2022 年 11 月 29 日
I am using the decimate function y = decimate(x,r) and I need to know to which index in x the value y(i) corresponds.
This is not explicitly addressed in the documentation. In the first example the number of points is k*r+1 and according to the code it seems y(1) corresponds to index 1 in x, while and y(length(y)) correponds to index length(x) in x.
In the second example of the documentation, where length(x) is not of the form k*r+1, it seems y(length(y)) corresponds to the last index of the original vector x.
Is that always the case? Would that depend on the type of filter applied (e.g. Chebyshev vs FIR) ?
Thanks for any input on the matter.
For convenience, here is the second example of the documentation:
r = 13;
n = 16:365;
lx = length(n);
x = sin(2*pi*n/153) + cos(2*pi*n/127);
y = decimate(x,r,5);
And the associated graph, showing correspondance between last element of x and last element of y:
Voss 2022 年 11 月 29 日
From item #3 in the Algorithms section of the documentation for decimate:
"In the resampled sequence (y), y(end) matches x(end) when the IIR filter is used, and y(1) matches x(1) when the FIR filter is used."
その他の回答 (0 件)
Find more on Multirate Signal Processing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!