⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 feature_gen_learned_8db.m

📁 提取信号七个基于瞬时信息的特征:零中心归一化瞬时幅度功率谱密度的最大值,零中心归一化瞬时幅度绝对值的标准偏差
💻 M
字号:
%%%%%%%%%%%%%%%%%
% Figure Definitions
%
%   Figure      Description
%
%   921         ASK2 Signals
%   922         FSK2 Signals
%   923         PSK2 Signals
%
%   931         iphase, ifreq   (Instantaneous Phase & Frequency), demod_ifreq.m
%
%   202         I Components, demod_iqII.m;
%   203         Q Components
%
%   211         Acn  (Normalized-Centred Instantaneous Amplitude),demod_Acn.m
%   
%   311         D_aa of ASK2 and ASK4

function  feature_gen_learned
%%%%%%%%%%%%%%%%%%
%% Step 1st
%% Setting simulation Environment
%%%%%%%%%%%%%%%%%%
global k Fc Fd Fs n Fs_n;

sam_n=400;
mod_fea=zeros(7,sam_n,9);

k=1000;         % k=1000
Fc=525*k;       % Carrier Frequency     Fc=375k, 525k, 675k    
Fd=12.5*k;      % Symbol Rate 
Fs=300*k;       % Sample Rate 
Fs_n=1500*k;    % Signal Source Sample Rate, Used in the 1-3 phases.

SNR = 8;

%%%%%%%%%%%%%%%%
%% Step 2nd
%% Modulated Signal Scource
%%%%%%%%%%%%%%%%

% random_method = 1;
for i=1:9
    
 random_method = i ;     % Generate the random Modulation  2ASK,4ASK,2FSK,4FSK,16QAM
 
for q = 1 : sam_n
%Source
%n = [0 : 1/Fs_n : (2048-1)/Fs_n]';
n = [0 : 1/Fs_n : ( 1024* Fs_n/Fs -1)/Fs_n]' ; % discrete time components.
%n = [0 : 1/Fs_n : ( 1024* Fs_n/Fs -1)/Fs_n] ; % discrete time components.

%%%%%%%%%%%%%%%
%% Randomly choose modulation method.
[ y , M ] = mod_rand_9 (random_method);    % generate the Modulated Signals.
%[ y , M ] = mod_rand_030605 (random_method);    % generate the Modulated Signals.

%y = mod_mask_020530b (x,n,M);
%y = mod_mfsk_020530b (x,n,M);
%y = mod_mpsk_020530b (x,n,M);
%y = mod_qam_020612b (x,n,M);

%y = zeros(length(y),1);    %% Zeros + Noise.

clear x;

%%%%%%%%%%%%%%%%
%% Step 3rd
%% Signal Transfering Simulation
%%%%%%%%%%%%%%%%
yo = y;
y = transfer_y (y,SNR);     % Signal Transfering Simulation.
%analysis_spec (yo, y, n, Fs_n);

%% Sample the input signal in frequency Fs.
y = y (1 : Fs_n/Fs : 1024* Fs_n/Fs);
n = n (1 : Fs_n/Fs : 1024* Fs_n/Fs);

%%%%%%%%%%%%%%%%%%%%
%% Step 4th
%% the Instantaneous Amplitude,Frequency and Phase Extraction
%%%%%%%%%%%%%%%%%%%%

%I,Q Component Extraction
[yi, yq] = demod_iqII (y);  % Extract the I,Q Component

[Acn, N_nw] = demod_Acn (yi, yq);   % Compute the Instantaneous Amplitude

iphase = demod_iphase (yi,yq);  % Compute the 
                                % Instantaneous Phase

ifreq = demod_ifreq (iphase);   % Compute the 
                                % Instantaneous Frequency

% the Instantaneous Phase and Frequency of the Non-weak Segment Extraction
[iphase_nw, ifreq_nw] = demod_nonweak (Acn, iphase, ifreq); 

%%%%%%%%%%%%%%%%%%%
%% Step 5th
%% Extract the Key features and Automatic Decision
%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%
%% Phase 1
%% Extract the Rmax, D_dp
%% to classify ASK FSK PSK QAM

    Rmax = demod_Rmax (Acn);  
    D_dp = demod_dp (iphase_nw);   
    

%%%%%%%%%%%%%%%%
%% Phase 2
%% Extract the D_aa, D_ap, D_af
%% to classify 2ASK/4ASK, 2PSK/4PSK, 2FSK/4FSK.

     D_aa = demod_aa (Acn);
     D_ap = demod_ap (iphase_nw);    
     D_af = demod_af (ifreq_nw);
     Rmaxf = demod_Rmaxf (ifreq_nw);    
     D_xi = demod_xi (yi);
     
     mod_fea(1,q,i)=Rmax;
     mod_fea(2,q,i)=D_dp;
     mod_fea(3,q,i)=D_aa;
     mod_fea(4,q,i)=D_ap;
     mod_fea(5,q,i)=D_af;
     mod_fea(6,q,i)=Rmaxf;
     mod_fea(7,q,i)=D_xi;
     switch i
case 1
 figure(1)
 plot(Rmaxf,D_af,'b+')
 xlabel('Rmaxf');ylabel('D_af');
 hold on
figure(2)
 plot(D_aa,D_dp,'b+')
  xlabel('D_aa');ylabel('D_dp');
 hold on
 figure(3)
 plot(D_ap,D_xi,'b+')
 xlabel('D_ap');ylabel('D_xi');
 hold on
 figure(4)
 plot(Rmax,D_af,'b+')
  xlabel('Rmax');ylabel('D_af');
 hold on
  figure(5)
 plot(D_dp,D_ap,'b+')
  xlabel('D_dp');ylabel('D_ap');
 hold on
 
case 2
 figure(1)
 plot(Rmaxf,D_af,'y*')
 xlabel('Rmaxf');ylabel('D_af');
 hold on
figure(2)
 plot(D_aa,D_dp,'y*')
  xlabel('D_aa');ylabel('D_dp');
 hold on
 figure(3)
 plot(D_ap,D_xi,'y*')
 xlabel('D_ap');ylabel('D_xi');
 hold on
 figure(4)
 plot(Rmax,D_af,'y*')
  xlabel('Rmax');ylabel('D_af');
 hold on
  figure(5)
 plot(D_dp,D_ap,'y*')
  xlabel('D_dp');ylabel('D_ap');
 hold on
 
 case 3
figure(1)
 plot(Rmaxf,D_af,'rd')
 xlabel('Rmaxf');ylabel('D_af');
 hold on
figure(2)
 plot(D_aa,D_dp,'rd')
  xlabel('D_aa');ylabel('D_dp');
 hold on
 figure(3)
 plot(D_ap,D_xi,'rd')
 xlabel('D_ap');ylabel('D_xi');
 hold on
 figure(4)
 plot(Rmax,D_af,'rd')
  xlabel('Rmax');ylabel('D_af');
 hold on
  figure(5)
 plot(D_dp,D_ap,'rd')
  xlabel('D_dp');ylabel('D_ap');
 hold on
 
 case 4
figure(1)
 plot(Rmaxf,D_af,'ko')
 xlabel('Rmaxf');ylabel('D_af');
 hold on
figure(2)
 plot(D_aa,D_dp,'ko')
  xlabel('D_aa');ylabel('D_dp');
 hold on
 figure(3)
 plot(D_ap,D_xi,'ko')
 xlabel('D_ap');ylabel('D_xi');
 hold on
 figure(4)
 plot(Rmax,D_af,'ko')
  xlabel('Rmax');ylabel('D_af');
 hold on
  figure(5)
 plot(D_dp,D_ap,'ko')
  xlabel('D_dp');ylabel('D_ap');
 hold on
 
 case 5
figure(1)
 plot(Rmaxf,D_af,'gx')
 xlabel('Rmaxf');ylabel('D_af');
 hold on
figure(2)
 plot(D_aa,D_dp,'gx')
  xlabel('D_aa');ylabel('D_dp');
 hold on
 figure(3)
 plot(D_ap,D_xi,'gx')
 xlabel('D_ap');ylabel('D_xi');
 hold on
 figure(4)
 plot(Rmax,D_af,'gx')
  xlabel('Rmax');ylabel('D_af');
 hold on
  figure(5)
 plot(D_dp,D_ap,'gx')
  xlabel('D_dp');ylabel('D_ap');
 hold on
 
 case 6
figure(1)
 plot(Rmaxf,D_af,'ch')
 xlabel('Rmaxf');ylabel('D_af');
 hold on
