Table of Content

  1. Cosine-sum windows

  2. Quick Reference Information

  3. FFT spectrum analysis

Cosine-sum windows

The cosine-sum windows are an interesting class of FFT/DFT window functions.   Classic examples are the Hamming, Hanning, Blackman and Blackman-Harris windows (which are called ham,han, b3 and bh3 in this document).   See Quick Reference Information and literary References for more information.

A·  Tabulated properties for periodic windows of 1024 samples

See Figures of merit for a description of the table headings.

Signal Gain [dB]Noise Gain [dB]Equiv Noise BW [bins]Relative Process Gain [dB]Process Gain [dB]Scalloping Loss [dB]Main Lobe width [bins]Highest Sidelobe Level [dB]Sidelobe Drop Rate [dB]Terms
rect001030.13.9222-13.2617.11.0
han-6.021-4.261.5-1.76128.341.4244-31.4757.20.5,-0.5
ham-5.352-4.0081.3628-1.34428.761.7514-42.6710.20.54,-0.46
b3-7.535-5.1631.7268-2.37227.731.0996-58.1248.30.42,-0.5,0.08
bh3-7.468-5.1421.7085-2.32627.781.1296-70.847.860.42323,-0.49755,0.07922
bhh3-7.449-5.1331.7046-2.31627.791.1346-71.346.770.424161,-0.497378,0.078461
bh4-8.904-5.8842.0044-3.0227.080.82568-92.0328.40.35875,-0.48829,0.14128,-0.01168
bhh4-8.784-5.8281.9751-2.95627.150.85148-97.974.530.36376721,-0.48922703,0.13641742,-0.01058834
bhh5-9.581-6.2382.1592-3.34326.760.71529.53-118.73.340.33186237,-0.47615347,0.16743138,-0.02382482,0.00072796
bhh6-10.34-6.6282.3523-3.71526.390.604411.3-140.17.020.3039747821,-0.4594726795,0.1927447601,-0.0404819348,0.0032818617,-4.39818e-05
N2-5.379-4.0191.3676-1.3628.741.7394-43.19100.53836,-0.46164
N3-8.519-5.6311.9444-2.88827.220.8636-46.7499.50.375,-0.5,0.125
N3A-7.766-5.2811.7721-2.48527.621.0456-64.1944.40.40897,-0.5,0.09103
N3B-7.445-5.1311.7037-2.31427.791.1356-71.486.50.4243801,-0.4973406,0.0782793
N4-10.1-6.4672.31-3.63626.470.61848-60.951430.3125,-0.46875,0.1875,-0.03125
N4A-9.397-6.1232.1253-3.27426.830.73218-82.6182.70.338946,-0.481973,0.161054,-0.018027
N4B-8.977-5.922.0212-3.05627.050.81188-93.3336.70.355768,-0.487396,0.144232,-0.012604
N4C-8.788-5.831.9761-2.95827.140.85068-98.144.520.3635819,-0.4891775,0.1365995,-0.0106411
A2-5.379-4.0191.3677-1.3628.741.7394-43.19100.538355394671,-0.461644605329
A3-7.445-5.1311.7037-2.31427.791.1356-71.486.50.424380093461,-0.497340635097,0.0782792714423
A4-8.788-5.831.9761-2.95827.140.85068-98.154.510.363581926771,-0.489177437145,0.136599513979,-0.0106411221055
A5-9.81-6.3562.2153-3.45426.650.680110-125.42.960.323215378888,-0.471492143958,0.17553412996,-0.0284969901061,0.00126135708829
A6-10.65-6.7832.4339-3.86326.240.565312-153.41.770.29355789501,-0.451935772347,0.201416471426,-0.0479261092211,0.00502619642686,-0.000137555567956
A7-11.33-7.1342.6303-4.225.90.485214-180.21.070.271220360585,-0.433444612327,0.218004122893,-0.0657853432956,0.0107618673053,-0.000770012710581,1.36808830599e-05
A8-11.93-7.4352.8129-4.49225.610.425116-207.1632m0.253317681703,-0.416326930581,0.228839621372,-0.0815750842593,0.0177359245035,-0.00209670274903,0.000106774130221,-1.28070209036e-06
A9-12.45-7.7022.9859-4.75125.350.377818-234446m0.238433115278,-0.400554534864,0.235824253047,-0.0952791885838,0.0253739551662,-0.00415243290751,0.00036856041633,-1.38435559392e-05,1.16180835893e-07
A10-12.93-7.9433.1517-4.98525.120.339520-261.8473m0.225734538713,-0.386012294915,0.240129421411,-0.107054233866,0.0332591618402,-0.00687337495232,0.000875167323804,-6.00859893272e-05,1.71071647211e-06,-1.02727213027e-08
A11-13.35-8.1543.3048-5.19124.910.309122-288.2610m0.215152750668,-0.373134835779,0.242424335845,-0.116690759269,0.0407742210588,-0.0100090450085,0.00163980691736,-0.0001651660821,8.88466316854e-06,-1.93861711603e-07,8.48248559933e-10
SFT3F-11.53-6.5193.1681-5.00825.10.0081786-31.7262.80.26526,-0.5,0.23474
SFT4F-13.27-7.4743.797-5.79424.310.0040798-44.731050.21706,-0.42103,0.28294,-0.07897
SFT5F-14.51-8.1364.3412-6.37623.730.00245310-57.271490.1881,-0.36923,0.28702,-0.13077,0.02488
SFT3M-10.98-6.2932.9452-4.69125.410.01156-44.23120.282352823528,-0.521055210552,0.19659196592
SFT4M-12.33-7.0293.3868-5.29824.810.0067338-66.558.680.241906,-0.460841,0.255381,-0.041872
SFT5M-13.57-7.6753.8852-5.89424.210.00389310-89.9339.80.209671083868,-0.407331162932,0.28122511249,-0.0926690370676,0.00910360364144
FTNI-11.02-6.3032.9656-4.72125.389.134e-066-44.3511.90.281063618936,-0.520896679103,0.19803970196
FTHP-12.41-7.0633.4279-5.3524.758.091e-068-70.47.50.239523981485,-0.458092235221,0.258487878821,-0.043895904473
FTSRS-13.32-7.5593.7702-5.76424.340.015629.47-76.6248.70.215703192407,-0.416307161346,0.278257118205,-0.083692838654,0.0060396893874
HFT70-12.39-7.0583.4129-5.33124.770.0065058-70.467.520.240186000038,-0.458265280633,0.257837269181,-0.043711450147
HFT95-13.41-7.5963.8112-5.81124.290.00386610-94.995.480.213640903311,-0.414108259879,0.278698873916,-0.0860603241582,0.00749163873597
HFT90D-13.56-7.6733.8832-5.89224.210.00390310-90.2239.10.209783021421,-0.407525336544,0.281175959705,-0.0924746634556,0.00904101887418
HFT116D-14.32-8.0714.2186-6.25223.850.00283212-116.832.80.192240452512,-0.37631789481,0.284144941765,-0.122407781678,0.0236146057221,-0.00127432351161
HFT144D-14.98-8.4154.5386-6.56923.530.00212714-14427.50.178153071078,-0.350534041444,0.281452647671,-0.144524263157,0.0402333021358,-0.00494169539905,0.000160979115026
HFT169D-15.55-8.7084.8347-6.84423.260.0016616-167.923.50.166886261729,-0.329503309203,0.276046378613,-0.159857322793,0.0561963118343,-0.0106216780601,0.000871049492194,-1.76882748807e-05
HFT196D-16.05-8.9665.1134-7.08723.020.00133118-196.220.40.15752208173,-0.311780372085,0.269408275921,-0.170380586106,0.0706855632848,-0.0177018003803,0.00238220518182,-0.000137241428751,1.87388268426e-06
HFT223D-16.52-9.2065.3888-7.31522.790.00112120-223180.149272191195,-0.296005258401,0.262056411964,-0.177690209577,0.0838244569528,-0.0258192670819,0.00482633877351,-0.000485066818969,2.06011148157e-05,-1.98121515763e-07
HFT248D-16.94-9.4215.6512-7.52122.580.000884522-248.418.70.142197548229,-0.282382171299,0.254700898,-0.18230796203,0.094956327566,-0.0341502764537,0.00805639857835,-0.00115677342582,8.88087179893e-05,-2.81679094847e-06,1.89085767782e-08

