Code covered by the BSD License  

Highlights from
Non Convex Algorithms for Group Sparse Optimization

from Non Convex Algorithms for Group Sparse Optimization by Angshul Majumdar
Reweighted Lm,p algorithm Smoothed L2,0 algorithm

GenerateProblem(channel_length, pilot_length, channel_sparsity, number_of_symbols, noise, cplx)
function [y, A, x, group, err] = GenerateProblem(channel_length, pilot_length, channel_sparsity, number_of_symbols, noise, cplx)

N = channel_length;
P = pilot_length;
n = number_of_symbols;
K = channel_sparsity;

k = randperm(N);
XPos = sort(k(1:K));
A = []; xreal = []; groupreal = []; D = dct(eye(N));

if cplx
    xcomplex = [];
    groupcomplex = [];
end

for i = 1:n
    m = randperm(N);
    W = D(m(1:P),:);
    A = blkdiag(A,W);
    Xreal = zeros(N,1);
    Xcomplex = zeros(N,1);
    Xreal(XPos) = randn(K,1);
    xreal = [xreal' Xreal']';
    groupreal = [groupreal 1:N];
    if cplx
        Xcomplex(XPos) = randn(K,1);
        xcomplex = [xcomplex' Xcomplex']';
        groupcomplex = [groupcomplex 1:N];
    end
end

x = xreal;
group = groupreal;
if cplx
    x = [x' xcomplex']';
    group = [group groupcomplex];
    A = blkdiag(A,A);
end

y = A*x + noise*randn(size(A,1),1);
err = noise*sqrt(length(y));

Contact us at files@mathworks.com