Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.
Announcements
FPGA community forums and blogs have moved to the Altera Community. Existing Intel Community members can sign in with their current credentials.

FFTInitAlloc arguments?

xorvax
Beginner
986 Views
I'd like to use FFT in my program (Delphi), but I don't know how to determinate arguments of FFTInitAlloc function (IppStatus ippiFFTInitAlloc_R_32s (IppiFFTSpec_R_32s** pFFTSpec,
int orderX, int orderY, int flag, IppHintAlgorithm hint)), especially - orderX, orderY. Some Delphi sample code how to use FFT.
thanks
0 Kudos
6 Replies
seiji-torigoe
Beginner
986 Views
Example 10-1 Fast Fourier Transform of a Real Image (p.10-12)
Maybe
ImageSize = 64 = 8 * 8; 8 := 2 * 2 * 2; orderX = 3; orderY =3; ???

Ex.

type IppHintAlgorithm = (
ippAlgHintNone,
ippAlgHintFast,
ippAlgHintAccurate
);

const IPP_FFT_DIV_FWD_BY_N = 1;
const IPP_FFT_DIV_INV_BY_N = 2;
const IPP_FFT_DIV_BY_SQRTN = 4;
const IPP_FFT_NODIV_BY_ANY = 8;

function ippiFFTInitAlloc_R_32f(
var pFFTSpec: Pointer;
orderX, orderY, flag: Integer;
hint: IppHintAlgorithm): Integer;
stdcall; external 'ippi20.dll';

function ippiFFTFwd_RToPack_32f_C1R(
pSrc: PSingle;
srcStep: Integer;
pDst: PSingle;
dstStep: Integer;
pFFTSpec: Pointer;
pBuffer: PByte): Integer;
stdcall; external 'ippi20.dll';

function ippiFFTFree_R_32f(pFFTSpec: Pointer): Integer;
stdcall; external 'ippi20.dll';

procedure TForm1.Button1Click(Sender: TObject);
var src, dst: array of Single;
var spec: Pointer;
begin
SetLength(src, 64); FillChar(src[0], 64*SizeOf(Single), 0);
SetLength(dst, 64);
src[0] := -3.0; src[9] := 1.0;
ippiFFTInitAlloc_R_32f(spec, 3, 3, IPP_FFT_DIV_INV_BY_N, ippAlgHintAccurate);
ippiFFTFwd_RToPack_32f_C1R(@src[0], 8*4, @dst[0], 8*4, spec, nil);
ippiFFTFree_R_32f(spec);
dst := nil;
src := nil;
end;

Message Edited by Seiji-Torigoe on 12-28-2004 04:58 PM

0 Kudos
xorvax
Beginner
986 Views
Could you explain me, please,whyyou usethese values:
const IPP_FFT_DIV_FWD_BY_N = 1;
const IPP_FFT_DIV_INV_BY_N = 2;
const IPP_FFT_DIV_BY_SQRTN = 4;
const IPP_FFT_NODIV_BY_ANY = 8; ???
Because it's defined:
Value of flag Argument Normalization Factors
Forward Transform Inverse Transform
IPP_FFT_DIV_FWD_BY_N 1/MN 1
IPP_FFT_DIV_INV_BY_N 1 1/MN
IPP_FFT_DIV_BY_SQRTN 1/sqrt(MN) 1/sqrt(MN)
IPP_FFT_NODIV_BY_ANY 1 1
thanks
0 Kudos
seiji-torigoe
Beginner
986 Views
I'm sorry.
As for fast Fourier transform, I am not familiar.
I only changed the sample of the manual into delphi.
0 Kudos
xorvax
Beginner
986 Views
Where can I find this Delphi manual?
0 Kudos
seiji-torigoe
Beginner
986 Views
???
The manual is "Ippiman.pdf"
The document Number is "A70805-014"
The page is "10-12"
The code is "Example 10-1 Fast Fourier Transform of a Real Image"
I only changed this.
0 Kudos
xorvax
Beginner
986 Views
OK. I thought that there is something another.
0 Kudos
Reply