This applet should run on any java1.1 system and above.
Most of the code is taken from the DSP Tutor
site but I have added a few features for my own particular interests.
Thanks go to the unnamed author of the DSP Tutor site.
To learn to run this applet, the guidlines at the DSP Tutor site are very good.
I will just mention the features (complications) I have added:
Drag the mouse over the signal or spectrum views to zoom in.
Use the UnZoom button to zoom out.
Grid is fairly obvious.
Log refers to the log10 of the vertical axis. The cursor position can go a little bonkers
when in log mode (I don't know why yet but it must be some form of overflow).
When in log mode the minimum vertical value is initially set to 0.001 or something like that.
Musical seperation is used to give a log10 effect to the horizontal axis.
Zero Hz doesn't mean much in music or in logorithms so I start the scale at 55Hz (low A).
You can't exactly specify the frequencies of interest with FFT (it's set by the sampling rate
and the number of samples), but for all the other transform types, domain conversions are
made on the musical notes (normally they use the FFT seperations).
More types of domain transforms have been added.
The Discrete or DFT transform multiplies two phases of a specific frequency by the
sample and sums the results to get a polar value which seems to be half of the amplitude.
Why half? You'll notice it is very slow compared to the FFT for the same number of
frequency steps (there are fewer in musical mode).
The Cos and Sine transforms are just the 0 and 90 degree phase portions of the DFT.
Gated is similar to DFT but the multiplying frequency is digital. Faster than DFT but
dodgy. Many harmonics are created. I have used this technique when measuring a known
frequency with a set phase but clearly this is not so good for general domain transforms.
Resonance feeds about 10 cycles of the sample frequency to a simulated sprung mass.
A mass is tuned for each frequency. Slow but quite successfull at low frequncies.
Works best if the sampling rate is much higher than the signal.
Be carefull not to use too large a sample with Resonance in non-Musical mode.
Up to 8 signals of different frequencies, amplitudes and types can be superimposed.
Reset should return signals to zero amplitude except number 0.
Changing any control should now update the display immediately. This might cause a
problem for very slow machines.
Speaking of which, I have added a status line to show the time the transformation takes.
Sometimes this seems to stick at an older number.
In order to get an accurate time, the transform is run several times.
This means that the transforms are run until the internal timer has ticked over a few times.
To look at the code just unjar the Analyser.jar which contains the
source code as well as the run code.
The three algorithm files which are of most interest are: