2D Down-sampling matrix

조회 수: 15 (최근 30일)
chrichat
chrichat 2018년 3월 6일
답변: Jongwoo Hong 2020년 2월 13일
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