📄 demod_ifreq.m
字号:
function ifreq_N = demod_ifreq (iphase)
%function [ifreq_N, mean_ifreq] = demod_ifreq (iphase)
%Gererate the Instantaneous Phase
%
global k Fc Fd Fs n;
N = length(iphase);
ifreq(2:N) = iphase(2:N) - iphase(1:N-1);
ifreq(1) = ifreq(2);
% reduce the non-expected Pulse.
for i = N-1:-1:2;
if abs( ifreq(i) ) > 1 ;
ifreq(i) = ifreq(i+1);
end
end
%ifreq = ifreq*Fs +Fc;
%mean_ifreq = sum( ifreq )/N;
%ifreq_c = ifreq - mean_ifreq; %% Non-linear Instaneous Phase (NL_iphase)
ifreq_c = ifreq;
ifreq_N = ifreq_c *Fs/2/Fd; % change to Inst. Freq.
%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Plot the Instantaneous Phase & Frequency
%下面是屏蔽原来的画图程序
%%for i = 1:1 % Set 1:0 to cancel the plot function.
%%figure (931);
%%subplot (2,1,1);
%%stairs ((1:N), iphase);
%%title ('Demodulated Instantaneous Phase');
%%subplot (2,1,2);
%%stairs ((1:N), ifreq);
%%title ('Demodulated Instantaneous Frequence');
%%end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -