Developer Reference

  • 2020
  • 07/15/2020
  • Public Content
Contents

Goertz

Computes the discrete Fourier transform for a given frequency for a single signal.

Syntax

IppStatus ippsGoertz_32f(const Ipp32f*
pSrc
, int
len
, Ipp32fc*
pVal
, Ipp32f
rFreq
);
IppStatus ippsGoertz_64f(const Ipp64f*
pSrc
, int
len
, Ipp64fc*
pVal
, Ipp64f
rFreq
);
IppStatus ippsGoertz_32fc(const Ipp32fc*
pSrc
, int
len
, Ipp32fc*
pVal
, Ipp32f
rFreq
);
IppStatus ippsGoertz_64fc(const Ipp64fc*
pSrc
, int
len
, Ipp64fc*
pVal
, Ipp64f
rFreq
);
IppStatus ippsGoertz_16s_Sfs(const Ipp16s*
pSrc
, int
len
, Ipp16sc*
pVal
, Ipp32f
rFreq
, int
scaleFactor
);
IppStatus ippsGoertz_16sc_Sfs(const Ipp16sc*
pSrc
, int
len
, Ipp16sc*
pVal
, Ipp32f
rFreq
, int
scaleFactor
);
Include Files
ipps.h
Domain Dependencies
Headers:
ippcore.h
,
ippvm.h
Libraries:
ippcore.lib
,
ippvm.lib
Parameters
pSrc
Pointer to the input data vector.
len
Number of elements in the vector.
pVal
Pointer to the output DFT value.
rFreq
Single relative frequency value [0, 1.0).
scaleFactor
Scale factor, refer to Integer Scaling.
Description
This function computes a DFT for an input
len
-length vector
pSrc
for a given frequency
rFreq
, and stores the result in
pVal
.
ippsGoertzQ15
. This function operates with relative frequency in Q15 format. Data in Q15 format are converted to the corresponding float data type that lay in the range [0, 1.0).
The functionality of the Goertzel algorithm can be described as follows:
where
k
/
N
is the normalized
rFreq
value for which the DFT is computed.
Return Values
ippStsNoErr
Indicates no error.
ippStsNullPtrErr
Indicates an error when one of the specified pointers is
NULL
.
ippStsRelFreqErr
Indicates an error when
rFreq
is out of range.
ippStsSizeErr
Indicates an error when
len
is less than or equal to 0.

Example

The example below illustrates the use of Goertzel functions for selecting the magnitudes of a given frequency when computing DFTs.
IppStatus goertzel( void ) { #undef LEN #define LEN 100 IppStatus status; Ipp32fc *x = ippsMalloc_32fc( LEN ), y; int n; ///generate a signal of 60 Hz freq that /// is sampled with 400 Hz freq for( n=0; n<LEN; ++n) { x[n].re =(Ipp32f)sin(IPP_2PI * n * 60 / 400); x[n].im = 0; } status = ippsGoertz_32fc( x, LEN, &y, 60.0f / 400 ); printf_32fc("goertz =", &y, 1, status ); ippsFree( x ); return status; }
Output:
goertz = {0.000090,-50.000008} Matlab* Analog >> N=100;F=60/400;n=0:N-1;x=sin(2*pi*n*F);y=fft(x);n=N*F;y(n+1)

Product and Performance Information

1

Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804