SignalUtils.Hanning Method

function Hanning(const Src: TVec; WindowMode: TSignalWindowMode): TVec;

Hanning (raised-cosine) window.

#NameTypeDescription
1SrcTVec
2WindowModeTSignalWindowMode

Returns: TVec

Remarks:

Multiplies Src in place by the Hanning window so that, for a unit input, the i-th sample becomes

w[i] = 1/2(1 - cos(2pi i)/(N-1)), 0 <= i <= N-1

where N is the operand length (Len). With WindowMode = wmSymmetric the window is symmetric (endpoints w[0]=w[N1]=0w[0]=w[N-1]=0); with wmPeriodic the length-N+1 symmetric window is built and its last sample dropped, giving w[i]=1/2(1-cos(2pi i)/N) which keeps the FFT periodicity. Window functions are applied prior to the FFT to reduce spectral leakage at the cost of frequency resolution; Hanning is a good general default. Domain: N >= 1 (no effect for N <= 1); the routine touches only elements Index..Index+Len-1 and validates that range against Src, raising an exception on an out-of-range Index or Len. No NaN is produced for finite input.

References:

[1] Digital signal processing, Vinay K. Ingle and John G. Proakis, Brooks-Cole, 2000.

See Also: SignalUtils.CosineTappered, SignalUtils.Kaiser, SignalUtils.SignalWindow, SignalUtils.Hamming

Indexed: function Hanning(const Src: TVec; WindowMode: TSignalWindowMode; Index: Integer; Len: Integer): TVec;

Hamming window.

#NameTypeDescription
1SrcTVec
2WindowModeTSignalWindowMode
3IndexIntegerstart index
4LenIntegerelement count

Returns: TVec

Remarks:

Applies Hamming window to Src vector from element at Index to element at Index + Len - 1.