当前位置:网站首页>Matlab| sparse auxiliary signal denoising and pattern recognition in time series data
Matlab| sparse auxiliary signal denoising and pattern recognition in time series data
2022-06-23 15:37:00 【Power system code】
Catalog
3、 ... and 、Matlab Code implementation
One 、 summary
In this paper, by combining linear time invariant filter 、 Orthogonal multiresolution representation and method based on sparsity , It solves the problems of signal de-noising and pattern recognition when processing batch mode time series data . Spectrum transformation expressed by state space of digital filter , Low pass the high-order zero phase 、 A new method for designing high pass and bandpass infinite impulse response filters as matrices . A technique based on near end gradient is also proposed , It is used to factorize a special class of zero phase high pass and band-pass digital filters , So that the factorization product preserves the zero phase property of the filter , The input sparse derivative component is added to the signal model . In order to show the application of the novel filter design , Verify and propose a new signal model , To simultaneously denoise and identify patterns of interest . First, we use our proposed filter design to test the existing signal model , The model combines linear time invariant (LTI) Filters and methods based on sparsity . The filter design proposed in this paper is combined with the existing signal model , A method called sparse auxiliary signal denoising is developed (SASD) A new signal model . Using simulation data , Proved SASD Robustness of the signal model under different order filters and noise levels . thereafter , A new method called sparsity aided pattern recognition is proposed and derived (SAPR) A new signal model . stay SAPR in , Will also LTI Bandpass filter and sparse based method with orthogonal multiresolution representation ( Such as wavelet ) Combination , To detect a specific mode in the input signal . Last , This paper combines signal denoising with pattern recognition , A method called sparse auxiliary signal denoising and pattern recognition is derived (SASDPR) A new signal model . Sleep EEG data were used to detect K Complexes and sleep spindles , So that explains SAPR and SASDPR Functions of the framework .
Two 、 Example and simulation
Example 1 :
Sparse auxiliary signal denoising ( SASD ) The algorithm combines total variation denoising and low-pass filtering to filter the noisy signal , Thus, the signal discontinuity is maintained .

Example 2 :
Use the banded matrix to demonstrate an example of zero phase filtering :

Example 3 :
Sparse auxiliary signal denoising ( SASD ) The algorithm combines total variation denoising and low-pass filtering to filter the noisy signal , Thus, the signal discontinuity is maintained . In this case , We use LPF、TVD、SASS and SASD Denoise ECG signal :

Example 4 :
Sparse auxiliary signal denoising and pattern recognition (SASDPR) The oscillation mode of interest in a given signal will be de noised and detected simultaneously :

Example 5 :
Sparse auxiliary signal denoising and pattern recognition (SASDPR) The oscillation mode of interest in a given signal will be de noised and detected simultaneously :

Example 6 :
Sparse aided pattern recognition (SAPR) The wavelet pattern in the detection signal :