B·  Tabulated properties for symmetric windows of 1024 samples

See Figures of merit for a description of the table headings.

Signal Gain [dB]Noise Gain [dB]Equiv Noise BW [bins]Relative Process Gain [dB]Process Gain [dB]Scalloping Loss [dB]Main Lobe width [bins]Highest Sidelobe Level [dB]Sidelobe Drop Rate [dB]Terms
rect001030.13.9222-13.2617.11.0
han-6.021-4.261.5-1.76128.341.4244-31.4757.20.5,-0.5
ham-5.352-4.0081.3628-1.34428.761.7514-42.6710.20.54,-0.46
b3-7.535-5.1631.7268-2.37227.731.0996-58.1248.30.42,-0.5,0.08
bh3-7.468-5.1421.7085-2.32627.781.1296-70.847.860.42323,-0.49755,0.07922
bhh3-7.449-5.1331.7046-2.31627.791.1346-71.346.770.424161,-0.497378,0.078461
bh4-8.904-5.8842.0044-3.0227.080.82568-92.0328.40.35875,-0.48829,0.14128,-0.01168
bhh4-8.784-5.8281.9751-2.95627.150.85148-97.984.530.36376721,-0.48922703,0.13641742,-0.01058834
bhh5-9.581-6.2382.1592-3.34326.760.71529.53-118.83.330.33186237,-0.47615347,0.16743138,-0.02382482,0.00072796
bhh6-10.34-6.6282.3523-3.71526.390.604411.3-140.17.020.3039747821,-0.4594726795,0.1927447601,-0.0404819348,0.0032818617,-4.39818e-05
N2-5.379-4.0191.3676-1.3628.741.7394-43.19100.53836,-0.46164
N3-8.519-5.6311.9444-2.88827.220.8636-46.7499.50.375,-0.5,0.125
N3A-7.766-5.2811.7721-2.48527.621.0456-64.1944.40.40897,-0.5,0.09103
N3B-7.445-5.1311.7037-2.31427.791.1356-71.486.50.4243801,-0.4973406,0.0782793
N4-10.1-6.4672.31-3.63626.470.61848-60.951430.3125,-0.46875,0.1875,-0.03125
N4A-9.397-6.1232.1253-3.27426.830.73218-82.6182.70.338946,-0.481973,0.161054,-0.018027
N4B-8.977-5.922.0212-3.05627.050.81188-93.3336.70.355768,-0.487396,0.144232,-0.012604
N4C-8.788-5.831.9761-2.95827.140.85068-98.174.490.3635819,-0.4891775,0.1365995,-0.0106411
A2-5.379-4.0191.3677-1.3628.741.7394-43.19100.538355394671,-0.461644605329
A3-7.445-5.1311.7037-2.31427.791.1356-71.486.50.424380093461,-0.497340635097,0.0782792714423
A4-8.788-5.831.9761-2.95827.140.85068-98.174.490.363581926771,-0.489177437145,0.136599513979,-0.0106411221055
A5-9.81-6.3562.2153-3.45426.650.680110-125.42.910.323215378888,-0.471492143958,0.17553412996,-0.0284969901061,0.00126135708829
A6-10.65-6.7832.4339-3.86326.240.565312-153.51.680.29355789501,-0.451935772347,0.201416471426,-0.0479261092211,0.00502619642686,-0.000137555567956
A7-11.33-7.1342.6303-4.225.90.485214-180.4903m0.271220360585,-0.433444612327,0.218004122893,-0.0657853432956,0.0107618673053,-0.000770012710581,1.36808830599e-05
A8-11.93-7.4352.8129-4.49225.610.425116-207.4373m0.253317681703,-0.416326930581,0.228839621372,-0.0815750842593,0.0177359245035,-0.00209670274903,0.000106774130221,-1.28070209036e-06
A9-12.45-7.7022.9859-4.75125.350.377818-234.676.7m0.238433115278,-0.400554534864,0.235824253047,-0.0952791885838,0.0253739551662,-0.00415243290751,0.00036856041633,-1.38435559392e-05,1.16180835893e-07
A10-12.93-7.9433.1517-4.98525.120.339520-262.700.225734538713,-0.386012294915,0.240129421411,-0.107054233866,0.0332591618402,-0.00687337495232,0.000875167323804,-6.00859893272e-05,1.71071647211e-06,-1.02727213027e-08
A11-13.35-8.1543.3048-5.19124.910.309122-289.300.215152750668,-0.373134835779,0.242424335845,-0.116690759269,0.0407742210588,-0.0100090450085,0.00163980691736,-0.0001651660821,8.88466316854e-06,-1.93861711603e-07,8.48248559933e-10
SFT3F-11.53-6.5193.1681-5.00825.10.0081786-31.7262.80.26526,-0.5,0.23474
SFT4F-13.27-7.4743.797-5.79424.310.0040798-44.731050.21706,-0.42103,0.28294,-0.07897
SFT5F-14.51-8.1364.3412-6.37623.730.00245310-57.271490.1881,-0.36923,0.28702,-0.13077,0.02488
SFT3M-10.98-6.2932.9452-4.69125.410.01156-44.23120.282352823528,-0.521055210552,0.19659196592
SFT4M-12.33-7.0293.3868-5.29824.810.0067338-66.558.680.241906,-0.460841,0.255381,-0.041872
SFT5M-13.57-7.6753.8852-5.89424.210.00389310-89.9339.80.209671083868,-0.407331162932,0.28122511249,-0.0926690370676,0.00910360364144
FTNI-11.02-6.3032.9656-4.72125.381.019e-056-44.3511.90.281063618936,-0.520896679103,0.19803970196
FTHP-12.41-7.0633.4279-5.3524.758.2e-068-70.417.50.239523981485,-0.458092235221,0.258487878821,-0.043895904473
FTSRS-13.32-7.5593.7702-5.76424.340.015629.47-76.6248.60.215703192407,-0.416307161346,0.278257118205,-0.083692838654,0.0060396893874
HFT70-12.39-7.0583.4129-5.33124.770.0065058-70.477.510.240186000038,-0.458265280633,0.257837269181,-0.043711450147
HFT95-13.41-7.5963.8112-5.81124.290.00386610-95.025.460.213640903311,-0.414108259879,0.278698873916,-0.0860603241582,0.00749163873597
HFT90D-13.56-7.6733.8832-5.89224.210.00390310-90.2239.10.209783021421,-0.407525336544,0.281175959705,-0.0924746634556,0.00904101887418
HFT116D-14.32-8.0714.2186-6.25223.850.00283212-116.832.80.192240452512,-0.37631789481,0.284144941765,-0.122407781678,0.0236146057221,-0.00127432351161
HFT144D-14.98-8.4154.5386-6.56923.530.00212714-14427.50.178153071078,-0.350534041444,0.281452647671,-0.144524263157,0.0402333021358,-0.00494169539905,0.000160979115026
HFT169D-15.55-8.7084.8347-6.84423.260.0016616-167.923.40.166886261729,-0.329503309203,0.276046378613,-0.159857322793,0.0561963118343,-0.0106216780601,0.000871049492194,-1.76882748807e-05
HFT196D-16.05-8.9665.1134-7.08723.020.00133118-196.220.40.15752208173,-0.311780372085,0.269408275921,-0.170380586106,0.0706855632848,-0.0177018003803,0.00238220518182,-0.000137241428751,1.87388268426e-06
HFT223D-16.52-9.2065.3888-7.31522.790.00112120-223180.149272191195,-0.296005258401,0.262056411964,-0.177690209577,0.0838244569528,-0.0258192670819,0.00482633877351,-0.000485066818969,2.06011148157e-05,-1.98121515763e-07
HFT248D-16.94-9.4215.6512-7.52122.580.000884522-248.418.70.142197548229,-0.282382171299,0.254700898,-0.18230796203,0.094956327566,-0.0341502764537,0.00805639857835,-0.00115677342582,8.88087179893e-05,-2.81679094847e-06,1.89085767782e-08

C·  Graphical overview of windows with high scalloping loss

These windows do not minimize the magnitude uncertainty of the main lobe.

C.1·  rect (sidelobe:-13.3dB; 1 terms)

C.2·  han (sidelobe:-31.5dB; 2 terms)

C.3·  ham (sidelobe:-42.7dB; 2 terms)

C.4·  N2 (sidelobe:-43.2dB; 2 terms)

C.5·  A2 (sidelobe:-43.2dB; 2 terms)

C.6·  N3 (sidelobe:-46.7dB; 3 terms)

C.7·  b3 (sidelobe:-58.1dB; 3 terms)

C.8·  N4 (sidelobe:-60.9dB; 4 terms)

C.9·  N3A (sidelobe:-64.2dB; 3 terms)

C.10·  bh3 (sidelobe:-70.8dB; 3 terms)

C.11·  bhh3 (sidelobe:-71.3dB; 3 terms)

C.12·  N3B (sidelobe:-71.5dB; 3 terms)

C.13·  A3 (sidelobe:-71.5dB; 3 terms)

C.14·  N4A (sidelobe:-82.6dB; 4 terms)

C.15·  bh4 (sidelobe:-92dB; 4 terms)

C.16·  N4B (sidelobe:-93.3dB; 4 terms)

C.17·  bhh4 (sidelobe:-98dB; 4 terms)

