SignalUtils.BlackmanExact Method

TVec BlackmanExact(TVec Src, TSignalWindowMode WindowMode)

Exact blackman window.

#NameTypeDescription
1SrcTVecsource TVec
2WindowModeTSignalWindowMode

Returns: TVec

Remarks:

Applies exact Blackman window to Src. Window functions are applied to the signal prior to conversion to frequency domain with the FFT algorithm, to reduce the spectral leakage. Their side-effect is a lower frequency resolution.

w[n] := 0.42659071 - 0.49656062*cos(2*Pi*n/(n-1)) + 0.07684867*cos(4*Pi*n/(n-1))

0 <= n <= M - 1

Examples
using Dew.Math;
using Dew.Math.Units;
using Dew.Signal;
using Dew.Signal.Units;
using Dew.Math.Tee;
using Dew.Signal.Tee;

private void button1_Click(object sender, EventArgs e)
{
    Vector h = MtxExpr.Sin(MtxExpr.Ramp(256, TMtxFloatPrecision.mvDouble,0, 2 * Math387.PI * 0.1));
    Vector h1 = new Vector(0);
    Vector Response = new Vector(0);
    Vector Response1 = new Vector(0);

    h1.Copy(h);
    SignalUtils.BlackmanExact(h, TSignalWindowMode.wmSymmetric);  //window the sinc impulse response
    MtxVecTee.DrawIt(h,"",false);

    h = h * 2.344168; //scale the signal to compensate for energy loss
    SignalUtils.FrequencyResponse(h1,null, Response,8,false, TSignalWindowType.wtRectangular, 0);
    SignalUtils.FrequencyResponse(h, null, Response1, 8, false, TSignalWindowType.wtRectangular, 0);

    MtxVecTee.DrawIt(new TVec[2] { Response, Response1 }, new string[2] { "Rectangular window", "Exact blackman" }, "Frequency response", false);
}
See Also: SignalUtils.Kaiser, SignalUtils.SignalWindow

Indexed: TVec BlackmanExact(TVec Src, TSignalWindowMode WindowMode, Int32 Index, Int32 Len)

Exact Blackman window.

#NameTypeDescription
1SrcTVecsource TVec
2WindowModeTSignalWindowMode
3IndexInt32start index
4LenInt32element count

Returns: TVec

Remarks:

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