2D Down-sampling matrix
13 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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.
0 Kommentare
Antworten (1)
Jongwoo Hong
am 13 Feb. 2020
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.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Multirate Signal Processing finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!