Inverse Fourier Transform using MATLAB

Click For Summary

Discussion Overview

The discussion revolves around performing an inverse Fourier transform using MATLAB's IFFT function. Participants explore how to specify a function and its parameters within the context of MATLAB, particularly focusing on the transition from continuous to discrete representations.

Discussion Character

  • Technical explanation
  • Exploratory
  • Homework-related

Main Points Raised

  • One participant expresses confusion about how to use MATLAB's IFFT function with a specific function y(iw) and a real value z, questioning how to input these into IFFT(X).
  • Another participant shares a MATLAB code snippet that addresses a similar problem, detailing the steps taken to compute the Fourier transform and its inverse, while also providing commentary on MATLAB's syntax and functions.
  • A participant inquires about plotting multiple figures in separate windows, seeking advice on how to achieve this in MATLAB.
  • Another participant suggests using an external editor to view multiple figures simultaneously, indicating an alternative approach to the problem.
  • A participant references Mathematica's Fourier Transform capabilities, expressing curiosity about the design choices made by MATLAB regarding its IFFT function.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the best approach to using MATLAB's IFFT function, and multiple viewpoints on how to handle the plotting of figures and the use of different software tools are presented.

Contextual Notes

There are unresolved questions regarding the specific implementation details of the inverse Fourier transform in MATLAB, including how to properly define inputs and handle outputs. Additionally, there is a lack of clarity on the best practices for visualizing multiple figures simultaneously.

orstats
Messages
14
Reaction score
0
I would like to do an inverse Fourier transform using MATLAB's IFFT. I am confused by MATLAB'S single input of X for its IFFT function. Has anyone had experience using MATLAB for these tranforms?

I would like to do an inversion of Fourier transform for my function y(iw) at some value real value z. I am confused at how to specify my function y(iw) and z in MATLAB's IFFT(X).

In the continuous setting, the inverse Fourier transform, ift(), would be

ift(z) = 1/2pi * Integral [ e^(-iwz) y(iw) dw ]

In other words, I specify z and specify y, which is only a function of w which I am integrating over. But how do I do this using MATLAB's IFFT, when it only takes an input X...

Does anyone have any recommendations of computationally solving these integrals for vectors of z and known analytical expression of y(iw)?
 
Physics news on Phys.org
HI!

wahoooooooooo, the similar problem took couple days for me couple weeks ago! and i was so frustrated in that time...

Because this is not a physics problem and you are not suppose to think what Matlab designers liked to use as command! i think i am allowed to just copy all my work for you so you can learn the right commands to use ;)

sorry that i don't have time to look cerefully to your problem (i am working on some other Matlab programs! ) but i am sure the below program will help you :

----------------------------------------

% problem set 3
%
% the function f and it's Fourier (inverse Fourier in Matlab) transform with diffrent methods
% wm = w(mn)
% W = w
% T = Life time
% tn= time variable
% f in my funtion

%part a:

tn=[0:0.01:30];
T=1/(0.3);
wm=4;
f=exp((-i.*wm.*tn)-(tn/T));
plot(tn,real(f),tn,imag(f))
%part b
%In this part I had found the Fourier transition analetically myself and i
%will plot the real and imaginary parts separated

T=1/(0.3);
wm=4;
w=[0:0.1:10];

for(i=1:length(w))
%the real part of Fourier transform of f
R(i)=(1/T) /( (2*pi)*(((w(i)-wm)^2)+(1/(T^2))));
%%the imaginary part of Fourier transform of f
I(i)=(1/(2*pi))*((w(i)-wm)/(((w(i)-wm).^2)+(1/(T.^2))));
end

hold
plot(w,R,w,I)
plot(w,abs(R).^2,w,abs(I).^2)%part c
%In this part i have to let MatLab to find the Fourier transformation and
%plot the real and imaginary parts and comper them with the part b which
%was the same problem but it was anatletically. the poin is is can make my
%spacing farther in this part to see the diffrence more, i.e. in case of N=50

N=500;
Tmax=50;
T=1/(0.3);
wm=4;

for (p=1:N)
tn(p)=(Tmax/N)*p;
wk(p)=((2*pi)/Tmax)*p;
f(p)=exp(-j*wm*tn(p)) * exp(-tn(p)/T);
% j is the imajinary element which is mostly defined by i but Matlab
% has problem with i so we wrote j and Matlab jot it! ;)
end

F=ifft(f);
%size(F)
%size(wk)
%plot(tn,real(f))
hold
plot(wk,real(F),wk,imag(F))
plot(wk,abs(real(F)).^2,wk,abs(imag(F)).^2)---------------------------------

good luck! ;)
 
I need to know how can i plot different figures in different windows and have all those windows open separately simultaneously? any idea?
 
It depends on what the aim. If it is simply to view them at once, without using MATLAB, you can simply insert the n figures in n panels in an editor, such as MS Word.
 
Btw, thank you for your sample code. You may also find this offering by Mathematica interesting:

website slash slash
reference.wolfram.com/mathematica/FourierSeries/tutorial/FourierSeries.html

Your expression f() for which you are taking the Fourier transform, you may express as an input for their Fourier Transform function. I wonder what were MATLAB's challenges in conceptualizing and implement this...?
 
cool! well...! i don't know! i have to look for it... ;)
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 0 ·
Replies
0
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K