📄 recognition_turn_24pskgopi_4ask.m
字号:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% the main function is to generate the modulated signals and extract its
% features and then recognize the modulated type of the received signals by
% making use of the fuzzy ART1 netrual network
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function sig_recognition
clear;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% define the necessary parameters of Fuzzy ART1 network %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
global rou belta num_in_node num_out_node mode_vec p;
rou=input('please input the vigilance parameter of the matched judgement confine rou=');
belta=input('please input the learning speed parameter belta=');
num_in_node=5; % the nodes of the input layer and F1 layer in Fuzzy ART1 network
num_out_node=500; % the nodes of the output layer namely F2 layer in Fuzzy ART1 network
reco_stastics=zeros(1,500); % record the training results of all output nodes
reco_stastics1=zeros(7,500); % record the recognition results
mode_vec=zeros(num_out_node,num_in_node); % equal to initializing the mode vector
p=0; % the number of used output node
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%define necessary parameter for generating the modulated signals collection
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SNR=8;
sam_num=400; %the number of modulated samples
% mod_fea=zeros(5,sam_num,5); %store wavelet features of modulated samples for learning and recognition
mode=zeros(1,11);
percent=zeros(1,14); %存放统计的总和聚类率,识别率和自动识别未训练模式性能指标
mod_fea1=zeros(5,sam_num,2); %store wavelet features of modulated samples for not having been learned
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% generating the modulated signals extract the main reatures of the inerfered signals
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
input('用五种恒包络调制制式2psk 4psk gmsk opsk pi/4dpsk 训练ART2A-E网络');
load('d:\\lcy\\AMR\\design-programme-regulator\\ART2A-E NN\\data\\8db_learned_24pskgopi_400_6.mat','mod_fea');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% the training of ART2A_E network
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%m=m_sequence;
for j=1:5; % three modulated samples collection are input to the network in turn
for i=1:sam_num/2; % each modulated type samples are continuously input
[out,flag]=ART2A_E_linear(mod_fea(:,i,j)');
%[out,flag]=ART2A_E_max(mod_fea(:,m(i),j)');
if flag==1 %if the output nodes are not used up, add up the result
reco_stastics=reco_stastics+out;
end
end
mode(j)=p; %the used output nodes after each modulated type samples collection are classed.
end
ratio=reco_stastics./(sam_num/2);
s1=sprintf('五种恒包络调制类型占用输出结点为:\n 2PSK: 1-%d, 4PSK: %d-%d, GMSK: %d-%d, OQPSK: %d-%d, pi/4DQSK: %d-%d\n',mode(1),mode(1)+1,mode(2),mode(2)+1,mode(3),mode(3)+1,mode(4),mode(4)+1,mode(5));
input(s1);
%% 统计识别five种调制类型的聚类性能,每个模式占用节点在训练时是连续的
for i=1:5
if i==1
for j=1:mode(i)
percent(i)=percent(i)+ratio(j);
end
end
if i>=2
for j=mode(i-1)+1:mode(i)
percent(i)=percent(i)+ratio(j);
end
end
end
s3=sprintf('五种恒包络调制类型的训练聚类率为: 2PSK-%f, 4PSK-%f, GMSK-%f, OQPSK-%f, pi/4DQSK-%f\n',percent(1),percent(2),percent(3),percent(4),percent(5));
input(s3);
%% statistic the recognition ratio
input('统计五种已训练调制制式的识别率')
for j=1:5;
for i=sam_num/2+1:sam_num;
[out,flag]=ART2A_E_linear(mod_fea(:,i,j)');
if flag==1
reco_stastics1(j,:)=reco_stastics1(j,:)+out;
end
end
end
reco_stastics1=reco_stastics1./(sam_num/2);
%% 统计five种调制类型的识别率
for i=1:5
if i==1
for j=1:mode(i)
percent(5+i)=percent(5+i)+reco_stastics1(i,j);
end
end
if i>=2
for j=mode(i-1)+1:mode(i)
percent(5+i)=percent(5+i)+reco_stastics1(i,j);
end
end
end
s4=sprintf('五种恒包络调制类型的调制识别率为: 2PSK-%f, 4PSK-%f, GMSK-%f, OQPSK-%f, pi/4DQSK-%f\n',percent(6),percent(7),percent(8),percent(9),percent(10));
input(s4);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% test the characteristics of recognizing the not learing class
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
mode(6)=p;
input('向已训练网络输入未训练调制制式4ask')
load('d:\\lcy\\AMR\\design-programme-regulator\\ART2A-E NN\\data\\8db_unlearn_4ask_400_2.mat','mod_fea1');
for i=1:sam_num/2; %sent the features to ART2A_E network to recognize ,while not affect the old classes.
[out,flag]=ART2A_E_linear(mod_fea1(:,i)');
%[out,flag]=ART2A_E_max(mod_fea(:,i,j)');
if flag==1
reco_stastics1(6,:)=reco_stastics1(6,:)+out;
end
end
mode(7)=p; %record the number of nodes that each modulated samples use
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% statistic the recognition ratio of other two signals
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
input('统计未训练调制制式的识别率')
for i=sam_num/2+1:sam_num;
[out,flag]=ART2A_E_linear(mod_fea1(:,i)');
if flag==1
reco_stastics1(7,:)=reco_stastics1(7,:)+out;
end
end
mode(8)=p;
%%统计百分比
for i=1:2
reco_stastics1(5+i,:)=reco_stastics1(5+i,:)./(sam_num/2);
end
s2=sprintf('未学习调制制式4ASK输入ART2A-E网络后占用输出结点为:\n 4ASK: %d-%d\n',mode(6)+1,mode(7));
input(s2);
%%统计检测未学习模式的能力
for j=mode(6):mode(7)
percent(11)=percent(11)+reco_stastics1(6,j);
end
s5=sprintf('未学习调制类型4ASK的训练聚类率为: %f\n',percent(11));
input(s5);
%%统计新输入的调制类型的识别率
for j=mode(6):mode(7)
percent(12)=percent(12)+reco_stastics1(7,j);
end
s6=sprintf('未学习调制类型4ASK的调制识别率为: %f\n',percent(12));
input(s6);
return;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -