当前位置:网站首页>[weak transient signal detection] matlab simulation of SVM detection method for weak transient signal under chaotic background
[weak transient signal detection] matlab simulation of SVM detection method for weak transient signal under chaotic background
2022-06-13 06:54:00 【FPGA and MATLAB】
1. Software version
matlab2015b
2. Algorithm simulation overview
Before studying the performance of the algorithm , Firstly, we need to analyze the impact of various parameters on the overall performance of the algorithm , This paper will focus on the phase space reconstruction parameters tao and m,SVM Support vector machine parameters C and . Here, the performance impact test of four parameters is carried out respectively , Firstly, the delay parameters are analyzed , The simulation results are as follows :
It can be seen from the simulation results in the figure , As the delay time increases , The performance of the system is basically decreasing . But when the delay time is greater than 5 When , The performance has been improved to a certain extent . therefore , The relationship between this parameter and performance is not linear .
From the picture 2 The simulation results show that , With the increase of embedding dimension , The system performance is basically gradually improved . But when the embedding dimension is greater than 3 When , The performance of the system is basically stable .
From the picture 3 The simulation results show that , With the increase of penalty factor , The performance of the system after an improvement , When the penalty factor is greater than 50 When , The performance remains basically the same .
From the picture 4 The simulation results show that , With the increase of kernel function parameters , The performance of the system has been gradually improved , With the increasing kernel function parameters , The improvement of system performance gradually slows down .
From the above comparative simulation analysis of the four parameters , The influence of the four parameters on the system performance does not satisfy the linear relationship , The four parameters have a certain degree of correlation with each other , therefore , The traditional single parameter analysis method can not obtain the optimal parameter setting . In response to this question , This paper will propose a method based on PSO Optimize parameters and parameters SVM A prediction method based on GA+PSO Improved optimization algorithm and SVM Prediction method .
First , about SVM The prediction effect of the algorithm is tested , Set four parameters manually (2,3,300.9962,2.93), And in 481 Point to 520 Add a point with an amplitude of 0.0004 Random instantaneous signal , And then use SVM Algorithm to predict , The simulation results are shown in the figure below :
From the picture 5 The simulation results show that , The overall prediction error RMSE Values in 10 Of -3 Times or so , Without considering parameter optimization , By arbitrarily setting parameters , The prediction result is poor , In the above simulation results ,200 spot ,780 Wrong detection results occurred at all points , Thus mispredicting . thus it can be seen , Parameter optimization plays a decisive role in improving the prediction effect .
From the picture 6 The simulation results show that , The overall prediction error RMSE Values in 10 Of -4 Times or so , And the influence of interference in some areas is improved , Above picture ,200 The interference signal at point has been less than 481 Point and 520 The magnitude of the point , stay 481 Point to 520 There is a large range in the area of points , It shows the existence of instantaneous weak signal , Overall speaking , adopt PSO After the optimization , The prediction performance of the system has been significantly improved .
3. Part of the source code
clc;
clear;
close all;
warning off;
addpath 'func\'
addpath 'GA_toolbox\'
addpath 'func_SVM_toolbox\'
addpath 'func_SVM_toolbox\java\'
addpath 'func_SVM_toolbox\java\libsvm\'
addpath 'func_SVM_toolbox\matlab\'
addpath 'func_SVM_toolbox\matlab-implement[by faruto]\'
addpath 'func_SVM_toolbox\python\'
addpath 'func_SVM_toolbox\svm-toy\'
addpath 'func_SVM_toolbox\tools\'
addpath 'func_SVM_toolbox\windows\'
% As a contrast , Directly through SVM Algorithm , The simulation of the algorithm is not carried out directly through the optimization algorithm ;
rng(1);
% Optimize first , Set up 1, Then set the 2, Call the optimization value to test
SEL = 2;
% Import data
load Training \X_train.mat;
load test \X_test.mat;
X_train0 = X_train;
X_test0 = X_test;
figure;
plot(X_test0);
xlabel(' Sample points n');
ylabel(' amplitude ');
[y1,input1ps] = mapminmax(X_train0');
[y2,input2ps] = mapminmax(X_test0');
X_train = y1';
X_test = y2';
if SEL == 1
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% adopt GA-PSO Search for the optimal four parameters
%tao The scope of the
min1 = 1;
max1 = 10;
%m The scope of the
min2 = 1;
max2 = 10;
%C The scope of the
min3 = 1;
max3 = 1000;
%gamma The scope of the
min4 = 0;
max4 = 5;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
wmax = 0.9;
wmin = 0.1;
c1 = 2.5;
c2 = 2.5;
% Range of speed
vmin =-7;
vmax = 7;
MAXGEN = 50;
NIND = 10;
Chrom = crtbp(NIND,4*10);
% The interval of variables
Areas = [min1,min2,min3,min4;
max1,max2,max3,max4];
FieldD = [rep([10],[1,4]);Areas;rep([0;0;0;0],[1,4])];
Data1 = zeros(NIND,4);
gen = 0;
for a=1:1:NIND
% Make sure each value is different ,
Data1(a,:) = [1,1,1000,0.3];
tao = Data1(a,1);
m = Data1(a,2);
C = Data1(a,3);
gamma = Data1(a,4);
% Calculate the corresponding target value
[epls,tao,m,C,gamma] = func_fitness(X_train,X_test,tao,m,C,gamma);
E = epls;
J(a,1) = E;
va(a) =(vmax-vmin)*rand(1)+vmin;
vb(a) =(vmax-vmin)*rand(1)+vmin;
vc(a) =(vmax-vmin)*rand(1)+vmin;
vd(a) =(vmax-vmin)*rand(1)+vmin;
end
[V,I] = min(J);
JI = I;
tmpps = Data1(JI,:);
taos = round(tmpps(1));
ms = round(tmpps(2));
Cs = tmpps(3);
gammas = tmpps(4);
Objv = (J+eps);
gen = 0;
while gen < MAXGEN;
gen
w = wmax-gen*(wmax-wmin)/MAXGEN;
FitnV = ranking(Objv);
Selch = select('sus',Chrom,FitnV);
Selch = recombin('xovsp',Selch,0.9);
Selch = mut(Selch,0.1);
phen1 = bs2rv(Selch,FieldD);
% Particle swarm based velocity update
for i=1:1:NIND
if gen > 1
va(i) = w*va(i) + c1*rand(1)*(phen1(i,1)-taos2) + c2*rand(1)*(taos-taos2);
vb(i) = w*vb(i) + c1*rand(1)*(phen1(i,2)-ms2) + c2*rand(1)*(ms-ms2);
vc(i) = w*vc(i) + c1*rand(1)*(phen1(i,3)-Cs2) + c2*rand(1)*(Cs-Cs2);
vd(i) = w*vd(i) + c1*rand(1)*(phen1(i,4)-gammas2) + c2*rand(1)*(gammas-gammas2);
else
va(i) = 0;
vb(i) = 0;
vc(i) = 0;
vd(i) = 0;
end
end
for a=1:1:NIND
Data1(a,:) = phen1(a,:);
tao = round(Data1(a,1) + 0.15*va(i));% inheritance +PSO
m = round(Data1(a,2) + 0.15*vb(i));
C = Data1(a,3) + 0.15*vc(i);
gamma = Data1(a,4) + 0.15*vd(i);
if tao >= max1
tao = max1;
end
if tao <= min1
tao = min1;
end
if m >= max2
m = max2;
end
if m <= min2
m = min2;
end
if C >= max3
C = max3;
end
if C <= min3
C = min3;
end
if gamma >= max4
gamma = max4;
end
if gamma <= min4
gamma = min4;
end
% Calculate the corresponding target value
[epls,tao,m,C,gamma] = func_fitness(X_train,X_test,tao,m,C,gamma);
E = epls;
JJ(a,1) = E;
end
Objvsel=(JJ);
[Chrom,Objv]=reins(Chrom,Selch,1,1,Objv,Objvsel);
gen=gen+1;
% Save the parameter convergence process, error convergence process and function value fitting conclusion
Error(gen) = mean(JJ);
pause(0.2);
[V,I] = min(Objvsel);
JI = I;
tmpps = Data1(JI,:);
taos2 = round(tmpps(1));
ms2 = round(tmpps(2));
Cs2 = tmpps(3);
gammas2 = tmpps(4);
end
[V,I] = min(Objvsel);
JI = I;
tmpps = Data1(JI,:);
tao0 = round(tmpps(1));
m0 = round(tmpps(2));
C0 = tmpps(3);
gamma0 = tmpps(4);
save GAPSO.mat tao0 m0 C0 gamma0
end
if SEL == 2
load GAPSO.mat
% Call the four optimal parameters
tao = tao0;
m = m0;
C = C0;
gamma = gamma0;
% Advanced phase space reconstruction
[Xn ,dn ] = func_CC(X_train,tao,m);
[Xn1,dn1] = func_CC(X_test,tao,m);
t = 1/1:1/1:length(dn1)/1;
f = 0.05;
sn = 0.0002*sin(2*pi*f*t);
% superposition
dn1 = dn1 + sn';
%SVM Training % Make a one-step prediction
cmd = ['-s 3',' -t 2',[' -c ', num2str(C)],[' -g ',num2str(gamma)],' -p 0.000001'];
model = svmtrain(dn,Xn,cmd);
%SVM forecast
[Predict1,error1] = svmpredict(dn1,Xn1,model);
RMSE = sqrt(sum((dn1-Predict1).^2)/length(Predict1));
Err = dn1-Predict1;
% Error acquisition
clc;
RMSE
figure;
plot(Err,'b');
title(' Prediction error of chaotic background signal ');
xlabel(' Sample points n');
ylabel(' Error amplitude ');
Fs = 1;
y = fftshift(abs(fft(Err)));
N = length(y)
fc = [-N/2+1:N/2]/N*Fs;
figure;
plot(fc(N/2+2:N),y(N/2+2:N));
xlabel(' Normalized frequency ');
ylabel(' spectrum ');
text(0.06,0.07,'f=0.05Hz');
end
4. reference
[1] Zhengshengli . Research on weak signal detection method under chaotic background based on phase space reconstruction [D]. Nanjing University of Information Engineering , 2015.A07-06
边栏推荐
- Is it safe for Hangzhou Securities to open an account?
- Data storage in memory (C language)
- How to quickly support the team leader to attract new fission users in the business marketing mode of group rebate?
- Host computer development (Architecture Design of firmware download software)
- MongoDB系列之SQL和NoSQL的区别
- DataGridView data export to excel (in case of small amount of data)
- Wechat game execution wx Navigatetominiprogram jumps to other games and returns to the black screen
- ML:机器学习模型的稳定性分析简介、常见的解决方法之详细攻略
- 景联文科技提供语音数据采集标注服务
- Smart finance is upgraded again, and jinglianwen technology provides data collection and labeling services
猜你喜欢
First day of learning MySQL Basics
【微弱瞬态信号检测】混沌背景下微弱瞬态信号的SVM检测方法的matlab仿真
【sketchup 2021】草图大师的图像输出与渲染之样式说明【边线设置、平面设置、背景设置、水印设置、建模设置、天空背景创建天空、利用水印背景创建天空(重要)】
数据在内存中的存储(C语言)
不间断管理设计
How to seize the bonus of social e-commerce through brand play to achieve growth and profit?
Machine learning notes - supervised learning memo list
玄武云科技通过上市聆讯:业绩波动明显,陈永辉等三人为控股股东
New Taishan crowdfunding business diversion fission growth model in 2022
Smart finance is upgraded again, and jinglianwen technology provides data collection and labeling services
随机推荐
Byte (nine)
Project analysis of Taishan crowdfunding mode: why is Taishan crowdfunding mode so popular?
Tikv key performance parameters and optimization
15、 IO stream (I)
FSM state machine
IIS batch bind domain name
Can flush open a stock account? Is it safe?
Notes on wechat applet development
If the key in redis data is in Chinese
ML:机器学习模型的稳定性分析简介、常见的解决方法之详细攻略
[Collection des questions d'examen les plus complètes de Tencent Ali] (quatre côtés: 3 tours de technologie + 1 tour de RH)
Outil de formatage du temps - mode. JS (affichage en temps réel du temps Web)
Cocos released the oppo game prompt "subcontracting failed"
Recently, the popular social e-commerce marketing model, blind box e-commerce, how beautiful every second is accurately drained
The causes of font and style enlargement when the applet is horizontal have been solved
2022-06-12:在N*N的正方形棋盤中,有N*N個棋子,那麼每個格子正好可以擁有一個棋子。 但是現在有些棋子聚集到一個格子上了,比如: 2 0 3 0 1 0 3 0 0 如上的二維數組代錶,一
Is it safe to open an account online in Hangzhou?
学习Mysql基础第一天
vue3路由缓存组件状态以及设置转场动画
【微弱瞬态信号检测】混沌背景下微弱瞬态信号的SVM检测方法的matlab仿真