How to do Fourier Integrals on the HP Prime? - Printable Version +- HP Forums ( https://www.hpmuseum.org/forum)+-- Forum: HP Calculators (and very old HP Computers) ( /forum-3.html)+--- Forum: HP Prime ( /forum-5.html)+--- Thread: How to do Fourier Integrals on the HP Prime? ( /thread-14126.html) |

How to do Fourier Integrals on the HP Prime? - medwatt - 12-07-2019 10:34 PM
Hello, I want to do Fourier Integrals (not Fourier Series) on the Prime but there doesn't to be a function for that. I'm surprised that a calculator as powerful as the Prime doesn't have a built in function for this when there is one already for Laplace Transforms. The HP 50g can do Fourier Transforms. Is there some app out there that can add this functionality to the Prime ? RE: How to do Fourier Integrals on the HP Prime? - Stevetuc - 12-08-2019 07:02 AM
(12-07-2019 10:34 PM)medwatt Wrote: Hello, I tried this in cas mode Code:
The result on max simplification Code:
Which (I think ) is the deltadirac function and the correct result for fourier transform of 1 (see wolfram screenshots attached) The prime doesnt recognise the above as a deltadirac (although there is a builtin Dirac) It may be helpful to define as a cas substitution to simplify results. I havent tried this yet. Code:
Gives correct result of Code:
[attachment=7894][attachment=7895][attachment=7896] RE: How to do Fourier Integrals on the HP Prime? - Stevetuc - 12-08-2019 08:28 AM
(12-08-2019 07:02 AM)Stevetuc Wrote:(12-07-2019 10:34 PM)medwatt Wrote: Hello, Actually I see there is an e^-itw term missing in the result of my first example compared to wolfram, which may be the reason the cas doesn't recognise the result as a dirac() RE: How to do Fourier Integrals on the HP Prime? - Stevetuc - 12-08-2019 11:40 AM
Here are two methods on the prime to get same result as the fourier integral on page 16_46 of Hp50g AUG Modified laplace transform of e^(-t) Code:
Integral Code:
Both give result Code:
Simplify set to minimum Ive verified that both forms agree for e^(-t)*sin(t) too. [attachment=7898][attachment=7897] RE: How to do Fourier Integrals on the HP Prime? - medwatt - 12-08-2019 03:18 PM
(12-08-2019 11:40 AM)Stevetuc Wrote: Simplify set to minimum Hello. Thanks for your reply. What you're doing is not calculating the Fourier Transform. It is easy to get the Fourier Transform from the Laplace Transform if we restrict our function to just one side of the plane (left-sided or right sided). If a function is left-sided or right-sided then to get the Fourier Transform, you evaluate the Laplace Transform and then substitute s=jw or s=-jw. This is what you seem to be doing. But what about the Fourier Transform of a dc signal which goes from -inf to +inf ? How do you calculate that ? Or how do calculate the FT of e^(j*2*t) ? RE: How to do Fourier Integrals on the HP Prime? - Stevetuc - 12-08-2019 03:30 PM
(12-08-2019 03:18 PM)medwatt Wrote:(12-08-2019 11:40 AM)Stevetuc Wrote: Simplify set to minimum Thanks for your response. I simply followed the Fourier Transform examples in the AUG. You mentioned in your first post that "The HP 50g can do Fourier Transforms". I assume you have 50g code examples that cover the cases you mention above. Can you share them? RE: How to do Fourier Integrals on the HP Prime? - medwatt - 12-08-2019 03:43 PM
(12-08-2019 03:30 PM)Stevetuc Wrote:(12-08-2019 03:18 PM)medwatt Wrote: Hello. Thanks for your reply. What you're doing is not calculating the Fourier Transform. It is easy to get the Fourier Transform from the Laplace Transform if we restrict our function to just one side of the plane (left-sided or right sided). If a function is left-sided or right-sided then to get the Fourier Transform, you evaluate the Laplace Transform and then substitute s=jw or s=-jw. This is what you seem to be doing. But what about the Fourier Transform of a dc signal which goes from -inf to +inf ? How do you calculate that ? Or how do calculate the FT of e^(j*2*t) ? It was actually a mistake. I assumed the 50g can do Fourier Transforms because I saw a function called "Fourier". Apparently, it's just Fourier Series. I find it ironical that the Prime's CAS is based on Giac/Xcas whose website is: https://www-fourier.ujf-grenoble.fr/~parisse/giac.html. The website literally has "Fourier" in it and you would expect that a function for the Fourier Transform is implemented, but it isn't. I can't understand why HP ignores FT. It's super important for people in Electrical Engineering. RE: How to do Fourier Integrals on the HP Prime? - Stevetuc - 12-08-2019 04:28 PM
(12-08-2019 03:43 PM)medwatt Wrote:(12-08-2019 03:30 PM)Stevetuc Wrote: Thanks for your response. I simply followed the Fourier Transform examples in the AUG. You mentioned in your first post that "The HP 50g can do Fourier Transforms". I assume you have 50g code examples that cover the cases you mention above. Can you share them? Agreed. The Laplace Transform on the prime is singlesided, but the integration method I also showed can be used from -inf to +inf Problems arise with evaluating a dc value over this range. It is not integrable as result is infinite. Standard methods multiple with a dirac function to allow integration. https://youtu.be/uQkCar2SbVY Then Code:
Code:
RE: How to do Fourier Integrals on the HP Prime? - Stevetuc - 12-09-2019 12:23 PM
https://www.hpcalc.org/details/9041 Quote:Performs symbolic time to frequency and frequency to time calculations: calculates for a given symbolic f(t) Fourier, Laplace and Z-transformation in symbolic form, draws the complex Laplace function together with the Fourier transformation slice as a 3D plot, and calculates for a given frequency transfer function the unity pulse, dirac pulse response and bode magnitude and phase in symbolic form. Includes PDF documentation. It uses the following to calculate the Fourier transform Code:
RE: How to do Fourier Integrals on the HP Prime? - John Keith - 12-09-2019 04:09 PM
Note that the 50g does have numeric fast Fourier transform and its inverse. I thought the Prime did too but I don't have mine with me. Not sure if that is what you are looking for though. RE: How to do Fourier Integrals on the HP Prime? - medwatt - 12-09-2019 08:22 PM
(12-09-2019 12:23 PM)Stevetuc Wrote: https://www.hpcalc.org/details/9041 This is just evaluating the Laplace Transform at s=jw. The Laplace Transform used on the Prime is the single-sided LT, meaning it evaluates the integral from 0 to inf. You can use this LT to get the FT if you have a function that is right-sided. What happens if you want the FT of functions such as sin(wt), a dc signal, that span the the entire time domain ? Well, it's not possible. RE: How to do Fourier Integrals on the HP Prime? - Stevetuc - 12-09-2019 08:45 PM
(12-09-2019 08:22 PM)medwatt Wrote:(12-09-2019 12:23 PM)Stevetuc Wrote: https://www.hpcalc.org/details/9041 Yes indeed. I shared the above code fragment to make that fact clear! You may have to move back to TI or Casio, assuming you have an app that meets your needs or Wolfram. RE: How to do Fourier Integrals on the HP Prime? - medwatt - 12-09-2019 09:54 PM
(12-09-2019 08:45 PM)Stevetuc Wrote:(12-09-2019 08:22 PM)medwatt Wrote: This is just evaluating the Laplace Transform at s=jw. The Laplace Transform used on the Prime is the single-sided LT, meaning it evaluates the integral from 0 to inf. You can use this LT to get the FT if you have a function that is right-sided. What happens if you want the FT of functions such as sin(wt), a dc signal, that span the the entire time domain ? Well, it's not possible. Thanks, man. I appreciate the effort. There's a package for Laplace Transform for the Ti-89 which I've modified to do the Fourier Transform. The Casio Classpad II can do FT natively but I'm not a fan of it as it is barely has any hardware keys and therefore makes no sense buying it when you can just install any one of the myriad calculator applications on Android. RE: How to do Fourier Integrals on the HP Prime? - Stevetuc - 12-10-2019 09:28 AM
(12-09-2019 09:54 PM)medwatt Wrote:(12-09-2019 08:45 PM)Stevetuc Wrote: Yes indeed. I shared the above code fragment to make that fact clear! I took a look at the classpad app. It has an impressive range of options for the fourier transform, allowing interactive input of the indep var and parameter and different style of formulation such as pure math, physics and signal processing. Results agree with wolfram and it recognises that for a dc signal, or a unit pulse as T/2 -> inf that the sinc function -> deltadirac. [attachment=7908] That isnt possible currently on the prime. If you take the fourier integral of a pulse -T/2 to +T/2 in the limit as T ->inf the result is undefined. Code: `∫(e^(-i*w*t),t,-τ/2,τ/2)` Code: `(i*e^((−i)*w*τ/2)+(−i)*e^(i*w*τ/2))/w` I also looked at ti89 function lapl.89f. https://www.ticalc.org/archives/files/fileinfo/442/44290.html It looks pretty basic (nopun). Code:
RE: How to do Fourier Integrals on the HP Prime? - Simone Cerica - 12-10-2019 09:40 AM
(12-09-2019 04:09 PM)John Keith Wrote: Note that the 50g does have numeric fast Fourier transform and its inverse. I thought the Prime did too but I don't have mine with me. I am Italian and my English is poor, but I never understood why English native speakers sometimes confuse the various types of Fourier transform! @medwatt refers unequivocally to the "continuous-time fourier transform", also called "Fourier integral" or more simply "Fourier transform": https://en.wikipedia.org/wiki/Continuous_Fourier_transform = https://en.wikipedia.org/wiki/Fourier_integral = https://en.wikipedia.org/wiki/Fourier_transform fourier transform wolfram alpha Unfortunately both the HP 50g and the HP Prime implement the classic Fourier series (fourier_an, fourier_bn, fourier_cn) and discrete fourier transform (DFT) (fft, ifft) but not the continuous-time Fourier transform. Regards, Simone |