const
{$IFDEF PAIDVERS}
SDLVersionInfo = 'fourier_r1210_full';
IsLightEd = false;
{$ELSE}
SDLVersionInfo = 'fourier_r1210_lighted';
IsLightEd = true;
{$ENDIF}
Release = 1210;
type
ESDLFourierError = class(ESDLError); { exception type to indicate errors }
TFastFourierWgtWin = (fwRectangle, fwTriangle, fwCos2, fwGauss, fwHamming,
fwBlackman, fwBlkmHarris, fwBlkmNuttall, fwTukey, fwUserDef);
{$IFDEF GE_LEV29}
[ComponentPlatformsAttribute(pidWin32 or pidWin64 or pidWin64x)]
{$ENDIF}
TFastFourier = class (TComponent)
private
FNumData : longint; { size of data array, must be 2^n }
FWgtWin : TFastFourierWgtWin;
MaxValuesValid : boolean;
FMaxReal : double;
FMaxImag : double;
FMinReal : double;
FMinImag : double;
FMaxPower : double;
FMaxMagni : double;
FTukAlpha : double;
FUserWgt : array of double;
function GetRealVal(ix: integer): double;
procedure SetRealVal (ix: integer; v: double);
function GetImagVal(ix: integer): double;
procedure SetImagVal (ix: integer; v: double);
function GetWgtVal (ix: integer): double;
procedure SetWgtVal (ix: integer; v: double);
procedure SetNumData (ndata: longint);
procedure SetWgtWin (ww: TFastFourierWgtWin);
procedure SetTukAlpha (Alpha: double);
function GetPowerSpec (ix: integer): double;
function GetMagnitude (ix: integer): double;
function GetFSerSin (n: integer): double;
function GetFSerCos (n: integer): double;
function GetPhase (ix: integer): double;
function GetMaxPower: double;
function GetMaxMagni: double;
function GetMaxReal: double;
function GetMaxImag: double;
function GetMinReal: double;
function GetMinImag: double;
procedure DoFFT (isign: integer);
procedure CalcMaxValues;
public
FData : array of double;
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
property RealSpec[ix: integer]: double read GetRealVal write SetRealVal;
property ImagSpec[ix: integer]: double read GetImagVal write SetImagVal;
property WgtFunction[ix: integer]: double read GetWgtVal write SetWgtVal;
procedure Clear;
procedure ClearImag;
procedure ClearReal;
procedure Transform;
function FreqOfLine (ix: integer; SampleTime: double): double;
function LineOfFreq (f: double; SampleTime: double): integer;
procedure InverseTransform;
property PowerSpec[ix: integer]: double read GetPowerSpec;
function RMS (FirstIx, LastIx: integer): double;
property Magnitude[ix: integer]: double read GetMagnitude;
property FourSerSinCoeff[n: integer]: double read GetFSerSin;
property FourSerCosCoeff[n: integer]: double read GetFSerCos;
property Phase[ix: integer]: double read GetPhase;
property PowerMax: double read GetMaxPower;
property MagniMax: double read GetMaxMagni;
property RealMax: double read GetMaxReal;
property ImagMax: double read GetMaxImag;
property RealMin: double read GetMinReal;
property ImagMin: double read GetMinImag;
published
property SpectrumSize: longint read FNumData write SetNumData;
property WeightingWindow: TFastFourierWgtWin read FWgtWin write SetWgtWin;
property TukeyAlpha: double read FTukAlpha write SetTukAlpha;
end;
|