2D Down-sampling matrix

13 次查看(过去 30 天)
chrichat
chrichat 2018-3-6
Goodevening.
I want to compute a 2D down-sampling matrix (the matrix with which a matrix will be multiplied in order to be downsampled)
d=downsample(eye(initial_size),downsampling_factor);
downs=d(1:downsampling_factor:end,:);
But eye will not work with big number. For example if I want to compute the 170 x 340.000 down-sampling matrix with which a signal of 340.000 x 6 will be multiplied to provide the downsampled 170 x 6 signal.
I have found this alternative but I think is too "naive" with the use of for
d=zeros(1,initial_size);
d(1)=1;
for i=1:sampling_factor
downs(i,:)=circshift(d,[1,sampling_factor*(i-1)]);
end
Thank you in advance.

回答(1 个)

Jongwoo Hong
Jongwoo Hong 2020-2-13
Hi, I recommend the simple method using transpose.
If you want to downsample M x N matrix A into M/10 x N/5 matrix B (not exact number),
B = transpose(downsample(transpose(downsample(A,10)),5))
will be helpful.

类别

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