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

Is complex sineFFT routine ready?

Raemon
Beginner
1,062 Views
Hi,

I am developing a numerical PDE solver which requires sineFFT routines. However, TT routines inside MKL does NOT support sineFFT routine with complex numbers.

However, my problem requires that the numbers must be complex. Real sine FFT routine is not suitable for me.

Is there any complex sineFFT routines I can use or I need to develope one by myself?
0 Kudos
11 Replies
Alexander_K_Intel2
1,062 Views
Quoting - raemon
Hi,

I am developing a numerical PDE solver which requires sineFFT routines. However, TT routines inside MKL does NOT support sineFFT routine with complex numbers.

However, my problem requires that the numbers must be complex. Real sine FFT routine is not suitable for me.

Is there any complex sineFFT routines I can use or I need to develope one by myself?
Hi raemon,
Could you explain how you want to use TT for complex number vector or sharean example of it?In my visionif vector consist of complex number so TT of this vector could be realized by sum of TT real and complex part of initial vector.
With best regards,
Alexander Kalinkin
0 Kudos
Raemon
Beginner
1,062 Views
Hi, Alaxander Kalinkin:

Sorry for asking such a stupid question. You are right. I did not think about that much.

By the way, I need to plot the spectrum after the Forward Sine FFT transformation.
But I don't know how's the arrangement of the frequency in the frequency domain. It seems that it is not like the same arrange method with the normal FFT transformation?

Regards,
Raemon
0 Kudos
Alexander_K_Intel2
1,062 Views
Quoting - raemon
Hi, Alaxander Kalinkin:

Sorry for asking such a stupid question. You are right. I did not think about that much.

By the way, I need to plot the spectrum after the Forward Sine FFT transformation.
But I don't know how's the arrangement of the frequency in the frequency domain. It seems that it is not like the same arrange method with the normal FFT transformation?

Regards,
Raemon
Hi Raemon,
To answer your qeustion more accuratly I need to understand moreaccurately what "normal FFT transformation" mean?
With best regards,
Alexander Kalinkin
0 Kudos
Raemon
Beginner
1,062 Views
Hello Alexander Kalinkin,

For example, if I use fft function inside MKL, I use both sine and cosine as a basis. After the forward or the backward transform, the arrangement of the frequencies and the output data is like this:

http://www.haoli.org/nr/bookf.html
( Numerical Recipes in Fortran on-line resource, CH12.2 Fast Fourier Transform, page502, fig12.2.2(b) )

My question is, is that kind of arrangement also valid when using the Sine FFT (use sine as a basis only) subroutine inside the MKL?
Furthermore, if the function which I'd like to perform the sine FFT transform is not an odd function, is that means I need to double that function to ensure the input function is an odd function?

Sorry for my stupid problems. It seems that these are basic conceptions, since I didn't get these informations in the MKL manual.

Regards,
Raemon
0 Kudos
Alexander_K_Intel2
1,062 Views
Quoting - raemon
Hello Alexander Kalinkin,

For example, if I use fft function inside MKL, I use both sine and cosine as a basis. After the forward or the backward transform, the arrangement of the frequencies and the output data is like this:

http://www.haoli.org/nr/bookf.html
( Numerical Recipes in Fortran on-line resource, CH12.2 Fast Fourier Transform, page502, fig12.2.2(b) )

My question is, is that kind of arrangement also valid when using the Sine FFT (use sine as a basis only) subroutine inside the MKL?
Furthermore, if the function which I'd like to perform the sine FFT transform is not an odd function, is that means I need to double that function to ensure the input function is an odd function?

Sorry for my stupid problems. It seems that these are basic conceptions, since I didn't get these informations in the MKL manual.

Regards,
Raemon

Hi Raemon,
In IntelMKL Reference Manual Chapter 13> TT Routines> Transforms implemented describe more accurately what TT calculate andinput/outputvectors in TT routinesarrange exactly in the same way. Also, as it can see informulasinchapter described below you can use sin TT not only for odd function.
With best regards,
Alexander Kalinkin
0 Kudos
Raemon
Beginner
1,062 Views

Hi Raemon,
In IntelMKL Reference Manual Chapter 13> TT Routines> Transforms implemented describe more accurately what TT calculate andinput/outputvectors in TT routinesarrange exactly in the same way. Also, as it can see informulasinchapter described below you can use sin TT not only for odd function.
With best regards,
Alexander Kalinkin
Hi, Alexander Kalinkin:

Now I realize that MKL does not have the restriction to require one should input an odd function only. But inside the MKL manual I didn't find a figure such as the figure that in the Numerical recipe I mentioned before to let me know how's the arrangement of the data points and the corresponding frequencies.

I've tried to perform a forward transform and then a backward of an input array. The output array is same with the input array. That's right.

But my next step is to perform the forward Sine FFT transform to a given test function (Say, the function is sin(x), in a range[0~2pi] ) and then compare the output array with the analytical solution. Now, I call the transformed function as F(w). My question is, I don't know how to plot F(w) since I do not know the arrangement of the transformed data points and the corresponding frequencies w. Perhaps I need to multiply some factor on w but I do not know what's that.

Regards,
Raemon
0 Kudos
Alexander_K_Intel2
1,062 Views
Quoting - raemon
Hi, Alexander Kalinkin:

Now I realize that MKL does not have the restriction to require one should input an odd function only. But inside the MKL manual I didn't find a figure such as the figure that in the Numerical recipe I mentioned before to let me know how's the arrangement of the data points and the corresponding frequencies.

I've tried to perform a forward transform and then a backward of an input array. The output array is same with the input array. That's right.

But my next step is to perform the forward Sine FFT transform to a given test function (Say, the function is sin(x), in a range[0~2pi] ) and then compare the output array with the analytical solution. Now, I call the transformed function as F(w). My question is, I don't know how to plot F(w) since I do not know the arrangement of the transformed data points and the corresponding frequencies w. Perhaps I need to multiply some factor on w but I do not know what's that.

Regards,
Raemon

Hi Raemon,
In your example your internal vector is second harmonic (the first one is sin(2x)) so if your will used Forward sin transformation from TT you will get vector with zero element butF[2] which will be equal 1. Coefficient of i number harmonic is place in F.
With best regards,
Alexander Kalinkin
0 Kudos
Raemon
Beginner
1,062 Views
Hi, Alexander Kalinkin:
Thanks a lot! Now I know what's going on.

Best Regards,
Raemon
0 Kudos
Alexander_K_Intel2
1,062 Views
Quoting - raemon
Hi, Alexander Kalinkin:
Thanks a lot! Now I know what's going on.

Best Regards,
Raemon
Hi Raemon,
You are welcome! :)
With best regards,
Alexander Kalinkin
0 Kudos
Raemon
Beginner
1,062 Views
Hi raemon,
Could you explain how you want to use TT for complex number vector or sharean example of it?In my visionif vector consist of complex number so TT of this vector could be realized by sum of TT real and complex part of initial vector.
With best regards,
Alexander Kalinkin


Hi, Alexander Kalinkin:

Recently I found that TT routine is much slower than complex FFT function.
Since the array I'd like to transform consists of complex numbers, I have to call TT routines twice to perform the transform for each real and complex part. Compare with complex FFT function, which is only needed once to transform the complex numbers.

And I am confused about why TT routine is much slower. In my view, sine FFT (TT routine) uses sine basis. Complex FFT function uses sine+cosine basis. Apparantly, complex FFT function uses more basis. Isn't that means complex FFT function requires performing much calculations? Why TT routine is slower than complex FFT function?

Best Regards,
Raemon
0 Kudos
Alexander_K_Intel2
1,062 Views
Quoting - raemon


Hi, Alexander Kalinkin:

Recently I found that TT routine is much slower than complex FFT function.
Since the array I'd like to transform consists of complex numbers, I have to call TT routines twice to perform the transform for each real and complex part. Compare with complex FFT function, which is only needed once to transform the complex numbers.

And I am confused about why TT routine is much slower. In my view, sine FFT (TT routine) uses sine basis. Complex FFT function uses sine+cosine basis. Apparantly, complex FFT function uses more basis. Isn't that means complex FFT function requires performing much calculations? Why TT routine is slower than complex FFT function?

Best Regards,
Raemon
Hi Raemon,
TT and complex FFT are different part of MKL so theirperformancecould not calculated by one formula. Also need to say that TT use complex FFT with some pre- andpost-processingso it must be slower than complex FFT with corresponding size of vector.
With best regards,
Alexander Kalinkin
0 Kudos
Reply