I'm working on Hilbert Huang Tranform and have a question on computation of instantaneous frequency. I'm using HHT toolbox by Patrick Flandrin for EMD and computing IF manually. Problem is that I am getting negative values in IF.

Signal used: a $10\textrm{ Hz}$ sinusoid

 z= 5.*sin(2*10*pi*t);

Input signal and its FFT

Since this is a monocomponent frequency, IMF is the signal itself. I compute analytic signal using MATLAB function hilbert and then apply the following code to compute IF:

function [f] = inst_freq_manual(analytic_signal,Fs)

factor =  Fs/(2*pi);
N= length(analytic_signal);

% Differentiation formula
fin = factor*(angle(analytic_signal(2:N).*conj(analytic_signal(1:N-1))));

% Insert leading 0 in return-vector to maintain size
f = [0 fin];

I find that the IF values are negative. Mean of IF values =-9.9975 (correct numerical value but negative sign).

Plot of instantaneous parameters:

Instantaneous parameters

As per literature, the IMFs from HHT should have positive instantaneous frequencies.

  • Can anyone please tell me where I am going wrong?
  • Is using absolute value an option?
  • $\begingroup$ Welcome to SE.DSP! Interesting question! Have you compared the way you're calculating the instantaneous frequency with the way Matlab suggests ? I'm wondering if there will be a difference. $\endgroup$
    – Peter K.
    Jul 12, 2017 at 18:03
  • 1
    $\begingroup$ is the analytic signal computed correctly (can you show that code)? maybe you have $$ x[n] - j \hat{x}[n] $$ instead of $$ x[n] + j \hat{x}[n] $$. $\endgroup$ Jul 12, 2017 at 18:48
  • $\begingroup$ @robertbristow-johnson : They're using Matlab's hilbert function, but it's not clear to me what that will produce. $\endgroup$
    – Peter K.
    Jul 12, 2017 at 21:10
  • $\begingroup$ well @PeterK., it would be useful to see both waveforms, side-by-side. because the difference equation (fin=) that the OP is using looks correct. $\endgroup$ Jul 12, 2017 at 21:24
  • $\begingroup$ Matlab recommends to calculate instant. freq. using phase accumulation and in the question here a different method was used which I believe is called homodyne discrimination. I can confirm that I'm having the same problem in Python: homodyne discrimination produces negative values of instant. freq., however phase accumulation (also recommended by SciPy docs) produces positive values. That of course when dealing with IMF-grade analytic signals as required by EMD. I hope someone eventually answers this question thoroughly... $\endgroup$
    – mac13k
    Jan 16, 2018 at 15:51


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.