TVec Blackman(TVec Src, Double alfa, TSignalWindowMode WindowMode)
Blackman window.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Src | TVec | source TVec |
| 2 | alfa | Double | scalar |
| 3 | WindowMode | TSignalWindowMode |
Returns: TVec
Remarks:
Applies Blackman window with alfa parameter 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. The window is defined as [1]:
w[n] = (1 - alpha)/2 - 0.5cos((2pi n)/(N-1)) + alpha/2cos((4pi n)/(N-1))
alfa = 0.16 (standard window) alfa = 0.25 (asymptotic optimal window for large N)
w[n] = 0.42 - 0.5*cos(2*Pi*n/(N-1)) + 0.08*cos(4*Pi*n/(N-1)) (alfa = 0.16)
0 <= n <= N - 1
References:
[1] F. J. Harris, "On the use of windows for harmonic analysis with the discrete Fourier transform", Proceedings of the IEEE 66(1), 1978.
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.Blackman(h,0.1,TSignalWindowMode.wmSymmetric); //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.Kaiser, SignalUtils.SignalWindow
Indexed: TVec Blackman(TVec Src, Double alfa, TSignalWindowMode WindowMode, Int32 Index, Int32 Len)
Blackman window.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Src | TVec | source TVec |
| 2 | alfa | Double | scalar |
| 3 | WindowMode | TSignalWindowMode | |
| 4 | Index | Int32 | start index |
| 5 | Len | Int32 | element count |
Returns: TVec
Remarks:
Applies Blackman window to Src vector from element at [Index] to element at [Index + Len - 1].