figure(2)
 plot(D_aa,D_dp,'ch')
  xlabel('D_aa');ylabel('D_dp');
 hold on
 figure(3)
 plot(D_ap,D_xi,'ch')
 xlabel('D_ap');ylabel('D_xi');
 hold on
 figure(4)
 plot(Rmax,D_af,'ch')
  xlabel('Rmax');ylabel('D_af');
 hold on
  figure(5)
 plot(D_dp,D_ap,'ch')
  xlabel('D_dp');ylabel('D_ap');
 hold on
 
 case 7
figure(1)
 plot(Rmaxf,D_af,'mp')
 xlabel('Rmaxf');ylabel('D_af');
 hold on
figure(2)
 plot(D_aa,D_dp,'mp')
  xlabel('D_aa');ylabel('D_dp');
 hold on
 figure(3)
 plot(D_ap,D_xi,'mp')
 xlabel('D_ap');ylabel('D_xi');
 hold on
 figure(4)
 plot(Rmax,D_af,'mp')
  xlabel('Rmax');ylabel('D_af');
 hold on
  figure(5)
 plot(D_dp,D_ap,'mp')
  xlabel('D_dp');ylabel('D_ap');
 hold on
 
 case 8
figure(1)
 plot(Rmaxf,D_af,'c>')
 xlabel('Rmaxf');ylabel('D_af');
 hold on
figure(2)
 plot(D_aa,D_dp,'c>')
  xlabel('D_aa');ylabel('D_dp');
 hold on
 figure(3)
 plot(D_ap,D_xi,'c>')
 xlabel('D_ap');ylabel('D_xi');
 hold on
 figure(4)
 plot(Rmax,D_af,'c>')
  xlabel('Rmax');ylabel('D_af');
 hold on
  figure(5)
 plot(D_dp,D_ap,'c>')
  xlabel('D_dp');ylabel('D_ap');
 hold on
 
 case 9
figure(1)
 plot(Rmaxf,D_af,'g<')
 xlabel('Rmaxf');ylabel('D_af');
 hold on
figure(2)
 plot(D_aa,D_dp,'g<')
  xlabel('D_aa');ylabel('D_dp');
 hold on
 figure(3)
 plot(D_ap,D_xi,'g<')
 xlabel('D_ap');ylabel('D_xi');
 hold on
 figure(4)
 plot(Rmax,D_af,'g<')
  xlabel('Rmax');ylabel('D_af');
 hold on
  figure(5)
 plot(D_dp,D_ap,'g<')
  xlabel('D_dp');ylabel('D_ap');
 hold on
end 

%figx=(1:1:sam_n)
%if  random_method==1
%figure(6)
%plot(figx,Rmax,'k:');
%hold on;

%figure(7)
%plot(figx,D_dp,'k:')
%hold on;

%figure(8)
%plot(figx,D_ap,'k:');
%hold on;

%figure(9)
%plot(figx,D_aa,'k:');
%hold on;

%figure(10)
%plot(figx,D_af,'k:');
%hold on;

%figure(11)
%plot(figx,Rmaxf,'k:');
%hold on;

%figure(12)
%plot(figx,D_xi,'k:');
%hold on;
%end

%if  random_method==2
%figure(6)
%plot(figx,Rmax,'g-');
%hold on;

%figure(7)
%plot(figx,D_dp,'g-');
%hold on;

%figure(8)
%plot(figx,D_ap,'g-');
%hold on;

%figure(9)
%plot(figx,D_aa,'g-');
%hold on;

%figure(10)
%plot(figx,D_af,'g-');
%hold on;

%figure(11)
%plot(figx,Rmaxf,'g-');
%hold on;

%figure(7)
%plot(figx,D_xi,'g-');
%hold on;

%end


%if method==3
%figure(1)
%plot(figx,fea(1,:),'k-.');
%hold on;

%figure(2)
%plot(figx,fea(2,:),'k-.');
%hold on;

%figure(3)
%plot(figx,fea(3,:),'k-.');
%hold on;

%figure(4)
%plot(figx,fea(4,:),'k-.');
%hold on;

%figure(5)
%plot(figx,fea(5,:),'k-.');
%hold on;
%end
end

end

 

% save('d:\\lcy\\AMR\\design-programme-regulator\\ART2A-E NN\\data\\8db_learned_24pskgopi_400_3.mat','mod_fea');

% save('d:\\lcy\\AMR\\design-programme-regulator\\ART2A-E NN\\data\\8db_learned_24a24f16qam_400_3.mat','mod_fea');

save('d:\ART2A-E NN\\data\\8db_learned_9s_400_1.mat','mod_fea');

return;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -