SignalUtils.Bartlett Method

TVec Bartlett(TVec Src)

Bartlett window.

#NameTypeDescription
1SrcTVecsource TVec

Returns: TVec

Remarks:

Applies Bartlett window to Src vector. 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. Bartlett window is a "triangular" window defined as [1] p. 248: w[n] = 2n/(M-1), 0 <= n <= (M-1)/2 w[n] = 2 - 2n/(M-1), (M-1)/2 <= n <= M-1 w[n] = 0 for other n References:

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

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 = new Vector(100);
    Vector Response = new Vector(0);
    Vector FreqFr = new Vector(0);

    SignalUtils.FirImpulse(h, new double[1] {40},0, TFilterType.ftLowpass, TSignalWindowType.wtRectangular,1,200);
    SignalUtils.Bartlett(h);  //window the sinc impulse response
    SignalUtils.FrequencyResponse(h,null,Response,8,false,
        TSignalWindowType.wtRectangular, 0);
    FreqFr.Size(Response.Length);
    FreqFr.Ramp(0,200*0.5/Response.Length);
    MtxVecTee.DrawIt(FreqFr, Response,"Frequency response",false);
}
See Also: SignalUtils.Hanning, SignalUtils.Kaiser, SignalUtils.SignalWindow

Indexed: TVec Bartlett(TVec Src, Int32 Index, Int32 Len)

Bartlett window.

#NameTypeDescription
1SrcTVecsource TVec
2IndexInt32start index
3LenInt32element count

Returns: TVec

Remarks:

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