Fourier Transforms in Maple
Fourier transforms in Maple can be categorized as either transforms on expressions or transforms on signal data.
To compute the Fourier transform of an expression, use the inttrans[fourier] command. For more details on this command, see the inttrans[fourier] help page.
To compute the Fourier transform of signal data, the following commands are available:
SignalProcessing[DFT] : This command computes the discrete Fourier transform of an Array of signal data points. The SignalProcessing[DFT] command works for any size Array. For more information, see SignalProcessing[DFT].
SignalProcessing[FFT] : Similar to the SignalProcessing[DFT] command, SignalProcessing[FFT] computes the discrete Fourier transform of an Array of signal data points. The difference between the two commands is that the SignalProcessing[FFT] command uses the fast Fourier transform algorithm. Note: SignalProcessing[FFT] requires that the size of the Array must be a power of 2, greater than 2. If the Array passed to SignalProcessing[FFT] does not meet this requirement, the SignalProcessing[DFT] command is used instead. Similarly, SignalProcessing[InverseFFT] calls SignalProcessing[InverseDFT] when the passed Array does not meet this requirement. For more information, see SignalProcessing[FFT].
DiscreteTransforms[FourierTransform] : The DiscreteTransforms[FourierTransform] provides similar functionality to that of SignalProcessing[DFT]. There are some options available in DiscreteTransforms[FourierTransform], such as padding, that are not available in SignalProcessing[DFT]. For more information, see DiscreteTransforms[FourierTransform].
Note: Typically, SignalProcessing[DFT] and SignalProcessing[FFT] are slightly more efficient than DiscreteTransforms[FourierTransform].
The table below provides a summarized comparison of the discrete Fourier transform commands mentioned above.
Feature
SignalProcessing[FFT]
SignalProcessing[DFT]
DiscreteTransforms[Fourier Transform]
input single rtable
yes
input two rtables (Re/Im)
higher-dimensional transforms
specify single dim for higher-dimensional transforms
no
output single rtable
output two rtables (Re/Im)
padding
apply transform only to initial segment
in place
specify output rtable
specify working storage
size of Array: power of 2
size of Array: other
yes (dispatch to DFT)
Examples
signal≔sin⁡t⁢exp⁡−t2100
signal≔sin⁡t⁢ⅇ−t2100
plot⁡signal,t=−30..30
transform≔inttransfourier⁡signal,t,s
transform≔−10⁢I⁢π⁢sinh⁡50⁢s⁢ⅇ−25⁢s2−25
The transform is purely imaginary:
evalc⁡ℜ⁡transform
0
This is what the imaginary part looks like:
plot⁡ℑ⁡transform,s=−3..3
inttransinvfourier⁡transform,s,t
sin⁡t⁢ⅇ−t2100
Turn the original signal into data by sampling:
data≔Array⁡1..80,i↦evalf⁡eval⁡signal,t=i4
data≔0.24724938010.47822847170.67781530550.83309820860.93427197660.97530195720.95430813820.87364336480.73966368500.56221254990.35386226640.1289739763−0.09734987013−0.3103399929−0.4965810793−0.6449045459−0.7470908727−0.7983356335−0.7974529355−0.7468109761−0.6520150601−0.5213720678−0.3651855797−0.1949415782−0.022450180910.14099098560.28535114790.40248733100.48659369320.53445627630.54550633520.52168110810.46711493210.38769495350.29052361920.18333423240.07390606951−0.03047787547−0.1234939721−0.2001341823−0.2569380786−0.2920941320−0.3054141956−0.2981943590−0.2729827805−0.2332802508−0.1832019433−0.1271290188−0.06937673750−0.013901824910.035933436080.077529021630.10914187910.12990859750.13980243880.13953538790.13041883460.11419805690.092875876680.068539834120.043205216640.01868354009−0.003517056003−0.02225629117−0.03679098198−0.04677160933−0.05221092953−0.05343083141−0.05099444295−0.04563063549−0.03815763932−0.02941158576−0.02018456742−0.01117540149−0.0029548328050.0040544553260.0095838452110.013512570590.015851709610.01672117554
SignalProcessing:-SignalPlot⁡data
tdata≔SignalProcessing:-DFT⁡data
tdata≔0.449765990214555+0.⁢I0.505210797657416+0.0390663687494100⁢I0.871158772341445+0.0744865266272709⁢I1.11827605677666−1.60320578988416⁢I−0.833974901255164−0.664082006094420⁢I−0.315964580561808−0.123878845533608⁢I−0.166630985580569−0.0788471078261399⁢I−0.105352012138145−0.0595621316126666⁢I−0.0724092958555620−0.0482794303311701⁢I−0.0522288158121224−0.0407062195325426⁢I−0.0388242915684034−0.0351920466279138⁢I−0.0294082117174462−0.0309536152571132⁢I−0.0225148313113225−0.0275667649429405⁢I−0.0173047300967625−0.0247798253438997⁢I−0.0132655064949832−0.0224330666732571⁢I−0.0100684268175711−0.0204197230546756⁢I−0.00749398324012806−0.0186654357259765⁢I−0.00539069323582706−0.0171166540582818⁢I−0.00365108985686116−0.0157337252108298⁢I−0.00219711705216668−0.0144865880008114⁢I−0.000970919849976031−0.0133519876984611⁢I0.0000711465796272747−0.0123116147660412⁢I0.000962519122718898−0.0113508269453421⁢I0.00172916454491457−0.0104577505722189⁢I0.00239149118681304−0.00962263465913052⁢I0.00296570883192298−0.00883737750161765⁢I0.00346481191751634−0.00809517494757373⁢I0.00389930099312579−0.00739025361514114⁢I0.00427771919553845−0.00671766684027044⁢I0.00460705573117073−0.00607313531064888⁢I0.00489305257703095−0.00545292250998158⁢I0.00514043989624955−0.00485373469997701⁢I0.00535311762499700−0.00427264091457455⁢I0.00553429690919023−0.00370700693220772⁢I0.00568661018298807−0.00315444171561106⁢I0.00581219727669599−0.00261275145103020⁢I0.00591277217762966−0.00207990135986910⁢I0.00598967510525535−0.00155398186211123⁢I0.00604391080315031−0.00103318002042891⁢I0.00607617818568547−0.000515752070609053⁢I0.00608688863272777−7.75791922889773×10−18⁢I0.00607617818568548+0.000515752070609030⁢I0.00604391080315033+0.00103318002042890⁢I0.00598967510525537+0.00155398186211121⁢I0.00591277217762971+0.00207990135986899⁢I0.00581219727669578+0.00261275145103019⁢I0.00568661018298803+0.00315444171561109⁢I0.00553429690919016+0.00370700693220771⁢I0.00535311762499700+0.00427264091457455⁢I0.00514043989624961+0.00485373469997699⁢I0.00489305257703101+0.00545292250998158⁢I0.00460705573117094+0.00607313531064867⁢I0.00427771919553838+0.00671766684027042⁢I0.00389930099312576+0.00739025361514109⁢I0.00346481191751632+0.00809517494757372⁢I0.00296570883192299+0.00883737750161764⁢I0.00239149118681302+0.00962263465913052⁢I0.00172916454491458+0.0104577505722189⁢I0.000962519122718887+0.0113508269453421⁢I0.0000711465796273081+0.0123116147660412⁢I−0.000970919849976022+0.0133519876984611⁢I−0.00219711705216667+0.0144865880008114⁢I−0.00365108985686119+0.0157337252108298⁢I−0.00539069323582699+0.0171166540582817⁢I−0.00749398324012806+0.0186654357259765⁢I−0.0100684268175711+0.0204197230546757⁢I−0.0132655064949831+0.0224330666732570⁢I−0.0173047300967625+0.0247798253438997⁢I−0.0225148313113226+0.0275667649429405⁢I−0.0294082117174462+0.0309536152571133⁢I−0.0388242915684034+0.0351920466279138⁢I−0.0522288158121224+0.0407062195325426⁢I−0.0724092958555620+0.0482794303311701⁢I−0.105352012138145+0.0595621316126666⁢I−0.166630985580569+0.0788471078261399⁢I−0.315964580561808+0.123878845533608⁢I−0.833974901255164+0.664082006094420⁢I1.11827605677666+1.60320578988416⁢I0.871158772341445−0.0744865266272709⁢I0.505210797657416−0.0390663687494100⁢I
The following calls the FFT command, which in turn calls the DFT command (since the size of the data is not a power of 2):
tdata2≔SignalProcessing:-FFT⁡data
tdata2≔0.449765990214555+0.⁢I0.505210797657416+0.0390663687494100⁢I0.871158772341445+0.0744865266272709⁢I1.11827605677666−1.60320578988416⁢I−0.833974901255164−0.664082006094420⁢I−0.315964580561808−0.123878845533608⁢I−0.166630985580569−0.0788471078261399⁢I−0.105352012138145−0.0595621316126666⁢I−0.0724092958555620−0.0482794303311701⁢I−0.0522288158121224−0.0407062195325426⁢I−0.0388242915684034−0.0351920466279138⁢I−0.0294082117174462−0.0309536152571132⁢I−0.0225148313113225−0.0275667649429405⁢I−0.0173047300967625−0.0247798253438997⁢I−0.0132655064949832−0.0224330666732571⁢I−0.0100684268175711−0.0204197230546756⁢I−0.00749398324012806−0.0186654357259765⁢I−0.00539069323582706−0.0171166540582818⁢I−0.00365108985686116−0.0157337252108298⁢I−0.00219711705216668−0.0144865880008114⁢I−0.000970919849976031−0.0133519876984611⁢I0.0000711465796272747−0.0123116147660412⁢I0.000962519122718898−0.0113508269453421⁢I0.00172916454491457−0.0104577505722189⁢I0.00239149118681304−0.00962263465913052⁢I0.00296570883192298−0.00883737750161765⁢I0.00346481191751634−0.00809517494757373⁢I0.00389930099312579−0.00739025361514114⁢I0.00427771919553845−0.00671766684027044⁢I0.00460705573117073−0.00607313531064888⁢I0.00489305257703095−0.00545292250998158⁢I0.00514043989624955−0.00485373469997701⁢I0.00535311762499700−0.00427264091457455⁢I0.00553429690919023−0.00370700693220772⁢I0.00568661018298807−0.00315444171561106⁢I0.00581219727669599−0.00261275145103020⁢I0.00591277217762966−0.00207990135986910⁢I0.00598967510525535−0.00155398186211123⁢I0.00604391080315031−0.00103318002042891⁢I0.00607617818568547−0.000515752070609053⁢I0.00608688863272777−7.75791922889773×10−18⁢I0.00607617818568548+0.000515752070609030⁢I0.00604391080315033+0.00103318002042890⁢I0.00598967510525537+0.00155398186211121⁢I0.00591277217762971+0.00207990135986899⁢I0.00581219727669578+0.00261275145103019⁢I0.00568661018298803+0.00315444171561109⁢I0.00553429690919016+0.00370700693220771⁢I0.00535311762499700+0.00427264091457455⁢I0.00514043989624961+0.00485373469997699⁢I0.00489305257703101+0.00545292250998158⁢I0.00460705573117094+0.00607313531064867⁢I0.00427771919553838+0.00671766684027042⁢I0.00389930099312576+0.00739025361514109⁢I0.00346481191751632+0.00809517494757372⁢I0.00296570883192299+0.00883737750161764⁢I0.00239149118681302+0.00962263465913052⁢I0.00172916454491458+0.0104577505722189⁢I0.000962519122718887+0.0113508269453421⁢I0.0000711465796273081+0.0123116147660412⁢I−0.000970919849976022+0.0133519876984611⁢I−0.00219711705216667+0.0144865880008114⁢I−0.00365108985686119+0.0157337252108298⁢I−0.00539069323582699+0.0171166540582817⁢I−0.00749398324012806+0.0186654357259765⁢I−0.0100684268175711+0.0204197230546757⁢I−0.0132655064949831+0.0224330666732570⁢I−0.0173047300967625+0.0247798253438997⁢I−0.0225148313113226+0.0275667649429405⁢I−0.0294082117174462+0.0309536152571133⁢I−0.0388242915684034+0.0351920466279138⁢I−0.0522288158121224+0.0407062195325426⁢I−0.0724092958555620+0.0482794303311701⁢I−0.105352012138145+0.0595621316126666⁢I−0.166630985580569+0.0788471078261399⁢I−0.315964580561808+0.123878845533608⁢I−0.833974901255164+0.664082006094420⁢I1.11827605677666+1.60320578988416⁢I0.871158772341445−0.0744865266272709⁢I0.505210797657416−0.0390663687494100⁢I
tdata and tdata2 are the same, up to tiny float inaccuracies:
verify⁡tdata,tdata2,Array⁡float⁡10,test=2
true
tdata3≔DiscreteTransforms:-FourierTransform⁡data
tdata3≔0.449765990214555+0.⁢I0.505210797657416+0.0390663687494100⁢I0.871158772341445+0.0744865266272709⁢I1.11827605677666−1.60320578988416⁢I−0.833974901255164−0.664082006094420⁢I−0.315964580561808−0.123878845533608⁢I−0.166630985580569−0.0788471078261399⁢I−0.105352012138145−0.0595621316126666⁢I−0.0724092958555620−0.0482794303311701⁢I−0.0522288158121224−0.0407062195325426⁢I−0.0388242915684034−0.0351920466279138⁢I−0.0294082117174461−0.0309536152571132⁢I−0.0225148313113225−0.0275667649429405⁢I−0.0173047300967625−0.0247798253438998⁢I−0.0132655064949832−0.0224330666732571⁢I−0.0100684268175711−0.0204197230546756⁢I−0.00749398324012806−0.0186654357259765⁢I−0.00539069323582706−0.0171166540582817⁢I−0.00365108985686117−0.0157337252108298⁢I−0.00219711705216673−0.0144865880008114⁢I−0.000970919849975982−0.0133519876984611⁢I0.0000711465796273399−0.0123116147660412⁢I0.000962519122718908−0.0113508269453421⁢I0.00172916454491455−0.0104577505722189⁢I0.00239149118681304−0.00962263465913052⁢I0.00296570883192299−0.00883737750161767⁢I0.00346481191751632−0.00809517494757373⁢I0.00389930099312586−0.00739025361514106⁢I0.00427771919553855−0.00671766684027049⁢I0.00460705573117093−0.00607313531064888⁢I0.00489305257703100−0.00545292250998161⁢I0.00514043989624960−0.00485373469997705⁢I0.00535311762499700−0.00427264091457455⁢I0.00553429690919028−0.00370700693220770⁢I0.00568661018298809−0.00315444171561108⁢I0.00581219727669591−0.00261275145103011⁢I0.00591277217762964−0.00207990135986909⁢I0.00598967510525535−0.00155398186211123⁢I0.00604391080315030−0.00103318002042890⁢I0.00607617818568545−0.000515752070608990⁢I0.00608688863272777−7.75791922889773×10−18⁢I0.00607617818568547+0.000515752070609055⁢I0.00604391080315032+0.00103318002042891⁢I0.00598967510525534+0.00155398186211128⁢I0.00591277217762972+0.00207990135986902⁢I0.00581219727669581+0.00261275145103011⁢I0.00568661018298806+0.00315444171561106⁢I0.00553429690919015+0.00370700693220769⁢I0.00535311762499700+0.00427264091457455⁢I0.00514043989624960+0.00485373469997699⁢I0.00489305257703106+0.00545292250998159⁢I0.00460705573117092+0.00607313531064873⁢I0.00427771919553838+0.00671766684027043⁢I0.00389930099312571+0.00739025361514111⁢I0.00346481191751630+0.00809517494757374⁢I0.00296570883192298+0.00883737750161764⁢I0.00239149118681302+0.00962263465913053⁢I0.00172916454491457+0.0104577505722189⁢I0.000962519122718887+0.0113508269453421⁢I0.0000711465796272033+0.0123116147660412⁢I−0.000970919849976014+0.0133519876984611⁢I−0.00219711705216666+0.0144865880008114⁢I−0.00365108985686119+0.0157337252108297⁢I−0.00539069323582697+0.0171166540582817⁢I−0.00749398324012806+0.0186654357259765⁢I−0.0100684268175711+0.0204197230546756⁢I−0.0132655064949831+0.0224330666732571⁢I−0.0173047300967624+0.0247798253438996⁢I−0.0225148313113226+0.0275667649429405⁢I−0.0294082117174463+0.0309536152571133⁢I−0.0388242915684034+0.0351920466279138⁢I−0.0522288158121224+0.0407062195325426⁢I−0.0724092958555620+0.0482794303311701⁢I−0.105352012138145+0.0595621316126666⁢I−0.166630985580569+0.0788471078261399⁢I−0.315964580561808+0.123878845533608⁢I−0.833974901255164+0.664082006094420⁢I1.11827605677666+1.60320578988416⁢I0.871158772341445−0.0744865266272709⁢I0.505210797657416−0.0390663687494100⁢I
Moreover, tdata and tdata3 are the same, up to tiny float inaccuracies:
verify⁡tdata,tdata3,Array⁡float⁡10,test=2
SignalProcessing:-SignalPlot⁡`~`ℜ⁡tdata,`~`ℑ⁡tdata%T,compactplot
original≔SignalProcessing:-InverseFFT⁡tdata
original≔0.247249380100000−5.78880680703867×10−17⁢I0.478228471700000−4.63068439595559×10−18⁢I0.677815305500000−8.81319038029480×10−17⁢I0.833098208600000−6.51485433272886×10−17⁢I0.934271976600000−3.84932699981424×10−17⁢I0.975301957200000−4.37216581496386×10−17⁢I0.954308138200000−1.07137246075397×10−16⁢I0.873643364800000+1.14626313118273×10−17⁢I0.739663685000000+7.27845345235421×10−18⁢I0.562212549900000−4.18686966946647×10−17⁢I0.353862266400000+8.63971803269712×10−17⁢I0.128973976300000−3.10136987201386×10−17⁢I−0.0973498701300000+3.59827545992758×10−17⁢I−0.310339992900000+1.05230391045198×10−16⁢I−0.496581079300000−3.11368558291799×10−17⁢I−0.644904545900000+4.24943082274182×10−17⁢I−0.747090872700000+3.35757149293384×10−17⁢I−0.798335633500000+1.32391157403481×10−18⁢I−0.797452935500000+5.24990660756959×10−17⁢I−0.746810976100000+1.88718509342198×10−17⁢I−0.652015060100000−4.10772041263443×10−17⁢I−0.521372067800000+5.06354772202176×10−17⁢I−0.365185579700000−2.63851053291697×10−17⁢I−0.194941578200000−5.03499439915058×10−17⁢I−0.0224501809100001+4.52079327377909×10−17⁢I0.140990985600000−3.27249742329407×10−17⁢I0.285351147900000+3.90748907061433×10−17⁢I0.402487331000000+8.46953348541619×10−18⁢I0.486593693200000+9.69808292010440×10−18⁢I0.534456276300000−8.93242509300831×10−17⁢I0.545506335200000−2.17628287184369×10−19⁢I0.521681108100000+2.64823837857832×10−17⁢I0.467114932100000+7.21282754100757×10−17⁢I0.387694953500000+8.14606194735691×10−17⁢I0.290523619200000−3.30222440706408×10−17⁢I0.183334232400000+1.30397865400380×10−16⁢I0.0739060695099999−2.50432650283726×10−17⁢I−0.0304778754700000+1.14628954005974×10−16⁢I−0.123493972100000+3.96110987542138×10−17⁢I−0.200134182300000+5.88899487371556×10−18⁢I−0.256938078600000+2.37401753883706×10−17⁢I−0.292094132000000+2.45784344714926×10−17⁢I−0.305414195600000−1.81901620001576×10−17⁢I−0.298194359000000−5.77214813938006×10−18⁢I−0.272982780500000+2.58404501063965×10−18⁢I−0.233280250800000+3.26188112107199×10−18⁢I−0.183201943300000+4.96078486908024×10−17⁢I−0.127129018800000−1.29030009412563×10−16⁢I−0.0693767375000000−1.88682391650801×10−17⁢I−0.0139018249099999−4.58125235420749×10−17⁢I0.0359334360800001−4.03182288885964×10−17⁢I0.0775290216300001−1.02260466177041×10−16⁢I0.109141879100000−9.03005370913936×10−17⁢I0.129908597500000−1.03437407935536×10−16⁢I0.139802438800000−5.48301125806298×10−17⁢I0.139535387900000+1.70362677499389×10−17⁢I0.130418834600000−8.18483088226964×10−17⁢I0.114198056900000−4.62524740296401×10−17⁢I0.0928758766799999+5.42014083355333×10−18⁢I0.0685398341199999−1.13457845774918×10−17⁢I0.0432052166399999+2.44719994645066×10−17⁢I0.0186835400899998−4.76067169553276×10−17⁢I−0.00351705600300002−4.90874179457507×10−18⁢I−0.0222562911700000+2.37790804659256×10−17⁢I−0.0367909819799999−8.07125429997171×10−18⁢I−0.0467716093300000+6.56860874183047×10−18⁢I−0.0522109295300000+4.06939146588404×10−17⁢I−0.0534308314099998+6.47766995203774×10−17⁢I−0.0509944429499998+6.45112800847227×10−17⁢I−0.0456306354900000+1.20150628640086×10−16⁢I−0.0381576393200000+3.19827732144755×10−17⁢I−0.0294115857600001+7.32752066151604×10−17⁢I−0.0201845674199999−2.00493393252301×10−17⁢I−0.0111754014900000+1.10509346747932×10−17⁢I−0.00295483280499995+2.44829210702320×10−17⁢I0.00405445532599999−5.33430418179169×10−17⁢I0.00958384521100003+4.51135371706707×10−17⁢I0.0135125705899999−6.60428873666882×10−17⁢I0.0158517096100000+1.71611595677828×10−17⁢I0.0167211755399999+6.25557165769816×10−17⁢I
verify⁡data,original,Array⁡float⁡10,test=2
See Also
FourierTransform,efficiency
Overview of the inttrans Package
Overview of the SignalProcessing Package
Download Help Document