资源简介

压缩感知的MATLAB仿真程序,非常适合初学者。

资源截图

代码片段和文件信息


%%%%%%%%%%%%% 若干频率正弦叠加信号 随机欠采样 压缩感知恢复(OMP算法) %%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%% 国防科学技术大学 杨俊刚 2011.03 %%%%%%%%%%%%%%%%%%%%

clear;

Tend=6; % 信号持续时间 0-Tend
fs=200; % 原始波形采样频率
tt1=0:1/fs:Tend; % 原始波形采样时间点
N=size(tt12); % 采样点数 
f1=13; % 正弦信号频率
f2=5;
f3=2;
y1=cos(2*pi*f1*tt1)+cos(2*pi*f2*tt1)+cos(2*pi*f3*tt1); % 波形

M=50;  % 随机欠采样信号的点数

%%%%%%%% 生成随机欠采样位置 %%%%%%%%%%%%%%%%
indexM=fix(rand(1M)*N); 
indexM=sort(indexM);
if (indexM(1)==0)
    indexM(1)=1;
end
 for kk=1:M-1
     while(indexM(kk+1)<=indexM(kk))
         indexM(kk+1)=indexM(kk+1)+1;
     end
 end
 %%%%%%%% 生成随机欠采样位置 end %%%%%%%%%%%%%%%%
 
 y2=y1(indexM); % 生成欠采样序列

DCT_Matrix=(dct(eye(N))).‘; % 生成稀疏变换矩阵 采用DCT矩阵

Sense=DCT_Matrix(indexM:); % 生成对应的测量矩阵

%%%%%%%% OMP 算法恢复
%%%%%%%% OMP start %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Aug=[];
cor

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件        1557  2020-09-29 05:26  CS_Examples\CS_OMP.m
     文件        1220  2020-09-29 05:26  CS_Examples\CS_SPGL1.m
     文件        3861  2020-09-29 05:26  CS_Examples\spgl1_1_7\ChangeLog
     文件         697  2020-09-29 05:26  CS_Examples\spgl1_1_7\Contents.m
     文件       26436  2020-09-29 05:26  CS_Examples\spgl1_1_7\COPYING
     文件         184  2020-09-29 05:26  CS_Examples\spgl1_1_7\NormGroupL2_dual.m
     文件         176  2020-09-29 05:26  CS_Examples\spgl1_1_7\NormGroupL2_primal.m
     文件         375  2020-09-29 05:26  CS_Examples\spgl1_1_7\NormGroupL2_project.m
     文件         221  2020-09-29 05:26  CS_Examples\spgl1_1_7\NormL12_dual.m
     文件         209  2020-09-29 05:26  CS_Examples\spgl1_1_7\NormL12_primal.m
     文件         463  2020-09-29 05:26  CS_Examples\spgl1_1_7\NormL12_project.m
     文件          63  2020-09-29 05:26  CS_Examples\spgl1_1_7\NormL1_dual.m
     文件          63  2020-09-29 05:26  CS_Examples\spgl1_1_7\NormL1_primal.m
     文件         227  2020-09-29 05:26  CS_Examples\spgl1_1_7\NormL1_project.m
     文件        2783  2020-09-29 05:26  CS_Examples\spgl1_1_7\README
     文件       16195  2020-09-29 05:26  CS_Examples\spgl1_1_7\spgdemo.m
     文件       30273  2020-09-29 05:26  CS_Examples\spgl1_1_7\spgl1.m
     文件        4725  2020-09-29 05:26  CS_Examples\spgl1_1_7\spgSetParms.m
     文件        1608  2020-09-29 05:26  CS_Examples\spgl1_1_7\spgsetup.m
     文件        1594  2020-09-29 05:26  CS_Examples\spgl1_1_7\spg_bp.m
     文件        1814  2020-09-29 05:26  CS_Examples\spgl1_1_7\spg_bpdn.m
     文件        2513  2020-09-29 05:26  CS_Examples\spgl1_1_7\spg_group.m
     文件        1626  2020-09-29 05:26  CS_Examples\spgl1_1_7\spg_lasso.m
     文件        2853  2020-09-29 05:26  CS_Examples\spgl1_1_7\spg_mmv.m
     文件        1561  2020-09-29 05:26  CS_Examples\spgl1_1_7\private\ensure.m
     文件        6398  2020-09-29 05:26  CS_Examples\spgl1_1_7\private\heap.c
     文件        3660  2020-09-29 05:26  CS_Examples\spgl1_1_7\private\heap.h
     文件       11849  2020-09-29 05:26  CS_Examples\spgl1_1_7\private\lsqr.m
     文件        2838  2020-09-29 05:26  CS_Examples\spgl1_1_7\private\oneProjector.m
     文件        5704  2020-09-29 05:26  CS_Examples\spgl1_1_7\private\oneProjectorCore.c
     文件        1485  2020-09-29 05:26  CS_Examples\spgl1_1_7\private\oneProjectorCore.h
............此处省略7个文件信息

评论

共有 条评论