FFT:
CEDAR
DEFINITIONS =
BEGIN
Watts, DBM, Volts, Hz, Seconds, Degrees: TYPE = REAL;
CVecRef: TYPE = REF CVec;
CVec:
TYPE =
RECORD [
totalTime: Seconds ← 1.0,
v:
SEQUENCE size:
NAT
OF Complex.
VEC
the sequence must have a size equal to a power of 2
];
NewCVec: PROC [ size: NAT ← 32, totalTime: Seconds ← 1.0, like: CVecRef ← NIL ] RETURNS [ v: CVecRef ];
CopyCVec: PROC [ from: CVecRef ] RETURNS [ v: CVecRef ];
AddCosWave: PROC [ v: CVecRef, freq: Hz, magnitude: Volts ← 1.0, phase: Degrees ← 0.0 ];
AddNoise: PROC [ v: CVecRef, powerPerHz: DBM ← 1.0, ohms: REAL ← 50.0 ];
TimeToFreq, FreqToTime: PROC [ v: CVecRef ];
Print: PROC [ v: CVecRef ] RETURNS [ Rope.ROPE ];
END.