C.18·  A4 (sidelobe:-98.1dB; 4 terms)

C.19·  N4C (sidelobe:-98.2dB; 4 terms)

C.20·  bhh5 (sidelobe:-119dB; 5 terms)

C.21·  A5 (sidelobe:-125dB; 5 terms)

C.22·  bhh6 (sidelobe:-140dB; 6 terms)

C.23·  A6 (sidelobe:-153dB; 6 terms)

C.24·  A7 (sidelobe:-180dB; 7 terms)

C.25·  A8 (sidelobe:-207dB; 8 terms)

C.26·  A9 (sidelobe:-234dB; 9 terms)

C.27·  A10 (sidelobe:-262dB; 10 terms)

C.28·  A11 (sidelobe:-288dB; 11 terms)

D·  Graphical overview of windows with low scalloping loss

These windows minimize magnitude uncertainty of the main lobe.

D.1·  SFT3F (sidelobe:-31.7dB; 3 terms)

D.2·  SFT3M (sidelobe:-44.2dB; 3 terms)

D.3·  FTNI (sidelobe:-44.3dB; 3 terms)

D.4·  SFT4F (sidelobe:-44.7dB; 4 terms)

D.5·  SFT5F (sidelobe:-57.3dB; 5 terms)

D.6·  SFT4M (sidelobe:-66.5dB; 4 terms)

D.7·  FTHP (sidelobe:-70.4dB; 4 terms)

D.8·  HFT70 (sidelobe:-70.5dB; 4 terms)

D.9·  FTSRS (sidelobe:-76.6dB; 5 terms)

D.10·  SFT5M (sidelobe:-89.9dB; 5 terms)

D.11·  HFT90D (sidelobe:-90.2dB; 5 terms)

D.12·  HFT95 (sidelobe:-95dB; 5 terms)

D.13·  HFT116D (sidelobe:-117dB; 6 terms)

D.14·  HFT144D (sidelobe:-144dB; 7 terms)

D.15·  HFT169D (sidelobe:-168dB; 8 terms)

D.16·  HFT196D (sidelobe:-196dB; 9 terms)

D.17·  HFT223D (sidelobe:-223dB; 10 terms)

D.18·  HFT248D (sidelobe:-248dB; 11 terms)

Quick Reference Information

A·  Generating cosine-sum windows

Parameters used in the formulas below:

A.1·  Periodic

Periodic windows (also known as DFT even) are generally best for spectrum analysis.

Formula for generating periodic windows:

      m-1
      ---
      \    /           / 2.pi.i.n \ \   
w  =  /   (  C  . cos (  --------  ) )
 n    ---  \  i        \     N    / /
      i=0

A periodic window as generated by this formula starts with a zero sample.

A.2·  Symmetric

Symmetric windows are generally best for filter design [*].   Formula for generating symmetric windows:

      m-1
      ---
      \    /           / 2.pi.i.(n+1/2) \ \   
w  =  /   (  C  . cos (  --------------  ) )
 n    ---  \  i        \       N        / /
      i=0

A symmetric window as generated with this formula has no zero samples.

A.3·  Alternative formulas

Tektronix™ windows are identical to the above symmetric windows:

      m-1
      ---
      \    / |  |        / 2·pi·i   /     N-1 \ \ \
w  =  /   (  |C | · cos (  ------ ·(  n - ---  ) ) )
 n    ---  \ | i|        \   N      \      2  / / /
      i=0

Matlab™ symmetric windows are not used in this document, these start with a zero sample and also end with a zero sample:

      m-1
      ---
      \    /           / 2·pi·i·n \ \
w  =  /   (  C  · cos (  --------  ) )
 n    ---  \  i        \    N-1   / /
      i=0

[*] F.   J.   Harris, "On the use of windows for harmonic analysis with the Discrete Fourier Transform", Proc.   IEEE, vol.66, jan. 1978.

B·  Advantages of cosine-sum windows

All cosine-sum windows have unique advantages over other windows:

C·  Figures of merit list

Note: The calculation of most of these figures of merit is described in:

[*] F.   J.   Harris, "On the use of windows for harmonic analysis with the Discrete Fourier Transform", Proc.   IEEE, vol.66, jan. 1978.

D·  References

List of sources of the windows in this document (chronological order).

  1. Classic cosine-sum windows:
  2. F.J.Harris, "On the use of windows for harmonic analysis with the
    Discrete Fourier Transform", Proc. IEEE, vol.66, jan. 1978.
    
  3. Low sidelobe level cosine-sum windows:
  4. Flat-top cosine-sum windows:
  5. And many others cosine-sum windows, such as:

    "Spectrum and spectral density estimation by the Discrete Fourier
      transform (DFT), including a comprehensive list of window
      functions and some new flat-top windows."
     Heinzel, Rudiger and Schilling, 2002
    

FFT spectrum analysis

A short educational demonstration.

A·  Test waveform

The time domain signal that will be analyzed is the sum of two cosine waves (or tones): 6Hz (exactly on a DFT bin) and 33.5Hz .   The first is exactly harmonically related to the time window (1 second), or exactly circular, in other words there is no discontinuity when multiple sequences are concatenated.   The second tone does not map to a DFT bin, if falls exactly halfway between two DFT bins.   The sequency size is (FFT size) 128 samples.

Like elsewhere in this document, ony the real part of the FFT spectrum will be shown, corrected with the window gain.   Elsewhere, spectrum interpolation was achieved by zero-padding the window to 30 times its original length.   However, no interpolation is used here, individual samples have a marker, and the phase of the spectrum is plotted as well as the magnitude.

B·  FFT without window

The harmonically related tone is resolved perfectly: amplitude is correct and all energy is concentrated in one bin only.   The energy of the other tone is distributed over many DFT bins.   This is called spectral leakage.

C·  FFT with window

Leakage of the non-harmonic tone is much reduced by the window.

Amplitude differences as well as shape differences are further reduced.

Notice that the periodic and symmetric windows produce a similar amplitude response but the symmetric window exhibits a phase error.

D·  The symmetric window phase error explained

Comparing an 8 sample Blackman window (see Generating cosine-sum windows):

dec binPeriodicSymmetricMatlab™ symmetric
-4 100 0.0 0.014629 0.0
-3 101 0.066447 0.17209 0.090453
-2 110 0.34 0.55477 0.45918
-1 111 0.77355 0.93851 0.92036
+0 000 1 0.93851 0.92036
+1 001 0.77355 0.55477 0.45918
+2 010 0.34 0.17209 0.090453
+3 011 0.066447 0.014629 0.0

The first column shows a rotated sequence sample numbering (in decimal and two's complement binary).   The DFT considers all input sequences to be periodic.   For an 8 sample periodic sequence, it is evident that the sample at -4 will be identical to the sample at +4, which is actually the -4 sample of the next period.   When a 8 sample window is applied to a an 8 sample periodic sequence then the window should preserve this property.   A periodic Window will perfectly align with the fundamental frequency of the sequence, while a symmetric window is a halve sample shifted.

Python programming by LHE image/svg+xml