当前位置:网站首页>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 unserialize3
- What does the expression > > 0 in JS mean
- Dynamic programming problem (1)
- Router view cannot be rendered (a very low-level error)
- How to learn R language
- [applet project development -- JD mall] uni app commodity classification page (first)
- IDEA 连接 数据库
- vulnhub:SolidState
- IMG tags prohibit dragging pictures
- Still writing a lot of if to judge? A rule executor kills all if judgments in the project
猜你喜欢

vulnhub:SolidState
![[applet project development -- JD mall] uni app commodity classification page (first)](/img/6c/5b92fc1f18d58e0fdf6f1896188fcd.png)
[applet project development -- JD mall] uni app commodity classification page (first)

乱打日志的男孩运气怎么样我不知道,加班肯定很多!

15. Model evaluation and selection

PHP语言基础知识(超详细)

flyway的快速入门教程

MySQL 分库分表及其平滑扩容方案

Advanced area of attack and defense world web masters -baby Web

What are the skills of API interface optimization?

NPM run serve stuck at 40%
随机推荐
The difference between {} and ${}
flyway的快速入门教程
vulnhub:SolidState
requestVideoFrameCallback() 简单实例
动态规划问题(二)
递归/回溯刷题(下)
动态规划问题(四)
Attack and defense world web master advanced area web_ php_ unserialize
动态规划问题(七)
Cause analysis of 12 MySQL slow queries
Idea2021.2 installation and configuration (continuous update)
最长上升子序列
【微服务~Nacos】Nacos服务提供者和服务消费者
[untitled]
时间序列统计分析
Advanced area of attack and defense world web masters ics-06
MySQL installation and configuration tutorial (super detailed, nanny level)
总结:POD与容器的区别
"Method not allowed", 405 problem analysis and solution
The download file of native JS implementation can be used anywhere