File:Spectral leakage from two 8-point Gaussian windows.png

Summary

Description
English: Comparing the discrete-time Fourier transforms of "symmetric" and "periodic" windows. The Gaussian form (σ = 0.4) was chosen for its non-zero end-points, one of which is discarded in the periodic version.
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.

Category:CC-Zero#Spectral%20leakage%20from%20two%208-point%20Gaussian%20windows.png
Category:Self-published work
Other versions Derivative works of this file:  Comparison of symmetric and periodic Gaussian windows.svgCategory:Files with derivative versions
PNG development
InfoField
Octave/gnuplot source
InfoField
click to expand

This graphic was created by the following Octave script:

graphics_toolkit gnuplot
pkg load signal

symmetric8 = exp(-.5*(((0:7)-7/2)/(.4*7/2)).^2);   % 8-points of an 8-point window
periodic8  = exp(-.5*(((0:7)-8/2)/(.4*8/2)).^2);   % 8-points of a  9-point window

 ENBW_symmetric8 = 8*sum(symmetric8.^2)/sum(symmetric8)^2                            % 1.6233
 ENBW_periodic8  = 8*sum(periodic8.^2) /sum(periodic8)^2                             % 1.4533

%Now compute and plot the DTFTs and DFTs
 N = 8;         % DFT size
 M = 64*N;      % DTFT size
 dr = 80;       % dynamic range (decibels)
%------------------------------------------------------------------
% DTFT of symmetric window
H = abs(fft([symmetric8 zeros(1,M-N)]));
H = fftshift(H);
H = H/max(H);
H = 20*log10(H);
H = max(-dr,H);
x = N*[-M/2:M/2-1]/M;

figure("position", [100 200 700 400])
plot(x, H, "color","red", "linewidth",1);
hold on
ylim([-dr 0])

% Compute a DFT to sample the DTFT 8 times
H = abs(fft(symmetric8));
H = fftshift(H);
H = H/max(H);
H = 20*log10(H);
H = max(-dr,H);
plot(-N/2:(N/2-1), H, "color","red", ".", "markersize",14)

%------------------------------------------------------------------
% DTFT of periodic window
H = abs(fft([periodic8 zeros(1,M-N)]));
H = fftshift(H);
H = H/max(H);
H = 20*log10(H);
H = max(-dr,H);
plot(x, H, "color","blue", "linewidth",1);

% Compute a DFT to sample the DTFT 8 times
H = abs(real(fft(periodic8)));   % real() is redundant... just to illustrate a point
H = fftshift(H);
H = H/max(H);
H = 20*log10(H);
H = max(-dr,H);
plot(-N/2:(N/2-1), H, "color","blue", ".", "markersize",14)

set(gca,"XTick", -N/2:N/2-1)
grid on
text(-1.17,-64, "Equivalent Noise Bandwidths", "fontsize",10, "fontweight","bold")
h = legend("", num2str(ENBW_symmetric8,'%5.3f'),...
           "", num2str(ENBW_periodic8, '%5.3f'), "location","south");
set(h, "fontsize",10)
%legend boxoff

text(-2.84, -11.66, {"        DTFT";'symmetric8 \rightarrow'}, "color","red",...
        "fontsize",10, "fontweight","bold")
set(gca,"XTick", -N/2:N/2-1)
grid on
ylabel("decibels", "fontsize",14)
xlabel("DFT bins", "fontsize",12, "fontweight","bold")
title('"Spectral leakage" from two 8-point Gaussian windows','FontSize', 14)

% After this call, the cursor units change to a normalized ([0,1]) coordinate system
annotation("textarrow", [.132 .132], [.675 .51],...
        "color", "blue", "string", {"   DTFT";"periodic8"}, "fontsize",10,...
        "linewidth",1, "headstyle","vback1", "headlength",5, "headwidth",5)
Category:Digital signal processing Category:Created with GNU Octave Category:Images with Octave source code Category:Images with Gnuplot source code
Category:CC-Zero Category:Created with GNU Octave Category:Digital signal processing Category:Files with derivative versions Category:Images with Gnuplot source code Category:Images with Octave source code Category:PNG created with LibreOffice Category:Pages using deprecated source tags Category:Self-published work