The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....

## ImagSpec

 Unit: SDL_fourier Class: TFastFourier Declaration: property ImagSpec[ix: integer]: double;

The array property ImagSpec provides access to the imaginary part of the spectrum. The index ix may assume values between 1 and SpectrumSize. Accessing any value of the array below 1 and above SpectrumSize will result in a zero value on read, or in no action on write.

Note: Since the index of the data buffer starts with 1 (and not 0), the index of the harmonics of the resulting Fourier spectrum is shifted by one. Thus the constant coefficient a0 is stored in ImagSpec[1], the first harmonic in ImagSpec[2], the second in ImagSpec[3], and so on.

 Hint 1: In order to obtain the coefficients of the sine terms of the corresponding fourier series, one has to subtract the coefficient of the negative frequency from the positive frequency coefficient (see also FourSerSinCoeff).

The figure below shows the order of the frequency components as they are stored in ImagSpec after performing a Fourier transform:

 Hint 2: If you compare the results of the SDL implementation of the FFT and the results of the FFT as implemented in MathWorks' MATLAB®, you will discover that the signs of the imaginary parts of the SDL and the MATLAB implementation are inverted. The reason for this is that MATLAB uses a negative j (= sqrt(-1)) while the SDL implementation uses a positive j. The former is more common in engineering while the latter is commonly used in physics and pure mathematics.

 Example: This property is used in the following example programs (see http://www.lohninger.com/examples.html for downloading the code): fft, foursynt, ftfilter

Last Update: 2012-Okt-20