当前位置:网站首页>Common sparse basis and matlab code for compressed sensing
Common sparse basis and matlab code for compressed sensing
2022-07-29 00:35:00 【Love learning one by one】
List of articles
Preface
The first step of compressed sensing is the sparse representation of the signal , So it is particularly important to find sparse bases , This blog will introduce the commonly used sparse basis and its matlab Code .
One 、 What is a sparse base ?
Sparse basis is a matrix that can sparse represent signals . Let one-dimensional discrete signal x x x, The length is N N N, Can be seen as N N N Dimensional space N × 1 N \times1 N×1 The column vector , If this column vector contains K K K It's not for 0 Elements , And K < < N K < < N K<<N, The signal x x x yes K K K- Sparse signal , Have sparsity .
If the signal is sparse , Then signal x x x It can be expressed as : x = Ψ s x=\varPsi s x=Ψs among , Ψ \varPsi Ψ Sparse basis ( sparse matrix ).
Two 、 Some commonly used sparse bases
1、DFT( Discrete Fourier ) Sparse basis
%%matlab Built-in function
dftmtx(N)/sqrt(N);
%% Equivalent to the above
fft(eye(N))/sqrt(N);
2、DCT( Discrete cosine ) Sparse basis
%% matlab Built-in function
dctmtx(N);
%% Expand and write as :
[cc,rr] = meshgrid(0:n-1);
c = sqrt(2 / n) * cos(pi * (2*cc + 1) .* rr / (2 * n));
c(1,:) = c(1,:) / sqrt(2);
3、DWT( wavelet ) Sparse basis
function ww=DWT(N)
[h,g]= wfilters('sym8','d'); % Decompose low-pass and high pass filters
% N=256; % Matrix dimension ( The size is 2 Integer power of )
L=length(h); % Filter length
rank_max=log2(N); % Maximum number of layers
rank_min=double(int8(log2(L)))+1; % Minimum number of layers
ww=1; % Preprocessing matrix
% Matrix construction
for jj=rank_min:rank_max
nn=2^jj;
% Construct vectors
p1_0=sparse([h,zeros(1,nn-L)]);
p2_0=sparse([g,zeros(1,nn-L)]);
% Vector circumferential shift
for ii=1:nn/2
p1(ii,:)=circshift(p1_0',2*(ii-1))';
p2(ii,:)=circshift(p2_0',2*(ii-1))';
end
% Construct an orthogonal matrix
w1=[p1;p2];
mm=2^rank_max-length(w1);
w=sparse([w1,zeros(length(w1),mm);zeros(mm,length(w1)),eye(mm,mm)]);
ww=ww*w;
clear p1;clear p2;
end
The author of the program is Javert , Department of electrical and electronic engineering, University of Hong Kong ,[email protected]
4、0-1 Random sparse basis ( It is also reasonable according to the sparse characteristics )
%% Use rand Function generation 0-1 The number of intervals
function A=get01(N)
B=rand(N,N); % Will produce N That's ok N Column random number matrix
A=round(B); % Round the resulting matrix , You can get non 0 namely 1 Matrix
end
summary
The above is the content and code of the sparse base to be shown , If you have other commonly used sparse bases , Welcome to comment and share below ~
边栏推荐
- Advanced area of attack and defense world web masters ics-06
- IMG tags prohibit dragging pictures
- 动态规划问题(七)
- Attack and defense world web master advanced area PHP_ rce
- Linux下安装Mysql5.7,超详细完整教程,以及云mysql连接
- Introduction and solution of common security vulnerabilities in Web System SQL injection
- Camera Hal OEM module ---- CMR_ preview.c
- Applet waterfall flow, upload pictures, simple use of maps
- Anti shake and throttling
- 15.模型评估和选择问题
猜你喜欢

vulnhub:Sar

PTA (daily question) 7-75 how many people in a school

PTA (daily question) 7-69 narcissus number

Application and principle of distributed current limiting redistribution rratelimiter

NFTScan 与 NFTPlay 在 NFT 数据领域达成战略合作

Advanced area of attack and defense world web masters unserialize3

16.偏差、方差、正则化、学习曲线对模型的影响

Still writing a lot of if to judge? A rule executor kills all if judgments in the project

Shell编程规范与变量

vscode下链接远程服务器安装插件失败、速度慢等解决方法
随机推荐
动态规划问题(七)
软考 --- 数据库(4)SQL语句
【飞控开发基础教程8】疯壳·开源编队无人机-I2C(激光测距)
Idea connection database
总结:POD与容器的区别
Camera Hal OEM module ---- CMR_ preview.c
flask结合容联云发送验证码
ACM SIGIR 2022 | interpretation of selected papers of meituan technical team
SAP VL02N 交货单过账函数 WS_DELIVERY_UPDATE
What does WGet mean
[development tutorial 10] crazy shell · open source Bluetooth heart rate waterproof sports Bracelet - Bluetooth ble transceiver
PTA (daily question) 7-75 how many people in a school
Anti shake and throttling
Html+css+php+mysql realize registration + login + change password (with complete code)
还在写大量 if 来判断?一个规则执行器干掉项目中所有的 if 判断...
Linux下安装Mysql5.7,超详细完整教程,以及云mysql连接
Redis learning notes
动态规划问题(五)
CV semantic segmentation model sketch (2)
【微服务~Nacos】Nacos服务提供者和服务消费者