Keywords: 8-point windows.gif en We illustrate two different ways to generate triangular 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 triang 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 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 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 2 0 74 str 'color' 'blue' 'FontSize' 12 title 'Two 8-point Bartlett window functions' 'FontSize' 14 ; xlabel '\leftarrow n \rightarrow' </source> cc-zero Digital signal processing |