Finding Fourier Transform of tri(\frac{t}{2\pi })Cos(2\pi (\frac{5}{\pi })t)

In summary, to find the Fourier Transform of a function involving a tri function, it is necessary to break it up into two components and use a rect function for each component. This can be done by creating two separate time vectors and multiplying them with the original function.
  • #1
frenzal_dude
77
0
I want to input the following function so I can find the Fourier Transform of it:

[tex]tri(\frac{t}{2\pi })Cos(2\pi (\frac{5}{\pi })t)[/tex]

I couldn't find a simple way of doing a tri function so this is what I inputted in matlab:

[tex]a(t_{1}) = (\frac{t_{1}}{\pi }+1)Cos(2\pi (\frac{5}{\pi })t_{1})[/tex] where -π < t1 < 0

[tex]b(t_{2}) = (-\frac{t_{2}}{\pi }+1)Cos(2\pi (\frac{5}{\pi })t_{2})[/tex] where 0 < t2 < π

[tex]g(t) = a(t_{1}) + b(t_{2})[/tex]

Here is what I typed into matlab:
>> t1 = -pi:0.01:0;
>> t2 = 0:0.01:pi;
>> g = ((t1/pi) + 1)*cos(2*pi*(5/pi)*t1) + ((-t2/pi) + 1)*cos(2*pi*(5/pi)*t2);

But I get this error:
? Error using ==> mtimes
Inner matrix dimensions must agree.

I looked in the workspace and t1 and t2 both have the same dimensions of 1x315 (just different min anad max values).

Thanks for your help.
 
Engineering news on Phys.org
  • #2
OK I managed to get this to work:

g=((t1/pi) + 1).*cos(2*pi*(5/pi)*t1) + ((-t2/pi) + 1).*cos(2*pi*(5/pi)*t2);

But how can I plot this? I tried creating a new time vector t=-pi:0.001:pi;

But then I get this error:
? Error using ==> plot
Vectors must be the same lengths.
 
  • #3
OK worked it out! :)

To do a tri function multipled with another function, you need to break it up into two components and think of the tri as two straight lines, and then use a rect function for each of the two components, as shown below:

t = -pi:0.1:pi;
y1 = ( (-pi <= t) .* (t < 0 ) ); %rect[(t-pi/2)/pi]
g1 = y1.*((t/pi)+1).*cos(2*pi*(5/pi)*t);
y2 = ( (0 <= t) .* (t < pi ) ); %rect[(t+pi/2)/pi]
g2 = y2.*((-t/pi)+1).*cos(2*pi*(5/pi)*t);
plot(t,g1+g2);
 
Last edited:

1. What is the Fourier Transform of the given function?

The Fourier Transform of the given function is a complex-valued function that represents the decomposition of the original function into its constituent frequencies.

2. How do you find the Fourier Transform of a function?

To find the Fourier Transform of a function, you can use the integral formula: F(ω) = ∫f(t)e^(-iωt) dt, where f(t) is the original function, ω is the frequency, and i is the imaginary unit.

3. What does the tri(\frac{t}{2\pi}) term represent in the given function?

The tri(\frac{t}{2\pi}) term represents a triangular pulse function with a period of 2π. It is used to limit the function to a specific range of t values.

4. How does the Cos(2π(\frac{5}{\pi})t) term affect the Fourier Transform of the given function?

The Cos(2π(\frac{5}{\pi})t) term represents a cosine wave with a frequency of 5π. This term will result in a peak in the Fourier Transform at the frequency of 5π, indicating the presence of this frequency component in the original function.

5. What is the significance of the Fourier Transform in science?

The Fourier Transform is a powerful tool in science that allows us to analyze complex functions and signals in terms of their constituent frequencies. It has applications in various fields such as signal processing, image analysis, and quantum mechanics.

Similar threads

  • Calculus and Beyond Homework Help
Replies
1
Views
216
  • Calculus and Beyond Homework Help
Replies
1
Views
88
Replies
5
Views
1K
  • Calculus and Beyond Homework Help
Replies
5
Views
357
  • Calculus and Beyond Homework Help
Replies
1
Views
345
  • Calculus and Beyond Homework Help
Replies
6
Views
2K
Replies
4
Views
295
  • Calculus and Beyond Homework Help
Replies
16
Views
564
  • Topology and Analysis
Replies
4
Views
275
Replies
4
Views
368
Back
Top