Class FFTFrame

All Implemented Interfaces:
ClipboardOwner, ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants, AppFrame, Hidable

public class FFTFrame extends DrawingFrame
FFTFrame computes the FFT and displays the result using a ComplexDataset.
Version:
1.0
Author:
W. Christian
See Also:
  • Field Details

  • Constructor Details

    • FFTFrame

      public FFTFrame(String xlabel, String ylabel, String title)
      A DrawingFrame that displays a FFT as its drawable.
      Parameters:
      xlabel - String
      ylabel - String
      title - String
  • Method Details

    • addMenuItems

      protected void addMenuItems()
      Adds Views menu items on the menu bar.
      Overrides:
      addMenuItems in class DrawingFrame
    • setXYColumnNames

      public void setXYColumnNames(String xlabel, String reLabel, String imLabel)
      Sets the labels on the data table. The xlabel resets the x axis label on the plot.
      Parameters:
      xlabel - String
      reLabel - String
      imLabel - String
    • setDomainType

      public void setDomainType(int type)
      Sets the units for the FFT output. Domain types are: MODE, FREQ, OMEGA, WAVENUMBER, MOMENTUM
      Parameters:
      type - int
    • convertToPostView

      public void convertToPostView()
    • convertToAmpAndPhaseView

      public void convertToAmpAndPhaseView()
    • convertToPhaseBarView

      public void convertToPhaseBarView()
    • doFFT

      public void doFFT(Function reF, Function imF, double xmin, double xmax, int n)
      Does an FFT of the given real and imaginary function. The function is evaulauted on the interval [xmin, xmax). Note that the endpoint, xmax, is excluded.
      Parameters:
      reF - function the real part of the function.
      imF - function the imaginary part of the function.
      xmin - double
      xmax - double
      n - int number of compelx data points
    • doRealFFT

      public void doRealFFT(double[] data, double xmin, double xmax)
      Does an FFT of the given data. The array is assumed to contain real numbers. The given array remains unchanged.
      Parameters:
      data - double[]
      xmin - double
      xmax - double
    • doFFT

      public void doFFT(double[] data, double xmin, double xmax)
      Does an FFT of the given data array. The data array is assumed to contain complex numbers stored as successive (re,im) pairs. The given array remains unchanged.
      Parameters:
      data - double[]
      xmin - double
      xmax - double
    • getDrawables

      public ArrayList<Drawable> getDrawables()
      Gets Drawable objects added by the user to this frame.
      Overrides:
      getDrawables in class DrawingFrame
      Returns:
      the list
    • clearDrawables

      public void clearDrawables()
      Removes drawable objects added by the user from this frame.
      Overrides:
      clearDrawables in class DrawingFrame
    • getDrawables

      public <T extends Drawable> ArrayList<T> getDrawables(Class<T> c)
      Gets Drawable objects added by the user of an assignable type. The list contains objects that are assignable from the class or interface.
      Overrides:
      getDrawables in class DrawingFrame
      Parameters:
      c - the type of Drawable object
      Returns:
      the cloned list
      See Also:
    • clearData

      public void clearData()
      Clears all the stored complex data.
      Overrides:
      clearData in class OSPFrame
    • setLogScale

      public void setLogScale(boolean xlog, boolean ylog)
      Sets the axes to use a logarithmetic scale.
      Overrides:
      setLogScale in class DrawingFrame
    • showLegend

      public void showLegend()
      Shows how phase angle is mapped to color.
    • showDataTable

      public void showDataTable(boolean show)
      Shows or hides the data table.
      Parameters:
      show - boolean