Finding an integer with matlab fft function

Click For Summary

Discussion Overview

The discussion revolves around a homework problem involving the use of the Fast Fourier Transform (FFT) in MATLAB to evaluate an integral of the function x^2*exp(-x^2) over the range from negative to positive infinity. Participants seek clarification on the problem's requirements and the role of FFT in solving it.

Discussion Character

  • Homework-related
  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant expresses confusion over the phrase "obtain the value of the following integer," prompting requests for clarification on the problem statement.
  • Another participant suggests that the problem likely refers to evaluating an integral, as indicated by the presence of "dx" in the function.
  • A participant clarifies that the task involves writing a program to find the integral using FFT, although they admit uncertainty about how to implement it.
  • One participant proposes that the integral could be evaluated using integration by parts, questioning the necessity of MATLAB in this context.
  • A later reply shares a MATLAB code snippet provided by the teacher, indicating that it is a method to calculate the integral using FFT, but the participant still expresses confusion about the process.

Areas of Agreement / Disagreement

Participants generally agree that the problem involves evaluating an integral, but there is disagreement regarding the relevance and application of FFT in this context. The discussion remains unresolved regarding the best approach to solve the problem.

Contextual Notes

There are limitations in the clarity of the problem statement as presented by the teacher, and the participants express varying levels of understanding about the relationship between FFT and integral evaluation.

ser23
Messages
6
Reaction score
0
Hi, I hope someone could help me, I have been trying to solve this problem with FFT in matlab, why?, because my teacher gave it as homework. The problem is the following.

Obtain the value of the following integer using FFT:

the integer goes from [-infinte, infinite], and the function is x^2*exp(-x^2)*dx

He told us to check the definition of the Fourier transform and I checked in books, MATLAB everywhere and I can't find any info that could help me, I hope someone here can, THANK YOU.
 
Physics news on Phys.org
I have no idea what you mean by "obtain the value of the following integer."

Can you please post the problem exactly as it was given to you?

- Warren
 
chroot said:
I have no idea what you mean by "obtain the value of the following integer."

Can you please post the problem exactly as it was given to you?

- Warren

Sure, and thanks for your help

Solve the following integer using the FFT in MATLAB:

integer goes from[-infinite, infinite] and the function is:
x^2*exp(-x^2)dx

TIP: Check the Fourier transform definition. (the tip is from my teacher).

By the way I tried to translate the problem the best I can, because even in spanish what my teacher writes is difficult to understand or to find the answer he is looking for by the problem he gave us.
 
Yes, It should be intergral because of the dx at the end of the fuction.
 
hi, yes the integral I am sorry.
 
He's asking how you would write a program to find the integral using the Fast Fourier Transform (FFT). I don't know how to do it, but I thought I should clear that up for other people.
 
Seems like you should be able to evaluate this integral by using integration by parts. I don't understand what MATLAB has to do with it.

- Warren
 
Actually this is the solution my teacher gave us. He said that this is a cool way to calculate an integral, I still don't get it, hope this info helps someone, and thank you all foru your help and good intentions.

>> N=1000;
x=linspace(-10,10,N);
dx=x(2)-x(1);
y=x.^2.*exp(-x.^2);
plot(x,y);
sum( y)*dx;
mm=(fft( y));
mm(1)*dx;
>>
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 1 ·
Replies
1
Views
5K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
5
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K