【数字信号去噪】基于matlab稀疏性BEADS色谱基线估计和去噪【含Matlab源码 1887期】
【摘要】
一、获取代码方式
获取代码方式1: 完整代码已上传我的资源:【数字信号去噪】基于matlab稀疏性 BEADS色谱基线估计和去噪【含Matlab源码 1887期】
获取代码方式2: 通过订阅紫极神光博...
一、获取代码方式
获取代码方式1:
完整代码已上传我的资源:【数字信号去噪】基于matlab稀疏性 BEADS色谱基线估计和去噪【含Matlab源码 1887期】
获取代码方式2:
通过订阅紫极神光博客付费专栏,凭支付凭证,私信博主,可获得此代码。
备注:
订阅紫极神光博客付费专栏,可免费获得1份代码(有效期为订阅日起,三天内有效);
二、部分源代码
%% Example: Chromatograms BEADS (Baseline Estimation And Denoising with Sparsity)
%%开始
clear all
addpath data
load data/noise.mat;
load data/chromatograms.mat;
whos
%%下载数据
% Load data and add noise.
y = X(:, 3) + noise * 0.5;
N = length(y);
%% Run the BEADS algorithm
% Filter parameters
fc = 0.006; % fc : cut-off frequency (cycles/sample)
d = 1; % d : filter order parameter (d = 1 or 2)
% Positivity bias (peaks are positive)
r = 6; % r : asymmetry parameter
% Regularization parameters
amp = 0.8;
lam0 = 0.5*amp;
lam1 = 5*amp;
lam2 = 4*amp;
tic
[x1, f1, cost] = beads(y, d, fc, r, lam0, lam1, lam2);
toc
%% Display the output of BEADS
ylim1 = [-50 200];
xlim1 = [0 3800];
figure(1)
clf
subplot(4, 1, 1)
plot(y)
title('数据')
xlim(xlim1)
ylim(ylim1)
set(gca,'ytick', ylim1)
subplot(4, 1, 2)
plot(y,'color', [1 1 1]*0.7)
line(1:N, f1, 'LineWidth', 1)
legend('Data', 'Baseline')
legend boxoff
title(['Baseline, as estimated by BEADS', ' (r = ', num2str(r), ', fc = ', num2str(fc), ', d = ', num2str(d),')'])
xlim(xlim1)
ylim(ylim1)
set(gca,'ytick', ylim1)
subplot(4, 1, 3)
plot(x1)
title('基线校正数据')
xlim(xlim1)
ylim(ylim1)
set(gca,'ytick', ylim1)
subplot(4, 1, 4)
plot(y - x1 - f1)
title('剩余的')
xlim(xlim1)
ylim(ylim1)
set(gca,'ytick', ylim1)
orient tall
print -dpdf example
%% Display cost function history
figure(2)
clf
plot(cost)
xlabel('迭代次数')
ylabel('成本函数值')
title('历史成本函数')
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
三、运行结果
四、matlab版本及参考文献
1 matlab版本
2014a
2 参考文献
[1] 沈再阳.精通MATLAB信号处理[M].清华大学出版社,2015.
[2]高宝建,彭进业,王琳,潘建寿.信号与系统——使用MATLAB分析与实现[M].清华大学出版社,2020.
[3]王文光,魏少明,任欣.信号处理与系统分析的MATLAB实现[M].电子工业出版社,2018.
文章来源: qq912100926.blog.csdn.net,作者:海神之光,版权归原作者所有,如需转载,请联系作者。
原文链接:qq912100926.blog.csdn.net/article/details/125303407
【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)