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

浅谈压缩感知(七):常见测量矩阵的MATLAB实现的更多相关文章

  1. 浅谈压缩感知(二十四):压缩感知重构算法之子空间追踪(SP)

    主要内容: SP的算法流程 SP的MATLAB实现 一维信号的实验与结果 测量数M与重构成功概率关系的实验与结果 SP与CoSaMP的性能比较 一.SP的算法流程 压缩采样匹配追踪(CoSaMP)与子 ...

  2. 浅谈压缩感知(二十一):压缩感知重构算法之正交匹配追踪(OMP)

    主要内容: OMP的算法流程 OMP的MATLAB实现 一维信号的实验与结果 测量数M与重构成功概率关系的实验与结果 稀疏度K与重构成功概率关系的实验与结果 一.OMP的算法流程 二.OMP的MATL ...

  3. 浅谈压缩感知(二十):OMP与压缩感知

    主要内容: OMP在稀疏分解与压缩感知中的异同 压缩感知通过OMP重构信号的唯一性 一.OMP在稀疏分解与压缩感知中的异同 .稀疏分解要解决的问题是在冗余字典(超完备字典)A中选出k列,用这k列的线性 ...

  4. 浅谈压缩感知(十六):感知矩阵之RIP

    在压缩感知中,总是看到"矩阵满足RIP"之类的字眼,没错,这是一个压缩感知绕不开的术语,有限等距性质(Restricted Isometry Property, RIP). 注意: ...

  5. 浅谈压缩感知(十五):感知矩阵之spark常数

    在压缩感知中,有一些用来评价感知矩阵(非测量矩阵)的指标,如常见的RIP等,除了RIP之外,spark常数也能够用来衡量能否成为合适的感知矩阵. 0.相关概念与符号 1.零空间条件NULL Space ...

  6. 浅谈压缩感知(十四):傅里叶矩阵与小波变换矩阵的MATLAB实现

    主要内容: 傅里叶矩阵及其MATLAB实现 小波变换矩阵及其MATLAB实现  傅里叶矩阵及其MATLAB实现 傅里叶矩阵的定义:(来源: http://mathworld.wolfram.com/F ...

  7. 浅谈压缩感知(二十八):压缩感知重构算法之广义正交匹配追踪(gOMP)

    主要内容: gOMP的算法流程 gOMP的MATLAB实现 一维信号的实验与结果 稀疏度K与重构成功概率关系的实验与结果 一.gOMP的算法流程 广义正交匹配追踪(Generalized OMP, g ...

  8. 浅谈压缩感知(二十六):压缩感知重构算法之分段弱正交匹配追踪(SWOMP)

    主要内容: SWOMP的算法流程 SWOMP的MATLAB实现 一维信号的实验与结果 门限参数a.测量数M与重构成功概率关系的实验与结果 SWOMP与StOMP性能比较 一.SWOMP的算法流程 分段 ...

  9. 浅谈压缩感知(二十五):压缩感知重构算法之分段正交匹配追踪(StOMP)

    主要内容: StOMP的算法流程 StOMP的MATLAB实现 一维信号的实验与结果 门限参数Ts.测量数M与重构成功概率关系的实验与结果 一.StOMP的算法流程 分段正交匹配追踪(Stagewis ...

随机推荐

  1. Golang 处理 Json(二):解码

    golang 编码 json 还比较简单,而解析 json 则非常蛋疼.不像 PHP 一句 json_decode() 就能搞定.之前项目开发中,为了兼容不同客户端的需求,请求的 content-ty ...

  2. linux-socket connect阻塞和非阻塞模式 示例

    ~/cpp$ ./connect 192.168.1.234 1234 kkkk block mode:  ubuntu 14.04 : time used:21.0.001053s connect ...

  3. vue首屏加载优化

    库使用情况 vue vue-router axios muse-ui material-icons vue-baidu-map 未优化前 首先我们在正常情况下build 优化 1. 按需加载 当前流行 ...

  4. ASP.NET MVC中实现属性和属性值的组合,即笛卡尔乘积01, 在控制台实现

    在电商产品模块中必经的一个环节是:当选择某一个产品类别,动态生成该类别下的所有属性和属性项,这些属性项有些是以DropDownList的形式存在,有些是以CheckBoxList的形式存在.接着,把C ...

  5. spring集成jpa【为什么有 persistant.xml 文件呢?】

    原文地址: http://www.cnblogs.com/javahuang/archive/2012/12/19/2824633.html spring集成JPA的其中一种方式 JPA和hibern ...

  6. ASIHTTPRequest系列(一):同步和异步请求

    ASIHTTPRequest系列(一):同步和异步请求 发表于8个月前(2013-11-27 19:21)   阅读(431) | 评论(0) 6人收藏此文章, 我要收藏 赞0 ASIHTTPRequ ...

  7. 【docker】docker部署spring boot服务 选择配置文件启动

    默认启动命令: docker run --name swapping -itd --net=host -v /etc/localtime:/etc/localtime:ro -v /etc/timez ...

  8. .NET:Assembly.CodeBase vs. Assembly.Location

    The CodeBase is a URL to the place where the file was found, while the Location is the path from whe ...

  9. spring boot对输入的字符串进行html转码

    可以使用HtmlUtils这个类进行操作.具体的可以参考API,或者点出来看.

  10. Gallery和自定义Adapter配合使用,实现图片预览

    Gallery是一个可以拖动的列表,正中对应的是选中的东西.他和spinner有共同的父类:AbsSpinner 属性: android:animationDuration="1000&qu ...