File:DIF-FFT-butterfly-coloured.svg

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Original file(SVG file, nominally 387 × 298 pixels, file size: 81 KB)

Captions

Captions

Butterfly diagram of DIF-FFT

Summary[edit]

Description
English: Decimation in frequency of a length-N DFT into two length-N/2 DFTs followed by a combining stage, coloured for easier understanding.
Date
Source Own work
Author Yangwenbo99

This figure was drawn with LaTeX:

% \documentclass[tikz,convert={outfile=\jobname.svg}]{standalone}
\documentclass[tikz]{standalone}
\usetikzlibrary{automata,positioning}
\usetikzlibrary{math}
\usepackage{relsize}
%\usetikzlibrary{...}% tikz package already loaded by 'tikz' option
\begin{document}
\begin{tikzpicture}% Example:
  \draw[fill=white, draw=white] (-4.5, 0.7) rectangle (6.4, -7.7); 

  % arrow on the right of x's
  \tikzmath{
    \s = 4;
    \spl = 1.8;
    \plocx = 3.5; 
    int \n; 
    for \n in {0,...,3}{
      \x = \n; 
      {
        \draw[color=teal] (0 - \s,-\n) node {$x[\x]$};
        \draw[color=teal] (0.5 - \s,-\n) circle(0.05)[fill=white]; 
        \draw[color=teal] [-latex] (0.55 - \s,-\n) -- (1.4 - \s, -\n); 
        % \draw[color=teal] (1.4 - \s, -\n) -- (1.8 - \s, -\n); 
        \draw[color=teal] (1.4 - \s, -\n + 0.2) node {\tiny $1$};

        \draw[-latex,color=teal] (1.4 - \s, -\n) -- (\plocx - 0.2 - \s, -\n); 
        \draw[-latex,color=teal] (\spl - \s, -\n) circle(0.03)[fill=teal];
        \draw[-latex,color=teal] (\spl - \s, -\n) -- (\plocx - \s, -\n - 3.8); 
      };
    };
    for \n in {0,...,3}{
      \x = int(\n + 4); 
      {
        \draw[color=blue] (0 - \s,-\n - 4) node {$x[\x]$};
        \draw[color=blue] (0.5 - \s,-\n - 4) circle(0.05)[fill=white]; 
        \draw[color=blue] [-latex] (0.55 - \s,-\n-4) -- (1.4 - \s, -\n - 4); 
        \draw[color=blue] (0.9 - \s,-\n - 4) circle(0.03)[fill=blue];
        \draw[color=blue] [-latex] 
          (0.9 - \s, -\n - 4) --
          (0.9 - \s,-\n-3.5) -- (1.4 - \s, -\n - 3.5); 
        % \draw[color=blue] (1.4 - \s, -\n - 4) -- (\spl - \s, -\n - 4); 
        \draw[color=blue] (1.4 - \s, -\n - 3.5) -- (\spl - \s, -\n - 3.5); 
        \draw[color=blue] (1.4 - \s, -\n - 3.3) node {\tiny $1$};
        \draw[color=blue] (1.4 - \s, -\n - 3.8) node {\tiny $-1$};

        \draw[-latex,color=blue] (1.4 - \s, -\n - 4) -- (\plocx - 0.2 - \s, -\n - 4); 
        \draw[-latex,color=blue] (\spl - \s, -\n - 3.5) -- (\plocx - \s, -\n - 0.2); 
      };
    };
    for \n in {0,...,3}{
      \x = \n; 
      {
        \draw[color=orange] (\plocx - \s,-\n) circle(0.2);
        \draw[color=orange] (\plocx - \s,-\n) node {$+$};
        \draw[-latex,color=orange] (\plocx - \s + 0.2,-\n) -- (1.4, -\n); 
      };
    };
    for \n in {0,...,3}{
      \x = \n; 
      \bbb = 0.5;
      {
        \draw[color=magenta] (\plocx - \s,-\n - 4) circle(0.2);
        \draw[color=magenta] (\plocx - \s,-\n - 4) node {$+$};
        \draw[-latex,color=magenta] (\plocx - \s + 0.2,-\n - 4) -- (\bbb, -\n - 4); 
        \draw[-latex,color=magenta] (\bbb,-\n - 4) -- (1.4, -\n - 4); 
        \draw[color=magenta] (\bbb,-\n - 3.8) node{\scriptsize $W_N$}; 
      };
    };
  }

  % blocks
  \draw[color=orange](1.4, 0.3) rectangle (4, -3.3); 
  \draw[color=magenta](1.4, -3.7) rectangle (4, -7.3); 
  \draw(2.7, -1.5) node[color=orange,text centered, text width=2cm] {$N/2$-point DFT};
  \draw(2.7, -5.5) node[color=magenta,text centered, text width=2cm] {$N/2$-point DFT};

  % E's and O's 
  \foreach \n in {0,...,3} {
    \draw [-latex,color=orange] (4,-\n) -- (4.95, -\n); 
    \draw[color=orange] (5,-\n) circle(0.05)[fill=white]; 
  }
  \foreach \n in {0,...,3} {
    \draw [-latex,color=magenta] (4,-\n  - 4) -- (4.95, -\n - 4); 
    \draw[color=magenta] (5,-\n - 4) circle(0.05)[fill=white]; 
  }
  \tikzmath{
    int \n; 
    for \n in {0,...,3}{
      \x = int(2 * \n); 
      {
        \draw[color=orange] (5.5,-\n) node {$X[\x]$};
      };
    };
    for \n in {0,...,3}{
      \x = int(2 * \n + 1); 
      {
      \draw[color=magenta] (5.5,-\n - 4 ) node {$X[\x]$};
      };
    };
  }

\end{tikzpicture}
\end{document}

Licensing[edit]

I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.

File history

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

Date/TimeThumbnailDimensionsUserComment
current10:18, 19 October 2021Thumbnail for version as of 10:18, 19 October 2021387 × 298 (81 KB)Yangwenbo99 (talk | contribs)Uploaded own work with UploadWizard

The following page uses this file:

Metadata