Inverse Fourier Transform using MATLAB

In summary, MATLAB's IFFT takes a single input of X which is the signal to be transformed. You must first express your function y(iw) in terms of w and z. You then must integrate over w to get the inverse Fourier transform.
  • #1
orstats
14
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
  • #2
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 seperated

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! ;)
 
  • #3
I need to know how can i plot different figures in different windows and have all those windows open separately simultaneously? any idea?
 
  • #4
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.
 
  • #5
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...?
 
  • #6
cool! well...! i don't know! i have to look for it... ;)
 

Related to Inverse Fourier Transform using MATLAB

What is the inverse Fourier Transform and why is it important?

The inverse Fourier Transform is a mathematical operation that converts a signal from the frequency domain to the time domain. It is important because it allows us to analyze signals in both the time and frequency domains, providing valuable information about the characteristics and behavior of the signal.

How is the inverse Fourier Transform calculated using MATLAB?

In MATLAB, the inverse Fourier Transform is calculated using the ifft function. This function takes in the Fourier coefficients of the signal and returns the signal in the time domain.

What is the difference between the inverse Fourier Transform and the Fourier Transform?

The Fourier Transform converts a signal from the time domain to the frequency domain, while the inverse Fourier Transform does the opposite. In other words, the Fourier Transform breaks down a signal into its individual frequency components, whereas the inverse Fourier Transform combines these components back into the original signal.

What are some common applications of the inverse Fourier Transform?

The inverse Fourier Transform has many applications in fields such as signal processing, image and audio processing, and data analysis. It is used to restore distorted signals, remove noise from signals, and extract useful information from signals.

What are some tips for using the inverse Fourier Transform in MATLAB effectively?

Some tips for using the inverse Fourier Transform in MATLAB include understanding the properties of the transform, using appropriate sampling and windowing techniques, and visualizing the results to gain insights about the signal. It is also important to have a good understanding of the underlying mathematics and to carefully select the appropriate parameters for the ifft function.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
10
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
8
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • Calculus and Beyond Homework Help
Replies
6
Views
2K
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
7
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
765
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
863
Back
Top