File:8-point Hann windows.svg

Original file(SVG file, nominally 700 × 525 pixels, file size: 296 KB)

Captions

Captions

Add a one-line explanation of what this file represents

Summary edit

Description
English: 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.
Date
Source Own work
Author Bob K
Permission
(Reusing this file)
I, the copyright holder of this work, hereby publish it under the following license:
Creative Commons CC-Zero This file is made available under the Creative Commons CC0 1.0 Universal Public Domain Dedication.
The person who associated a work with this deed has dedicated the work to the public domain by waiving all of their rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.

Other versions This file was derived from: 8-point Hann windows.png
SVG development
InfoField
 
The SVG code is valid.
 
This vector image was created with GNU Octave.
Octave/Gnuplot source
InfoField
click to expand
pkg load signal
graphics_toolkit gnuplot

L=5600;
window = hann(L);
N=8;                            % window size, in samples

warning("off")
dx = (L-1)/(N-1);               % decimation factor for 7 hops (8 samples)
symmetric = window(1+(0:7)*dx); % take 8 of 8 symmetrical samples
dx = (L-1)/N;                   % decimation factor for 8 hops (9 samples)
periodic = window(1+(0:7)*dx);  % take 8 of 9 symmetrical samples

%Replace above with the equivalent formulaic versions
%This step just proves that formulas match window() array.
 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
 
%Plot the coefficients as dots
 hfig=figure
 plot(0:7, symmetric, 'color', 'red', '.', 'MarkerSize', 10)
 box off                                    % no border around plot
 hold on                                    % same axes for next 3 plots
 
 plot(0:7, periodic,  'color', 'blue', '.', 'MarkerSize', 10)
 
%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", "origin")
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',12);
xlabel('\leftarrow  n  \rightarrow')

% I actually used the export function on the GNUPlot figure toolbar.
print(hfig,"-dsvg", "-S620,392","-color", 'C:\Users\BobK\8-point Hann windows.svg')

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current13:02, 10 August 2019Thumbnail for version as of 13:02, 10 August 2019700 × 525 (296 KB)Bob K (talk | contribs)User created page with UploadWizard

Metadata