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

📄 demod_iphase.m

📁 提取信号七个基于瞬时信息的特征:零中心归一化瞬时幅度功率谱密度的最大值,零中心归一化瞬时幅度绝对值的标准偏差
💻 M
字号:
function iphase = demod_iphase (yi,yq)

%Gererate the Instantaneous Phase
%
global k Fc Fd Fs n;

N = length(yi);

iphase = zeros(1,N);    % Initialize the iphase.

% if the Inst. Phase is lower than this Threshold, then it's set to 0.
t_phase = 0.001; 

%% yq = sin(iphase)
%% yi = cos(iphase) 

% Inst. Phase is from -pi to pi.
for i = 1:N
    
    if (abs(yi(i)) <= t_phase);    
        
        if yq(i) >= t_phase
            iphase(i) = pi/2;
        else 
            iphase(i) = -pi/2;
        end
        
    end
 
        
    if yi(i) < -t_phase
        
        if yq(i) > t_phase
            iphase(i) = atan ( yq(i)/yi(i) ) + pi;
        end

        if yq(i) < -t_phase
            iphase(i) = atan ( yq(i)/yi(i) ) - pi;
        end
        
        if (abs(yq(i)) <= t_phase)
            iphase(i) = pi;
        end

    end
    
    if yi(i) > t_phase
        iphase(i) = atan ( yq(i)/yi(i) );
    end
    
%    [i,iphase(i)]      % Show the result.
%    pause;
    
end

%figure (921);
%stairs (n, iphase);

⌨️ 快捷键说明

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