2D Down-sampling matrix
17 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (1)
Jongwoo Hong
le 13 Fév 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 commentaires
Voir également
Catégories
En savoir plus sur Multirate Signal Processing dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!