?? 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 + -