Keywords: 8-point Hann windows.png en We illustrate two different ways to generate Hann window functions for spectral analysis applications MATLAB calls them symmetric and periodic The latter is also called DFT Even in the classic Frederic Harris paper 2016-04-05 own Bob K Octave script <source lang Matlab > pkg load signal graphics_toolkit gnuplot L 5600; window hann L ; N 8; window size in samples dx L-1 / N-1 ; decimation factor for 7 hops symmetric window 1+ 0 7 dx dx L-1 /N; decimation factor for 8 hops periodic window 1+ 0 7 dx ; but discard the last one Replace above with the equivalent formulaic versions symmetric 5 1-cos 2 pi 0 N-1 / N-1 ; periodic 5 1-cos 2 pi 0 N-1 /N ; aka DFT Even Compare equivalent noise bandwidths info only ENBW_symmetric N sum symmetric 2 /sum symmetric 2 ENBW_periodic N sum periodic 2 /sum periodic 2 figure plot 0 7 symmetric 'color' 'red' ' ' plot the symmetric coefficients box off no border around plot hold on same axes for next 3 plots plot 0 7 periodic 'color' 'blue' ' ' plot the periodic coefficients connect the dots x 0 L-1 N/L; plot x window 'color' 'blue' periodic x 0 L-1 N-1 /L; plot x window 'color' 'red' symmetric xlim 0 8 set gca 'FontSize' 14 set gca yaxislocation zero set gca 'xgrid' 'on' ; set gca 'ygrid' 'on' ; set gca 'ytick' 0 25 1 ; set gca 'xtick' 0 8 ; text 3 3 0 27 'Matlab symmetric \rightarrow' 'color' 'red' 'FontSize' 12 str '\leftarrow Matlab periodic ' ' DFT-even ' ; text 5 5 0 74 str 'color' 'blue' 'FontSize' 12 title 'Two 8-point Hann window functions' 'FontSize' 14 ; xlabel '\leftarrow n \rightarrow' </source> cc-zero Original upload log wikitable - - 2013-08-27 04 03 10 636 × 374 12992 bytes Bob K User created page with UploadWizard Digital signal processing |