2D Down-sampling matrix
13 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
Jongwoo Hong
el 13 de Feb. de 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 comentarios
Ver también
Categorías
Más información sobre Multirate Signal Processing en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!