📄 difmag.f,v
字号:
head 1.3;access;symbols;locks; strict;comment @* @;1.3date 96.03.15.23.09.39; author jaf; state Exp;branches;next 1.2;1.2date 96.03.13.14.41.31; author jaf; state Exp;branches;next 1.1;1.1date 96.02.07.14.45.04; author jaf; state Exp;branches;next ;desc@@1.3log@Just added a few comments about which array indices of the argumentsare used, and mentioning that this subroutine has no local state.@text@************************************************************************* DIFMAG Version 49** $Log: difmag.f,v $* Revision 1.2 1996/03/13 14:41:31 jaf* Comments added explaining that none of the local variables of this* subroutine need to be saved from one invocation to the next.** Revision 1.1 1996/02/07 14:45:04 jaf* Initial revision************************************************************************** Compute Average Magnitude Difference Function** Inputs:* SPEECH - Low pass filtered speech* Indices MIN_N1 through MAX_N1+LPITA-1 are read, where* MIN_N1 = (MAXLAG - MAX_TAU)/2+1 MAX_TAU = max of TAU(I) for I=1,LTAU* MAX_N1 = (MAXLAG - MIN_TAU)/2+1 MIN_TAU = min of TAU(I) for I=1,LTAU* LPITA - Length of speech buffer* TAU - Table of lags* Indices 1 through LTAU read.* LTAU - Number of lag values to compute* MAXLAG - Maximum possible lag value* Outputs:* (All of these outputs are also read, but only after being written.)* AMDF - Average Magnitude Difference for each lag in TAU* Indices 1 through LTAU written* MINPTR - Index of minimum AMDF value* MAXPTR - Index of maximum AMDF value** This subroutine has no local state.* SUBROUTINE DIFMAG( SPEECH, LPITA, TAU, LTAU, MAXLAG, 1 AMDF, MINPTR, MAXPTR )* Arguments INTEGER LPITA, LTAU, MAXLAG, MINPTR, MAXPTR INTEGER TAU(LTAU) REAL SPEECH(LPITA+MAXLAG), AMDF(LTAU)* Local variables that need not be saved INTEGER I, J, N1, N2 REAL SUM* Local state* None MINPTR = 1 MAXPTR = 1 DO I = 1,LTAU N1 = (MAXLAG-TAU(I))/2 + 1 N2 = N1 + LPITA - 1 SUM = 0. DO J = N1,N2,4 SUM = SUM + ABS( SPEECH(J) - SPEECH(J+TAU(I)) ) END DO AMDF(I) = SUM IF( AMDF(I).LT.AMDF(MINPTR) ) MINPTR = I IF( AMDF(I).GT.AMDF(MAXPTR) ) MAXPTR = I END DO RETURN END@1.2log@Comments added explaining that none of the local variables of thissubroutine need to be saved from one invocation to the next.@text@d6 4d20 3d25 1d29 1d31 1d34 3d40 3d47 1a47 4* Local variables* * None of these need to have their values saved from one* invocation to the next.d51 4@1.1log@Initial revision@text@d5 4a8 1* $Log$d28 10a37 2 INTEGER TAU(LTAU), I, J, N1, N2 REAL SPEECH(LPITA+MAXLAG), AMDF(LTAU), SUM@
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -