load bat -ascii;
signal=bat;
iterative_number=30; %the matching pursuit processing iterative number
[a,N]=size(signal); %the length of signal and the length of atoms;N
signal_reconstruct=zeros(1,N);
signal_r=signal;
a_base=2; %scale: the scale is determined by a and j;
j_min=0;
j_max=log2(N);
u_base=1/2; %the transmission or displacement u should determined as following
v_base=pi; %the frequency v
k_min=0;
w_base=pi/6; %the phase w
i_min=0;
i_max=12;
signal_reconstruct=(1/N)*sum(signal);
signal_r=signal-signal_reconstruct;
[atoms]=dic_a(signal_r,N,a_base,j_min,j_max,u_base,v_base,k_min,w_base,i_min,i_max);
for n=1:iterative_number
n
[proj,scale,translation,freq,phase]=select_best(signal_r,N,a_base,j_min,j_max,u_base,v_base,k_min,w_base,i_min,i_max,atoms);
t=0:N-1;
t=(t-translation)/scale;
g1=(1/sqrt(scale))*exp(-pi*t.*t).*cos(freq*t+phase);
g=g1/sqrt(sum(g1.*g1));
signal_reconstruct =signal_reconstruct+proj*g;
signal_r=signal_r-proj*g;
subplot(221);
plot(signal); %original signal
subplot(222);
plot(g); %the atom
subplot(223);
plot(signal_r); %the residual
subplot(224);
plot(signal_reconstruct); %reconstruct signal
end
稀疏分解matlab程序
5星 · 超过95%的资源 需积分: 46 50 浏览量
2010-10-09
17:07:09
上传
评论 27
收藏 2KB RAR 举报
lizhaofei825
- 粉丝: 8
- 资源: 5
最新资源
- 功能强大的Java库,旨在简化与Milvus向量数据库的交互,为开发者提供类似MyBatis-Plus注解和方法调用的直观API
- ITK中基于B样条BSpline的可变形配准样例的输入输出图像
- 05-09 周四 vLLM的部署和实践
- WEB访问日志分析与入侵检测可视化系统源码(95分以上课设).zip
- UE4-UE5的官方预览模型
- 电子通信设计资料自动关断继电器驱动电路
- 基于Python使用递归和动态规划解决背包问题.zip
- 从0开始建立dSPACE RT Simulink工程:CAN通信(Bus Manager方法)DBC
- 轮胎X光缺陷检测数据集VOC+YOLO格式1903张4类别.zip
- 基于Matlab和遗传算法解决组合优化背包问题.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
- 1
- 2
- 3
- 4
- 5
- 6
前往页