Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

Cross Power Spectral Density

JohnNichols
Valued Contributor III
1,562 Views

Has anyone seen a code for the Cross Power Spectral Density Function -- it exists in MATLAB, but I would rather not use MATLAB for obvious reasons.

John

0 Kudos
10 Replies
Zhen_Z_Intel
Employee
1,562 Views

Hi John,

I am afraid there's no direct function call for Cross Power Spectral Density, however its actually the Fourier transform of cross-correlation. Intel IPP provides both cross-correlation & FFT function, you could use "CrossCorrNorm" + FFTFwd.

Best regards,
Fiona

0 Kudos
JohnNichols
Valued Contributor III
1,562 Views

Thank you --- that is simple. 

0 Kudos
JohnNichols
Valued Contributor III
1,562 Views

So as I read the literature I cannot call IPP from Fortran 

I have to use C++

John

0 Kudos
Zhen_Z_Intel
Employee
1,562 Views

Hi Nichols,

MKL also provides interface for convolution/correlation, although we do not provide a direct call for cross-correlation, however you probably could derive formula to use convolution. You could refer vslConvExec and MKL FFT functions. Thanks.

Best regards,
Fiona

0 Kudos
JohnNichols
Valued Contributor III
1,562 Views

Dear Fiona:

Thanks.  That is not hard. Capture.PNG

 

Thanks. 

 

0 Kudos
JohnNichols
Valued Contributor III
1,562 Views

Dear Fiona:

So I installed the IPP from 2017.  I thought it was included in the Parallel Studio but it is not that I could see.

I ran the ippvars and set the VC++ directories in a VS 2017 C++ shell program. The sample is attached.

When I in it -- I get the following compile errors  - I am a bit lost at this stage. This is the standard sample program on your IPP website

thanks

John

Capture.PNG

0 Kudos
Gennady_F_Intel
Moderator
1,562 Views

you need to link with ipps.lib ippcore.lib and libiomp5md.lib. Please have a look at the IPP User's Guide to see the details of "Linking Your Application with Intel® Integrated Performance Primitive" or "How to "Automatically Linking Your Microsoft* Visual Studio* Project with Intel IPP"

0 Kudos
JohnNichols
Valued Contributor III
1,562 Views

https://software.intel.com/en-us/node/503902

Is one example of the IPP sample code, but you have another on your website does not point to the linker options it repoints to the vcc++ directory requirments -- it had me fooled for several hours

I cannot find it again - tha above one is correct -- but the other is not

 

0 Kudos
JohnNichols
Valued Contributor III
1,562 Views

I have it all almost compiling, but INTEL documentation uses a function print_32f that is not documented.  I realize it is easy to fix, but you have it all through the pdf files,, a sample would save 20 minutes of heartache.

Ta

john

0 Kudos
JohnNichols
Valued Contributor III
1,562 Views
IppStatus printf_32f(char* name, Ipp32f a[16], int b)
{
 printf("    %s \n",name);
 int i;
 for (i = 0; i < 16; i++) {
  printf("%lf\n", a);
 }
  printf("\n");
 return 0;
}

 

0 Kudos
Reply