SignalUtils.BandFlip Method

void BandFlip(TVec X)

Flip the frequency band.

#NameTypeDescription
1XTVecsource TVec

Result: stored in self (calling object)

Remarks:

Flip the freqencies of the time domain signal stored in X, so that the DC becomes the Nyquist frequency and the Nyquist frequency becomes the DC. (mirror all frequencies around FS/4) The routine is very fast and can also be used for streaming. X.length must be even.

Examples
using Dew.Math;
using Dew.Math.Editors;
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 b = MtxExpr.Sin(MtxExpr.Ramp(256, TMtxFloatPrecision.mvDouble,0,2*Math.PI*6/256));
    Vector c = new Vector(b.Length);
    Vector Response1 = new Vector(0);
    Vector Response2 = new Vector(0);

    c.Copy(b);
    SignalUtils.BandFlip(b);
    MtxVecTee.DrawIt(new TVec[2] {c,b}, new string[2] {"Original signal","Flipped signal"},"Band flipped time signal", false);
    SignalUtils.FrequencyResponse(c, null, Response1, 1, true, TSignalWindowType.wtRectangular, 0);
    SignalUtils.FrequencyResponse(b, null, Response2, 1, true, TSignalWindowType.wtRectangular, 0);
    MtxVecTee.DrawIt(new TVec[2] {Response1,Response2}, new string[2] {"Spectrum: original signal","Spectrum: flipped signal"}, "Band flipped frequency spectrum", false);
}
See Also: SignalUtils.FirFilter