1、随机高斯测量矩阵
function [ Phi ] = GaussMtx( M,N )
%GaussMtx Summary of this function goes here
% Generate Bernoulli matrix
% M -- RowNumber
% N -- ColumnNumber
% Phi -- The Gauss matrix %% Generate Gauss matrix
Phi = randn(M,N);
%Phi = Phi/sqrt(M);
end
2、随机贝努力测量矩阵
function [ Phi ] = BernoulliMtx( M,N )
%BernoulliMtx Summary of this function goes here
% Generate Bernoulli matrix
% M -- RowNumber
% N -- ColumnNumber
% Phi -- The Bernoulli matrix %% ()Generate Bernoulli matrix(The first kind)
% --P=0.5 ---P=0.5
Phi = randi([,],M,N);%If your MATLAB version is too low,please use randint instead
Phi(Phi==) = -;
%Phi = Phi/sqrt(M);
% %% ()Generate Bernoulli matrix(The second kind)
% % --P=/ ---P=/ --/
% Phi = randi([-,],M,N);%If your MATLAB version is too low,please use randint instead
% Phi(Phi==) = ;%P=/
% Phi(Phi==) = ;%P=/
% Phi(Phi==) = ;%P=/
% %Phi = Phi*sqrt(/M);
end
3、部分哈达玛测量矩阵
function [ Phi ] = PartHadamardMtx( M,N )
%PartHadamardMtx Summary of this function goes here
% Generate part Hadamard matrix
% M -- RowNumber
% N -- ColumnNumber
% Phi -- The part Hadamard matrix %% parameter initialization
%Because the MATLAB function hadamard handles only the cases where n, n/,
%or n/ is a power of
L_t = max(M,N);%Maybe L_t does not meet requirement of function hadamard
L_t1 = ( - mod(L_t,)) + L_t;
L_t2 = ( - mod(L_t,)) + L_t;
L_t3 = ^ceil(log2(L_t));
L = min([L_t1,L_t2,L_t3]);%Get the minimum L
%% Generate part Hadamard matrix
Phi = [];
Phi_t = hadamard(L);
RowIndex = randperm(L);
Phi_t_r = Phi_t(RowIndex(:M),:);
ColIndex = randperm(L);
Phi = Phi_t_r(:,ColIndex(:N));
end
4、部分傅里叶测量矩阵
function [ Phi ] = PartFourierMtx( M,N )
%PartFourierMtx Summary of this function goes here
% Generate part Fourier matrix
% M -- RowNumber
% N -- ColumnNumber
% Phi -- The part Fourier matrix %% Generate part Fourier matrix
Phi_t = fft(eye(N,N))/sqrt(N);%Fourier matrix
RowIndex = randperm(N);
Phi = Phi_t(RowIndex(:M),:);%Select M rows randomly
%normalization
for ii = :N
Phi(:,ii) = Phi(:,ii)/norm(Phi(:,ii));
end
end
5、稀疏随机测量矩阵
function [ Phi ] = SparseRandomMtx( M,N,d )
%SparseRandomMtx Summary of this function goes here
% Generate SparseRandom matrix
% M -- RowNumber
% N -- ColumnNumber
% d -- The number of '' in every column,d<M
% Phi -- The SparseRandom matrix %% Generate SparseRandom matrix
Phi = zeros(M,N);
for ii = :N
ColIdx = randperm(M);
Phi(ColIdx(:d),ii) = ;
end
end
6、托普利兹测量矩阵与循环测量矩阵
function [ Phi ] = ToeplitzMtx( M,N )
%ToeplitzMtx Summary of this function goes here
% Generate Toeplitz matrix
% M -- RowNumber
% N -- ColumnNumber
% Phi -- The Toeplitz matrix %% Generate a random vector
% %()Gauss
% u = randn(,*N-);
%()Bernoulli
u = randi([,],,*N-);
u(u==) = -;
%% Generate Toeplitz matrix
Phi_t = toeplitz(u(N:end),fliplr(u(:N)));
Phi = Phi_t(:M,:);
end
function [ Phi ] = CirculantMtx( M,N )
%CirculantMtx Summary of this function goes here
% Generate Circulant matrix
% M -- RowNumber
% N -- ColumnNumber
% Phi -- The Circulant matrix %% Generate a random vector
% %()Gauss
% u = randn(,N);
%()Bernoulli
u = randi([,],,N);
u(u==) = -;
%% Generate Circulant matrix
Phi_t = toeplitz(circshift(u,[,]),fliplr(u(:N)));
Phi = Phi_t(:M,:);
end
参考来源:http://blog.csdn.net/jbb0523/article/details/44700735