function Ys= scaling_for_illustration(Y,const)
% scaling for improved illustration
% G. Plonka 2026

[N,M,Nc]=size(Y);
K= floor(M*N*Nc/const);
Y1=reshape(abs(Y),N*M*Nc,1);
Y0=sort(abs(Y1(:)));
index=find(Y1>Y0(M*N*Nc-K));
Y1(index)=Y0(M*N*Nc-K);
Ys=reshape(Y1,N,M,Nc);
end