mathapps
Class FFT

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Panel
                    |
                    +--java.applet.Applet
                          |
                          +--edu.davidson.tools.SApplet
                                |
                                +--mathapps.FFT
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, edu.davidson.tools.SDataSource, java.io.Serializable, edu.davidson.tools.SStepable

public class FFT
extends SApplet
implements edu.davidson.tools.SDataSource, edu.davidson.tools.SStepable

The FFT Physlet evaluates a function at a predetermined number of points and computes the Fast Fourier Transfprm, FFT. The range of the indexpendent variable can be set using the Min and Max embedding parameters. The number of points can be set with the NumPts parameter.

See Also:
Serialized Form

Fields inherited from class edu.davidson.tools.SApplet
clock, dataConnections, dataListeners, dataSources, lock
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
FFT()
           
 
Method Summary
 java.lang.String getAppletInfo()
           
 int getFunctionID()
           
 java.lang.String getFunctionStr(java.lang.String string)
           
 SApplet getOwner()
          Data source method.
 java.lang.String getParameter(java.lang.String key, java.lang.String def)
           
 java.lang.String[][] getParameterInfo()
           
 double[][] getVariables()
          Data source method.
 java.lang.String[] getVarStrings()
          Data source method.
 void init()
           
static void main(java.lang.String[] args)
           
 void reset()
          Reset the applet to time =0.
 void setAutoRefresh(boolean refresh)
          Inhibit or enable the fft calcuation.
 void setDefault()
          Delete the data connections and set the time to zero.
 boolean setFunction(java.lang.String function, java.lang.String variable)
          Set the function string and the independent variable.
 boolean setFunctionStr(java.lang.String function)
          Set the function string.
 void setMinMax(double min_, double max_)
          Set the minimum and maximum values sorted by the histogram.
 void setNumPts(int n)
          Set the number of grid points.
 void setOwner(SApplet owner)
          Data source method.
 void setShowDC(boolean set)
          Show or hide the zero frequency component.
 void step(double dt, double time)
          Step the time.
 
Methods inherited from class edu.davidson.tools.SApplet
addDataListener, addDataSource, cleanupDataConnections, clearAllData, clearData, deleteDataConnection, deleteDataConnections, destroy, forward, getClockID, getClockTime, getDataConnectionFromDL, getDataConnectionFromDS, getDataFromDS, getDataListener, getDataListener, getDataSource, getDataSource, getID, getRunningID, getSourceData, getSourceVariables, isAutoRefresh, isClockRunning, makeDataConnection, pause, removeDataListener, removeDataSource, reverse, setClockContinous, setClockCycle, setClockOneShot, setClockTime, setConnectionBlock, setConnectionListener, setConnectionSmoothing, setConnectionSource, setConnectionStride, setDt, setExternalClock, setFPS, setRunningID, setRunningID, setTimeContinuous, setTimeCycle, setTimeOneShot, startClock, stepClock, stepTime, stepTimeBack, stepTimeForward, stopClock, updateDataConnection, updateDataConnections
 
Methods inherited from class java.applet.Applet
getAccessibleContext, getAppletContext, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus, start, stop
 
Methods inherited from class java.awt.Panel
addNotify
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, remove, remove, removeAll, removeContainerListener, removeNotify, setFont, setLayout, update, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, disable, dispatchEvent, enable, enable, enableInputMethods, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.davidson.tools.SDataSource
getID
 

Constructor Detail

FFT

public FFT()
Method Detail

getAppletInfo

public java.lang.String getAppletInfo()
Overrides:
getAppletInfo in class java.applet.Applet

getFunctionID

public int getFunctionID()

getFunctionStr

public java.lang.String getFunctionStr(java.lang.String string)

getOwner

public SApplet getOwner()
Data source method. DO NOT SCRIPT.
Specified by:
getOwner in interface edu.davidson.tools.SDataSource

getParameter

public java.lang.String getParameter(java.lang.String key,
                                     java.lang.String def)

getParameterInfo

public java.lang.String[][] getParameterInfo()
Overrides:
getParameterInfo in class java.applet.Applet

getVariables

public double[][] getVariables()
Data source method. DO NOT SCRIPT.
Specified by:
getVariables in interface edu.davidson.tools.SDataSource

getVarStrings

public java.lang.String[] getVarStrings()
Data source method. DO NOT SCRIPT.
Specified by:
getVarStrings in interface edu.davidson.tools.SDataSource

init

public void init()
Overrides:
init in class java.applet.Applet

main

public static void main(java.lang.String[] args)

reset

public void reset()
Reset the applet to time =0.
Overrides:
reset in class SApplet

setAutoRefresh

public void setAutoRefresh(boolean refresh)
Inhibit or enable the fft calcuation. Inhibit auto refresh if a number of parameters are to be changed.
Overrides:
setAutoRefresh in class SApplet
Following copied from class: edu.davidson.tools.SApplet
Parameters:
autoRefresh - Automatic repaint?

setDefault

public void setDefault()
Delete the data connections and set the time to zero.
Overrides:
setDefault in class SApplet

setFunction

public boolean setFunction(java.lang.String function,
                           java.lang.String variable)
Set the function string and the independent variable.
Parameters:
function - the function string
variable - the independent variable
Returns:
true if the string is a valid function.

setFunctionStr

public boolean setFunctionStr(java.lang.String function)
Set the function string.
Parameters:
function - the function string
Returns:
true if the string is a valid function.

setMinMax

public void setMinMax(double min_,
                      double max_)
Set the minimum and maximum values sorted by the histogram.

setNumPts

public void setNumPts(int n)
Set the number of grid points.

setOwner

public void setOwner(SApplet owner)
Data source method. DO NOT SCRIPT.
Specified by:
setOwner in interface edu.davidson.tools.SDataSource

setShowDC

public void setShowDC(boolean set)
Show or hide the zero frequency component. The dc compent will be included in the fft if this flag is true.
Parameters:
set - true to show the dc component

step

public void step(double dt,
                 double time)
Step the time. DO NOT SCRIPT. This function is called by the animation clock.
Specified by:
step in interface edu.davidson.tools.SStepable

Copyright Wolfgang Christian

Visit the Davidson CollegePhyslets Page