SignalUtils::Bartlett Function

Overload List

#SignatureDescription
1TVec *Bartlett(TVec *Src);Bartlett window.
2TVec *Bartlett(TVec *Src, int Index, int Len);Bartlett window.

Overload 1: TVec *Bartlett(TVec *Src);

Bartlett window.

#NameTypeDescription
1SrcTVec *
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
#include "MtxExpr.h"
#include "Units.SignalUtils.h"

using namespace Dew;
using namespace Dew::Math;
using namespace Dew::Signal;
using namespace Dew::Signal::Units::SignalUtils;

void Example()
{
    Vector h(100);
    Vector Response(0);
    Vector FreqFr(0);

    FirImpulse(h, DewArray<double>{40}, 0, TFilterType::ftLowpass, TSignalWindowType::wtRectangular, 1, 200);
    Bartlett(h);  //window the sinc impulse response
    FrequencyResponse(h, nullptr, Response, 8, false,
        TSignalWindowType::wtRectangular, 0);
    FreqFr.Size(Response.Length);
    FreqFr.Ramp(0, 200*0.5/Response.Length);
}
See Also: SignalUtils::Hanning, SignalUtils::Kaiser, SignalUtils::SignalWindow
Declared in Dew::Signal::Units::SignalUtils · Dew.Signal/Units.SignalUtils.h · Cross-compiler

Overload 2: TVec *Bartlett(TVec *Src, int Index, int Len);

Bartlett window.

#NameTypeDescription
1SrcTVec *
2Indexint
3Lenint
Remarks:

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

Declared in Dew::Signal::Units::SignalUtils · Dew.Signal/Units.SignalUtils.h · Cross-compiler