浅谈压缩感知(七):常见测量矩阵的MATLAB实现
来源:互联网 发布:java开发的方向 编辑:程序博客网 时间:2024/06/08 10:39
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%% (1)Generate Bernoulli matrix(The first kind)% 1--P=0.5 -1--P=0.5 Phi = randi([0,1],M,N);%If your MATLAB version is too low,please use randint instead Phi(Phi==0) = -1; %Phi = Phi/sqrt(M);% %% (2)Generate Bernoulli matrix(The second kind)% % 1--P=1/6 -1--P=1/6 0--2/3% Phi = randi([-1,4],M,N);%If your MATLAB version is too low,please use randint instead% Phi(Phi==2) = 0;%P=1/6% Phi(Phi==3) = 0;%P=1/6% Phi(Phi==4) = 0;%P=1/6% %Phi = Phi*sqrt(3/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/12,%or n/20 is a power of 2 L_t = max(M,N);%Maybe L_t does not meet requirement of function hadamard L_t1 = (12 - mod(L_t,12)) + L_t; L_t2 = (20 - mod(L_t,20)) + L_t; L_t3 = 2^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(1:M),:); ColIndex = randperm(L); Phi = Phi_t_r(:,ColIndex(1: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(1:M),:);%Select M rows randomly %normalization for ii = 1:N Phi(:,ii) = Phi(:,ii)/norm(Phi(:,ii)); endend
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 '1' in every column,d<M % Phi -- The SparseRandom matrix%% Generate SparseRandom matrix Phi = zeros(M,N); for ii = 1:N ColIdx = randperm(M); Phi(ColIdx(1:d),ii) = 1; endend
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% %(1)Gauss% u = randn(1,2*N-1); %(2)Bernoulli u = randi([0,1],1,2*N-1); u(u==0) = -1;%% Generate Toeplitz matrix Phi_t = toeplitz(u(N:end),fliplr(u(1:N))); Phi = Phi_t(1: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% %(1)Gauss% u = randn(1,N); %(2)Bernoulli u = randi([0,1],1,N); u(u==0) = -1;%% Generate Circulant matrix Phi_t = toeplitz(circshift(u,[1,1]),fliplr(u(1:N))); Phi = Phi_t(1:M,:);end
4 0
- 浅谈压缩感知(七):常见测量矩阵的MATLAB实现
- 压缩感知中的常见测量矩阵及其MATLAB实现代码
- 压缩感知的常见测量矩阵
- 压缩感知的常见测量矩阵
- 常见测量矩阵的MATLAB实现
- 常见测量矩阵的MATLAB实现
- 压缩感知测量矩阵详解
- 压缩感知测量矩阵之如何评价一个测量矩阵的好坏?
- 压缩感知测量矩阵之spark常数
- 压缩感知之测量矩阵研究现状
- 压缩感知测量矩阵构造方法研究
- 压缩感知测量矩阵之有限等距常数RIC的计算
- 压缩感知测量矩阵之有限等距性质(Restricted Isometry Property, RIP)
- 压缩感知测量矩阵之有限等距性质(Restricted Isometry Property, RIP)
- 压缩感知测量矩阵之有限等距性质(Restricted Isometry Property, RIP)
- 压缩感知中常用的观测矩阵
- 浅谈压缩感知(一):背景简介
- 浅谈压缩感知(二):理论基础
- 浅谈压缩感知(六):TVAL3
- 论文阅读笔记——Generalizing Pooling Functions in Convolutional Neural Networks: Mixed, Gated, and Tree
- 项目一-验证算法-希尔排序,冒泡排序
- Day1之ForTest
- nginx与apache的区别
- 浅谈压缩感知(七):常见测量矩阵的MATLAB实现
- 第十四周项目二:验证分块查找的算法
- 新人报道
- 第十六周--验证算法(归并排序)
- struts2通过配置文件实现动态调用action
- h5案例分享--雀巢咖啡--传奇创世
- 【项目2 - 大数据集上排序算法性能的体验】
- 第十六周 项目1 验证算法 快速排序
- 第十三周项目1-Prim算法的验证