Environment: Siren
Instances of Spectrum represent 3-D data functions derived from sound analysis.
Instance Variables:
accessing
sound
window
windowSize
stepSize
fft
magReal
D: factor
Set the receiver's decimation factor.
N
Answer the receiver's 'windowSize'.
N: aNum
Set the receiver's instance variable 'windowSize' to be aNum.
sound
Answer the receiver's 'sound'.
sound: anObject
Set the receiver's instance variable 'sound' to be anObject.
stepSize
Answer the receiver's 'stepSize'.
stepSize: anObject
Set the receiver's instance variable 'stepSize' to be anObject.
windowSize
Answer the receiver's 'windowSize'.
windowSize: aNum
Set the receiver's instance variable 'windowSize' to be aNum.
computing
Do the FFT and store the results into the receiver's data.
compute0
Do the FFT and store the results into the receiver's data.
setData
Create the receiver's data array for the right number of frames.
updateRange
Iterate over the receier's data getting the RMS data range
window: which
Answer the real data array for the given window of the receiver's sound.
modes
Set the receiver's instance variable 'magReal' to be #complex.
real
Set the receiver's instance variable 'magReal' to be #real.
setWindow: aSymbol
Set the receiver's 'window'.
window
Answer the receiver's 'window'.
time warp
Answer a new frame interpolated for the given (floating-point) index.
timewarpBy: fact
Interpolate/decimate the receiver by the given (float or function) time factor.
printing
Display the receiver
printOn: aStream
Format and print the receiver on the argument.
initialize-release
Set up the receiver.
frames
Answer the value at the given index (between 1 and self size).
at: anIndex put: aValue
Answer the value at the given index (between 0 and 1).
frame: anIndex
Answer the frame at the given index (between 1 and self size).
frame: anIndex do: aBlock
Iterate over a single frame with the given block.
frame: frm imagAt: frq
Answer the given imag value in the given frame.
frame: frm imagAt: frq put: val
Set the given imag value in the given frame.
frame: anIndex put: aValue
Set the value at the given index (between 0 and 1).
frame: frm realAt: frq
Answer the requested real value from the given frame.
frame: frm realAt: frq put: val
Set the given real value in the given frame.
MetaClass: Spectrum class
examples
Read a sound from disk and take its fft.
sweepExample
Create a swept sine wave and take its fft.