压缩感知中常用的观测矩阵

接上文:《压缩感知中常用的待还原信号种类》,http://blog.csdn.net/zhyoulun/article/details/25600311

在压缩感知中,观测矩阵就是指y=Ax中的A。A是一个n*m的矩阵,矩阵中的每一个元素独立同分布于一个特定的分布。分布的种类如下:
1、USE。一致球集合,Uniform spherical ensemble,首先计算出一个n*m的矩阵,矩阵中的每一个元素服从标准正态分布,然后对这个矩阵的每一列做归一化。
2、RSE。随机信号集合,Random signs ensemble,首先计算出一个n*m的矩阵,矩阵中的每一个元素服从伯努利+/-1分布,然后对这个矩阵的每一列做归一化。
3、Fourier。局部傅里叶集合,Partial Fourier ensemble,首先计算出一个m*m的傅里叶矩阵,随机取n行,最后对列进行归一化。
4、RST。局部实傅里叶集合,Partial RST (Real Fourier) ensemble.同“Fourier”的情况。
5、Hadamard。局部哈达玛集合,Partial Hadamard ensemble. 首先计算出一个m*m的哈达玛矩阵,随机取n行,最后对列进行归一化。
6、URP。一致随机投影集合,Uniform Random Projection ensemble. 首先产生一个m*m的正交矩阵,然后随机取出n行。
7、IR。单位矩阵和随机正交基,Identity and Random otho-basis. 将一个n*n的单位矩阵和一个n*n的随机正交基连接起来,产生一个n*2n的矩阵。

SparseLab2.1-Core\Utilities\BuildDatasets\MatrixEnsemble.m
附代码
function Phi = MatrixEnsemble(n,m,ensemble)
% MatrixEnsemble: Generates a random matrix of size n by m.
%
% Usage:
% Phi = MatrixEnsemble(n,m,ensemble)
% Inputs:
% n number of rows
% m number of columns
% ensemble string containing name of matrix ensemble:
% 'USE', 'RSE', 'Fourier', 'RST', 'Hadamard', 'URP', 'IR'. 
% Default is 'USE'.
% Outputs:
% Phi n by m matrix from the specified ensemble
% Description:
% This function creates a matrix from the specified random matrix 
% ensemble. The following random ensembles are implemented:
%
% 'USE' - Uniform spherical ensemble. Columns are n-vectors, 
% uniformly distributed on the sphere S^{n-1} (default).
%
% 'RSE' - Random signs ensemble. Entries in the matrix are 
% chosen from a bernoulli +/-1 distribution, and columns are 
% normalized to have unit euclidean length.
%
% 'Fourier' - Partial Fourier ensemble. Matrices in this ensemble 
% are generated by taking the m by m Fourier matrix, sampling 
% n rows at random, and scaling columns to have unit euclidean length.
%
% 'RST' - Partial RST (Real Fourier) ensemble. See 'Fourier' above.
%
% 'Hadamard' - Partial Hadamard ensemble. Matrices in this ensemble 
% are generated by taking the m by m Hadamard matrix, sampling 
% n rows at random, and scaling columns to have unit euclidean length.
%
% 'URP' - Uniform Random Projection ensemble. Matrices in this 
% ensemble are generated by sampling n rows of an m by m 
% random orthogonal matrix.
%
% 'IR' - Identity and Random otho-basis. An n by 2n matrix is 
% constructed, as the concatenation of the n by n identity and 
% an n x n random ortho-basis. 
%
% See Also
% SparseVector

if nargin < 3,
    ensemble = 'USE';
end

switch upper(ensemble)
    case 'USE'
        Phi = randn(n,m);

        % Normalize the columns of Phi
        for j = 1:m
            Phi(:,j) = Phi(:,j) ./ twonorm(Phi(:,j));
        end
        
    case 'RSE'
        Phi = sign(rand([n m]) - 0.5);
        zz = find(Phi == 0);
        Phi(zz) = ones(size(zz));

        % Normalize the columns of Phi
        for ii = 1:size(Phi,2)
            Phi(:,ii) = Phi(:,ii) ./ twonorm(Phi(:,ii));
        end
        
    case 'HADAMARD'
        H = hadamard(m);
        p = randperm(m);
        Phi = H(p(1:n), :);
    
        % Normalize the columns of Phi
        for ii = 1:size(Phi,2)
            Phi(:,ii) = Phi(:,ii) ./ twonorm(Phi(:,ii));
        end
        
    case 'FOURIER'
        H = FourierMat(m);
        p = randperm(m);
        Phi = H(p(1:n), :);
    
        % Normalize the columns of Phi
        for ii = 1:size(Phi,2)
            Phi(:,ii) = Phi(:,ii) ./ twonorm(Phi(:,ii));
        end

    case 'RST'
        H = RSTMat(m);
        p = randperm(m);
        Phi = H(p(1:n), :);
    
        % Normalize the columns of Phi
        for ii = 1:size(Phi,2)
            Phi(:,ii) = Phi(:,ii) ./ twonorm(Phi(:,ii));
        end

    case 'URP'
        [U,S,V] = svd(rand(n,m),'econ');
        Phi = V';

        % Normalize the columns of Phi
        for ii = 1:size(Phi,2)
            Phi(:,ii) = Phi(:,ii) ./ twonorm(Phi(:,ii));
        end
        
    case 'IR'
        [Q,R] = qr(rand(n));
        Phi = [eye(n) Q];
        
end%
% Part of SparseLab Version:100
% Created Tuesday March 28, 2006
% This is Copyrighted Material
% For Copying permissions see COPYING.m
% Comments? e-mail sparselab@stanford.edu
%

运行示例:


  • 3
    点赞
  • 45
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
压缩感知MATLAB有广泛的应用。MATLAB提供了许多工具和函数,用于实现压缩感知算法。以下是使用MATLAB进行压缩感知的一般流程: 1. 信号模型和稀疏表示:首先,确定信号的模型和稀疏表示方法。根据信号的特性,选择适合的稀疏表示方法,例如傅里叶变换、小波变换等。 2. 观测矩阵设计:设计一个观测矩阵,将信号投影到低维空间。观测矩阵的选择对于压缩感知的性能起着至关重要的作用。常见的观测矩阵有随机矩阵和稀疏矩阵等。 3. 采样和量化:根据观测矩阵,对信号进行采样并进行量化。采样过程是将信号转换为数字形式的过程,量化是将连续信号转换为离散信号的过程。 4. 压缩感知重构算法:根据观测结果和观测矩阵,使用压缩感知重构算法对信号进行重构。常见的算法有基于贪婪迭代的OMP算法、基于迭代收缩(IST)算法、基于最小二乘(L1-MAGIC)算法等。 5. 重构结果评估:通过计算重构图像的峰值信噪比(PSNR)等指标来评估重构结果的质量。 需要注意的是,压缩感知的性能受到多个因素的影响,如观测数、稀疏度、采样率等。在具体实现时,可以根据实际需求进行参数调整和优化。 请注意,以上是一般的流程,具体的压缩感知算法和实现方法可能会因应用场景和需求而有所不同。在使用MATLAB进行压缩感知时,可以参考MATLAB的文档和示例代码,以及相关的学术论文和研究成果。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* *3* [基于MATLAB的图像压缩感知](https://blog.csdn.net/sunny_chenxi/article/details/120014760)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 100%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值