Home > ACA-Code > ToolInstFreq.m

ToolInstFreq

PURPOSE ^

get phase

SYNOPSIS ^

function [f_I] = ToolInstFreq(X,iHop,fs)

DESCRIPTION ^

 get phase

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function [f_I] = ToolInstFreq(X,iHop,fs)
0002     % get phase
0003     phi         = angle(X);
0004 
0005     % phase offset
0006     omega       = pi*iHop/size(X,2)*(0:size(X,2)-1);
0007     
0008     % unwrapped difference
0009     deltaphi    = omega + princarg_I(phi(2,:)-phi(1,:)-omega);
0010     
0011     % instantaneous frequency
0012     f_I         = deltaphi/iHop/(2*pi)*fs;
0013 end
0014 
0015 function phase = princarg_I(phi)
0016     phase = mod(phi + pi,-2*pi) + pi;
0017 end

Generated on Fri 22-Apr-2022 20:59:51 by m2html © 2005