Hi! I need some high precision computations, so I use the function vpa() with about 32 digits. My final result is obtained by making ifft(x, 'symmetric'). The problem is that I need to transform x to double again, loosing my required precision. Is there any way to overcome this? I think the only way is to make my own ifft function, I am correct? Thanks!

2 comentarios

Paul
Paul el 24 de En. de 2022
I'm pretty sure that you are correct that you will have to roll your own, symbolic, ifft() function. Is the symbolic array x all high precision numbers? Or are the elements of x symbolic expressions?
Demian Augusto Vera
Demian Augusto Vera el 25 de En. de 2022
Thanks for your answer, Paul. The symbolic array x is just a high-precision complex array of numers; no symbolic expression involved.

Iniciar sesión para comentar.

 Respuesta aceptada

Star Strider
Star Strider el 24 de En. de 2022

1 voto

Since it appears that these calculations are all symbolic, one option would be the ifourier function, or if you are using your own Fourier transform integration code, simply reversing the sign of the argument of the exponent will produce the inverse transform with essentially the same code, although with a different variable of integration (ω rather than t).
That way, everything remains symbolic, with the desired precision.

4 comentarios

Demian Augusto Vera
Demian Augusto Vera el 25 de En. de 2022
Thanks! I'm trying now to adapt ifourier to the "symmetric" symflag of ifourier. Thanks again for your answer.
Star Strider
Star Strider el 25 de En. de 2022
My pleasure!
The 'symmetric' flag refers to the result being conjugate symmetric as discussed in Algorithms, however subscript references do not always work the same way with symbolic vectors as with numeric vectors. I am not certain what you are doing, so I cannot offer specific help with it.
One approach might be to integrate symmetrically so that the inverse transform is integrated from a negative angle to the same value positive angle. That is possible using int because it offers that option. I am not certain that ifourier offers the same option.
Demian Augusto Vera
Demian Augusto Vera el 25 de En. de 2022
Thanks, Star. Yes, I'll have to make my own ifft function. Thanks for your help!
Star Strider
Star Strider el 25 de En. de 2022
As always, my pleasure!

Iniciar sesión para comentar.

Más respuestas (1)

Paul
Paul el 25 de En. de 2022
Editada: Paul el 25 de En. de 2022

1 voto

Given that x is an array of high precision numbers, not symbolic expressions, it should be straightforward to implement the ifft sum. It might not be efficient and it might be slow, but it should work. The one thing I'm not sure about is how well this will work to ensure that the time domain sequence, X[n], is real, which I think is the expectation based on the symmetric flag in the call to numerical ifft. If the result does have a small imaginary part, it can always be removed I suppose, but I don't know what that indicates about precision of the solution you're trying to obtain. OTOH, I'm curious if you are ensuring that the sequence x is exactly conjugate symmetric in the first place, to whatever precision you're using. Or the ifft sum can be implemented assuming x is conjugate symmetric.

1 comentario

Demian Augusto Vera
Demian Augusto Vera el 25 de En. de 2022
Thanks, Paul. The theory indicates that it is conjugate symmetric. Using double precision that's ensured, as I can see. Don't know if using high-precision arithmetic it remains conjugate symmetric, but I think it has to.
Thanks again for your help answers.

Iniciar sesión para comentar.

Productos

Versión

R2021a

Preguntada:

el 24 de En. de 2022

Comentada:

el 25 de En. de 2022

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by