demod_acn.m
来自「提取信号七个基于瞬时信息的特征:零中心归一化瞬时幅度功率谱密度的最大值,零中心归」· M 代码 · 共 58 行
M
58 行
function [Acn, N_nw] = demod_Acn (yi, yq)
%%%%%%%%%%%%%%%%%%%%%%%
% Gererate the Normalized-Centred Instantaneous Amplitude of Intercepted Segments.
%
global k Fc Fd Fs n;
N = length(yi);
%An = sqrt( yi(1:N)^2 + yq(1:N)^2 );
Ai = sqrt( yi.*yi + yq.*yq );
%%%%%%%%%%%%%%%%%%%%%
% Nomalize and centralize the Ai.
mean_Ai = ( sum(Ai) ) / N;
%mean_Ai = 0.6; for 2ASK Signals.
An = Ai / mean_Ai;
Acn = An -1;
for i = 1:N-1
if abs(Acn(i)) < 0.1 %% !!!
Acn(i) = Acn(i+1);
end
end
N_nw = 0; % Number of Non-Weak samples.
%%%%%%%%%%%%%%%
%the Non-weak segment extraction function is impletmented in demod_nonweak.m
%for i = 1: N
% if (An(i) >= 1 ) %%%% Non-weak segment Threshold.
% N_nw = N_nw +1;
% end
%end
%%%%%%%%%%%%%%%%%%%%%
%% Plot the Acn
%下面是屏蔽原来的画图程序
%%for i=1:1 % set to 1:0 to cancel the plot function.
%%figure (211);
%%subplot (3,1,1);
%%plot ( (1:N) , Ai );
%%hold on;
%%plot ( (1:N) , ones(1,N)*mean_Ai);
%%plot ( (1:N) , ones(1,N)*0.6, ':r');
%%hold off;
%%subplot (3,1,2);
%%plot ( (1:N) , An );
%%subplot (3,1,3);
%%plot ( (1:N) , abs(Acn) );
%%end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?