浅谈压缩感知(三十二):压缩感知的常见测量矩阵
一、参考文献中常见的测量矩阵
[1]喻玲娟,谢晓春.压缩感知介绍[J].电视技术,2008,32(12):16-18.
[2]李树涛,魏丹.压缩传感综述[J]. 自动化学报,2009,35(11):1369-1377.
[3]焦李成,杨淑媛,刘芳,侯彪. 压缩感知回顾与展望[J]. 电子学报,2011,39(7):1651-1662.
[4]石光明,刘丹华,高大化,刘哲,林杰,王良君. 压缩感知理论及其研究进展[J]. 电子学报,2009,37(5):1070-1081.
[5]李坤,马彩文,李艳,陈萍.压缩感知重构算法综述[J].红外与激光工程,2013,42(z1):225-232.
[6]党骙,马林华,田雨,张海威,茹乐,李小蓓. m序列压缩感知测量矩阵构造[J]. 西安电子科技大学(自然科学版),2015,42(2):215-222.
[7]朱志臻,周崇彬,刘发林,李滨兵,张志达. 用于压缩感知的二值化测量矩阵[J]. 微波学报,2014,30(2):79-83,96.
[8]王学伟,崔广伟,王琳,贾晓璐,聂伟.基于平衡Gold序列的压缩感知测量矩阵的构造[J]. 仪器仪表学报,2014,35(1):97-102.
[9]张波,刘郁林,王开.稀疏随机矩阵有限等矩性质分析[J]. 电子与信息学报,2014,36(1):169-174.
[10]王侠,王开,王青云,梁瑞宇,左加阔,赵力,邹采荣. 压缩感知中的确定性随机观测矩阵构造[J]. 信号处理,2014,30(4):436-442.
下面以文献【吴赟.压缩感知测量矩阵的研究[D]. 西安电子科技大学硕士学位论文,2012】为依据,给出文献中2.2节内容所述的六种测量矩阵MATLAB实现代码,仅为一种参考实现方式,还未验证其正确性。
以下代码生成的高斯矩阵方差为1,若为改为1/M,只须将除以根号M即可。
- 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);
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-8)生成的伯努利矩阵,若要按式(2-9)生成则需使用后半部分注释掉的代码即可。注意代码中用到了MATLAB自带的randi函数,若你的MATLAB版本较低,可能要用randint函数代替,后面若用到此函数则一样要注意这一点。
- 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);
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.5Phi = randi([0,1],M,N);%If your MATLAB version is too low,please use randint insteadPhi(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
由于MATLAB自带的函数hadamard参数有限制,所以程序中首先计算满足要求的参数L,需要注意的是,hadamard参数并不像文献中所述仅为2的整数次幂,而是12的整数倍或20的整数倍或2的整数次幂,详情在MATLAB查看hadamard的help文件。
- 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));
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 2L_t = max(M,N);%Maybe L_t does not meet requirement of function hadamardL_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
以下代码生成的是部分傅里叶矩阵,这里要提的一点是,有关“归一化”的概念在网上说法不一,一种说法是向量除以向量各项之和,另一种说法是向量除以向量的2范数(各项平方之和再开方),这里采用后者。
- 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));
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 matrixRowIndex = randperm(N);Phi = Phi_t(RowIndex(1:M),:);%Select M rows randomly%normalizationfor ii = 1:NPhi(:,ii) = Phi(:,ii)/norm(Phi(:,ii));end end
- 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;
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:NColIdx = randperm(M);Phi(ColIdx(1:d),ii) = 1;end end
这里先给出托普利兹矩阵,文中说经过M次循环,这里直接利用MATLAB自带函数生成一个托普利兹方阵再取前M行。
- 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,:);
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)Bernoulliu = 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
下面是循环矩阵,仍然利用MATLAB自带函数生成。
- 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,:);
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)Bernoulliu = 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
以上都是采用MATLAB自带的toeplitz函数,这需要首先生成一个随机向量,而托普利兹矩阵和循环矩阵的区别也就在于这个随机向量的结构不同,注意代码中有关toeplitz函数的两个输入参数好好体会即可。
浅谈压缩感知(三十二):压缩感知的常见测量矩阵相关推荐
- 【Visual C++】游戏开发笔记三十二 浅墨DirectX提高班之一 DirectX大局观认知篇
本系列文章由zhmxy555(毛星云)编写,转载请注明出处. 文章链接: http://blog.csdn.net/zhmxy555/article/details/8172615 作者:毛星云(浅 ...
- 微信小程序把玩(三十二)Image API
原文:微信小程序把玩(三十二)Image API 选择图片时可设置图片是否是原图,图片来源.这用的也挺常见的,比如个人中心中设置头像,可以与wx.upLoadFile()API使用 主要方法: wx. ...
- NeHe OpenGL第三十二课:拾取游戏
NeHe OpenGL第三十二课:拾取游戏 拾取, Alpha混合, Alpha测试, 排序: 这又是一个小游戏,交给的东西会很多,慢慢体会吧 欢迎来到32课. 这课大概是在我所写作已来最大的一课 ...
- 压缩感知的常见测量矩阵
题目:压缩感知的常见测量矩阵 下面首先给出十篇参考文献中有关测量矩阵的叙述,然后以一篇硕士论文中对七种常见测量矩阵的描述依据,给出了这七种常见测量矩阵的MATLAB实现代码,以为以后的研究提供一个参考 ...
- 压缩感知高斯测量矩阵matlab,压缩感知的常见测量矩阵
题目:压缩感知的常见测量矩阵 下面首先给出十篇参考文献中有关测量矩阵的叙述,然后以一篇硕士论文中对七种常见测量矩阵的描述依据,给出了这七种常见测量矩阵的MATLAB实现代码,以为以后的研究提供一个参考 ...
- matlab 测量矩阵,压缩感知中的常见测量矩阵及其MATLAB实现代码
压缩感知中的常见测量矩阵及其MATLAB实现代码 压缩感知中的常见测量矩阵及其MATLAB实现代码 原文链接:http://blog.csdn.net/jbb0523/article/details/ ...
- 【正点原子Linux连载】第三十二章 U-Boot启动流程详解 -摘自【正点原子】I.MX6U嵌入式Linux驱动开发指南V1.0
1)实验平台:正点原子阿尔法Linux开发板 2)平台购买地址:https://item.taobao.com/item.htm?id=603672744434 2)全套实验源码+手册+视频下载地址: ...
- 程序员编程艺术第三十二~三十三章:最小操作数,木块砌墙问题
第三十二~三十三章:最小操作数,木块砌墙问题 作者:July.caopengcs.红色标记.致谢:fuwutu.demo. 时间:二零一三年八月十二日 题记 再过一两月,便又到了每年的九月十月校招高峰 ...
- 史记翻译-汉初三杰-韩信-淮阴侯列传第三十二
淮阴侯列传第三十二 王学孟 译注 [说明]本传记载了韩信一生的事迹,突出了他的军事才能和累累战功.功高于世,却落个夷灭宗族的下场.注入了作者无限同情和感慨. 他登坛拜将后与刘邦的一篇宏论,使韩信崭露头 ...
- axi dma 寄存器配置_FPGA Xilinx Zynq 系列(三十二)AXI 接口
大侠好,欢迎来到FPGA技术江湖,江湖偌大,相见即是缘分.大侠可以关注FPGA技术江湖,在"闯荡江湖"."行侠仗义"栏里获取其他感兴趣的资源,或者一起煮酒言欢. ...
最新文章
- hdu2833 Floyd + dp
- python安卓打包_Android多渠道打包之Python打包
- 这 12 款 IDEA 插件你用过几款?
- 深入理解Nginx 模块开发与架构解析-陶辉 读书笔记
- 03 php,PHP 03 选择结构
- iOS开发之Masonry框架-使用方法须知
- elasticsearch-7.15.2 同时支持中文ik分词器和pinyin分词器
- 蓝桥杯51单片机之数码管从点亮到动态时钟的实现【单片机开发初学者必掌握】
- 【IT】IT专业术语
- 常见Linux发行版本(转载)
- 区块链测试工具 Caliper性能测试工具是什么
- RoR ActionCable
- 数学建模——蒙特卡罗算法(Monte Carlo Method)
- 【STM32F429开发板用户手册】第2章 STM32F429的开发环境搭建
- “海潮效应”下,聚则“生”分则“亡”360奏响“经济复苏集结号”
- iOS解决“The ‘Pods-XXX‘ target has transitive dependencies that include statically linked binaries”报错
- .net函数查询_Java百宝箱——实现ip地址、手机号、身份证号归属地查询
- 炒股怎么炒?新手怎么学炒股?
- Java中getBytes()方法--使用详解
- Java-File文件操作
热门文章
- Android 悬浮窗权限各机型各系统适配大全
- 用Python制作学生管理系统
- [含论文+源码等]高校科研项目管理系统[包运行成功]
- 热爱我的热爱文章_热爱Linux的青少年的个性
- 苹果用户福音:iPhone免越狱,同时登两个微信
- Kotlin——高阶函数详解与标准的高阶函数使用
- 一些常用的语音特征提取算法
- Java生成和解析二维码工具类(简单经典)
- 百度地图获取河流_华为AR地图: 导航功能确实不错,还有更多AR新场景也值得关注...
- java 银联接口_银联接口测试——详细(JAVA)