iphaselock.m

来自「linear time-frequency toolbox」· M 代码 · 共 52 行

M
52
字号
function cout = iphaselock(cin,a)%IPHASELOCK  Inverse phase lock of Gabor coefficients%   Usage:  c=iphaselock(c,a);%%   IPHASELOCK(c,a) removes phase locking from the Gabor coefficients c.%   The coefficient must have been obtained from a DGT with parameter a.%%   Phaselocking the coefficients modyfies them so as if they were obtained%   from a time-invarient Gabor system. A filter bank produces phase locked%   coeffiecients. %%   SEE ALSO: DGT, PHASELOCK%%   REFERENCES:%     M. Puckette. Phase-locked vocoder. Applications of Signal Processing to%     Audio and Acoustics, 1995., IEEE ASSP Workshop on, pages 222 -225, 1995.%   AUTHORS : Peter Balazs%             Peter Soendergaard.error(nargchk(2,2,nargin));if  (prod(size(a))~=1 || ~isnumeric(a))  error('a must be a scalar');end;if rem(a,1)~=0  error('a must be an integer');end;M=size(cin,1);N=size(cin,2);L=N*a;b=L/M;if rem(b,1)~=0  error('Lattice error. The a parameter is probably incorrect.');end;TimeInd = (0:(N-1))/N;FreqInd = (0:(M-1))*b;phase = FreqInd'*TimeInd;phase = exp(-2*i*pi*phase);% Handle multisignalscout=zeros(size(cin));for w=1:size(cin,3)  cout(:,:,w) = cin(:,:,w).*phase;end;

⌨️ 快捷键说明

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