3、 ... and 、Matlab Code implementation
This article only shows part of the code , All code points here : We are shipping your work details
function [y, f, s, x, w] = generate_signal( fs, sigma )
%% Initialize noise level and signal length
rng('default')
N = 10*fs;
n = 0:N-1;
%% Produce low-frequency synthetic ingredients
f = 0.1;
f = sin(2*f/fs*pi*n);
%% Oscillate
s = zeros(size(n));
o = 13;
s(200+(1:fs)) = sin(2*pi*o/fs*(1:fs)) .* hamming(fs)';
%% Sparse piecewise constant
x = zeros(size(n));
x(100:110) = -1;
x(400:420) = 1;
%% Add noise
w = sigma*randn(size(n));
y = f+s+x+w;
end
%% plot_signals( y, x_ex3, kc, k, tk, th, binX, binA, method)
%
% Inputs:
% y - Noise signal
% x_ex3 - Sleep spindle signal
% k - detected k- Synthetic wave signal
% tk - Teager-Kaiser Energy operators
% th - Spindle detection threshold
% binX - Binary vector
% binA - Binary vector with algorithm annotation spindle
% method - SASDPR/DETOKS
%
% Outputs:
% None
%% ________________________________________________________________________
%%
function plot_signals( y, x_ex3, kc, k, tk, th, binX, binA, method)
global simdata;
fs = simdata.fs;
if strcmp(method, 'DETOKS')
txt_1 = [method, ', EEG signal ($\mathbf{y}$), ','$\lambda_1$ = ', num2str(simdata.lam0_detoks), ...
', $\lambda_2$ = ', num2str(simdata.lam1_detoks), ', $\lambda_3$ = ', num2str(simdata.lam2_detoks),...
', $\mu$ = ', num2str(simdata.mu_detoks)];
txt_2 = [method, ', Low-frequency signal'];
txt_3 = [method, ', Teager-Kaiser energy operator, Threshold = ', num2str(simdata.th_detoks)];
txt_4 = [method, ', Detected EEG K-complexes'];
elseif strcmp(method, 'SAPR')
txt_1 = [method, ', EEG signal ($\mathbf{y}$), ','$\lambda_1$ = ', num2str(simdata.lam0_sapr), ...
', $\lambda_2$ = ', num2str(simdata.lam1_sapr), ', $\eta$ = ', num2str(simdata.eta_sapr),...
', $\mu$ = ', num2str(simdata.mu_sapr)];
txt_2 = [method, ', K-Complex signal ($\mathbf{x}_2$)'];
txt_3 = [method, ', Teager-Kaiser energy operator, Threshold = ', num2str(simdata.th_sapr)];
txt_4 = [method, ', Detected EEG K-complexes'];
end
N = length(y);
n = 0:N-1;
%% Plot
figure('rend','painters','pos',[100 100 550 500]);
clf
subplot(4,1,1);
text(-0.1,0.98,'(a)','Units', 'Normalized', 'VerticalAlignment', 'Top'); hold on;
plot(n/fs, y, 'k'); hold on;
p0 = plot(n/fs, x_ex3, 'r'); hold off;
title(txt_1,'interpreter','latex')
legend([p0], {'K-complex'},'location','north');
legend boxoff;
set(gca, 'box', 'off')
axis tight;
subplot(4,1,2);
text(-0.1,0.98,'(b)','Units', 'Normalized', 'VerticalAlignment', 'Top'); hold on;
p0 = plot(n/fs, kc, 'k'); hold on;
p1 = plot(n/fs, k, '--k'); hold off;
title(txt_2,'interpreter','latex')
if strcmp(method, 'SAPR')
legend([p1,p0], {'$\mathbf{\Psi} \mathbf{k}$', ...
'$\mathbf{B}^T \mathbf{B} \mathbf{\Psi} \mathbf{k}$'},'interpreter','latex', ...
'location','north');
legend boxoff;
end
set(gca, 'box', 'off')
axis tight;
subplot(4,1,3);
text(-0.1,0.98,'(c)','Units', 'Normalized', 'VerticalAlignment', 'Top'); hold on;
p0 = plot(n/fs, tk); hold on;
p1 = plot(n/fs, th*ones(1,N), 'r--'); hold off;
title(txt_3,'interpreter','latex')
legend([p0,p1], {'TKEO','Threshold'},'location','north');
legend boxoff;
set(gca, 'box', 'off')
axis tight;
subplot(4,1,4);
text(-0.1,0.98,'(d)','Units', 'Normalized', 'VerticalAlignment', 'Top'); hold on;
plot(n/fs, binX, 'Color', [0,0,0]+0.7,'linewidth',1.0); hold on;
plot(n/fs, binA, 'k');
title(txt_4,'interpreter','latex')
xlabel('Time (seconds)','interpreter','latex')
legend('Expert',method,'location','north');
legend boxoff
set(gca, 'box', 'off')
ylim([-0.2, 1.2])
printme_pdf = @(ex,meth) print('-dpdf', sprintf('../../results/%s_%s',ex,meth));
printme_pdf('ex6',lower(method));
% printme_eps = @(ex,meth) print('-depsc', sprintf('figures/%s_%s',ex,meth));
% printme_eps('ex6',lower(method));
end
Program :

data :

边栏推荐
猜你喜欢
The idea and method of MySQL master-slave only synchronizing some libraries or tables

JS create an array (literal)

Important knowledge of golang: waitgroup parsing

Introduction to the push function in JS

Idea view View the class file idea Class folder

SQL injection vulnerability (principle)

从3开始,在业务系统中增加分页功能

腾讯云服务器发送邮件失败

Millions of bonuses are waiting for you to get. The first China Yuan universe innovation and application competition is in hot Recruitment!
mysql主从只同步部分库或表的思路与方法
随机推荐
MySQL series: overview of the overall architecture
这届文娱人,将副业做成了主业
Sorting out and summarizing the handling schemes for the three major exceptions of redis cache
基因检测,如何帮助患者对抗疾病?
基因检测,如何帮助患者对抗疾病?
MySQL advanced statement 2
直播间源码在开发前期必须做的工作及开发步骤
golang 重要知识:sync.Cond 机制
JS的unshift()和shift()
B. AND 0, Sum Big-Codeforces Round #716 (Div. 2)
力扣解法汇总513-找树左下角的值
Wechat applet guides users to add applet animation page
MySQL create and manage tables
Google &huggingface| zero sample language model structure with the strongest ability
golang 重要知识:waitgroup 解析
A transformer can only convert alternating current. How can I convert direct current?
Important knowledge of golang: atomic atomic operation
12 BeautifulSoup类的初始化
2021-06-07
golang 重要知识:context 详解