MATLAB 错误使用 instfreq TFD 应“非负”
EMD工具箱报上面的错误,help instfreq后MATLAB自己有这个函数,不过EMD似乎使用的另外的函数导致调用自带的出现问题,创建函数另存为即可
将下面的函数保存为instfreq.m
放置于EMD工具箱下
function [fnormhat,t]=instfreq(x,t,L,trace);
%INSTFREQ Instantaneous frequency estimation.
% [FNORMHAT,T]=INSTFREQ(X,T,L,TRACE) computes the instantaneous
% frequency of the analytic signal X at time instant(s) T, using the
% trapezoidal integration rule.
% The result FNORMHAT lies between 0.0 and 0.5.
%
% X : Analytic signal to be analyzed.
% T : Time instants (default : 2:length(X)-1).
% L : If L=1, computes the (normalized) instantaneous frequency
% of the signal X defined as angle(X(T+1)*conj(X(T-1)) ;
% if L>1, computes a Maximum Likelihood estimation of the
% instantaneous frequency of the deterministic part of the signal
% blurried in a white gaussian noise.
% L must be an integer (default : 1).
% TRACE : if nonzero, the progression of the algorithm is shown
% (default : 0).
% FNORMHAT : Output (normalized) instantaneous frequency.
% T : Time instants.
%
% Examples