📄 demod_acn.m
字号:
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -