Fourier transform of rectangular pulses

Click For Summary

Discussion Overview

The discussion revolves around the Fourier transform of two rectangular pulses, one with a height of -1 from -π to 0 and another with a height of 1 from 0 to π. Participants explore the use of the Laplace transform and its properties to derive the Fourier transform, while also discussing verification methods through MATLAB coding.

Discussion Character

  • Exploratory
  • Technical explanation
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • One participant describes their approach using the Laplace transform and expresses uncertainty about the correctness of their work.
  • Another participant confirms that the algebra appears correct, provided the region of convergence for the Laplace transform includes σ = 0.
  • Concerns are raised about the implications of the region of convergence on the Fourier transform, particularly regarding the presence of delta functions.
  • A participant shares their MATLAB code for verifying the Fourier transform and notes unexpected results, questioning the accuracy of their implementation.
  • Errors in algebra are pointed out by multiple participants, specifically related to multiplying the numerator and denominator by -jω.
  • One participant suggests calculating the Fourier transform directly to have a clearer target for comparison with their method.
  • After addressing algebraic errors, a participant reports improved results from their MATLAB code.

Areas of Agreement / Disagreement

Participants express differing views on the correctness of the initial algebra and the implications of the region of convergence. There is no consensus on the final outcome or the effectiveness of the methods discussed.

Contextual Notes

Limitations include potential errors in algebraic manipulation, dependence on the region of convergence for the Laplace transform, and unresolved issues with the MATLAB implementation that may affect the results.

PainterGuy
Messages
938
Reaction score
73
TL;DR
Using Laplace transform to work out the FT of two rectangular pulses. Wanted to know if my work is correct. I did a Matlab code but it didn't produce expected result so wanted to make sure if I worked it out correctly.
Hi,

I was trying to find Fourier transform of two rectangular pulses as shown below. The inverted rectangular pulse has unit height, -1, and lasts from -π to 0. The other rectangular pulse has unit height, 1, and lasts from 0 to π.

1588290425980.png


I was making use of Laplace transform and its time shifting property to work out the Fourier transform and would like to stick with this method.

Do you think my work is correct? Thank you.

1588296141763.png


1588296331527.png
 
Physics news on Phys.org
Your final answer should be correct if you did the algebra correctly (which I think you did).

Here is why it worked. If you have some function ##f(t)## with Laplace transform ##F(s)## with some region of convergence, and Fourier transform ##\hat{F}(\omega)##, then ##\hat{F}(\omega) = F(j\omega)## only if the region of convergence for ##F(s)## includes ##\sigma = Real(s) = 0##. The region of convergence for your Laplace transform does include ##\sigma=0## so it satisfies that requirement.

However, if your function was just ##u(t)## then the Laplace transform is ##1/s## with region of convergence ##real(s)>0##, so the Fourier transform is not ##\frac{1}{j\omega}##. Instead, the Fourier transform is ##\frac{1}{j\omega} + \pi \delta(\omega)##. Whenever the region of convergence for ##F(s)## is ##real(s)>0## you should expect the Fourier transform to have things like delta functions in it. If the region of convergence for ##F(s)## is ##real(s)>a>0##, then the Fourier transform does not exist at all; one example is ##u(t) e^t## which has Laplace transform ##\frac{1}{s-1}## with region of convergence ##real(s)>1## .

jason
 
  • Like
Likes   Reactions: PainterGuy
jasonRF said:
Here is why it worked. If you have some function ##f(t)## with Laplace transform ##F(s)## with some region of convergence, and Fourier transform ##\hat{F}(\omega)##, then ##\hat{F}(\omega) = F(j\omega)## only if the region of convergence for ##F(s)## includes ##\sigma = Real(s) = 0##.

Thank you for your note on the conversion between Laplace transform and Fourier transform. I do have a question about second para but will ask it later.

I checked my work again and it looked okay.

Anyway, I tried to verify it further using a Matlab code. I used trigonometric form of Fourier transform to plot the result. Please see the note below about the trigonometric form.

1588315232995.png


I set B(ω) = j{2ω-2ω*cos(πω)}/ω

The following is Matlab code I used. Please note that if you try to run the code, it would produce different warnings but it would work fine.

Matlab:
clear all; close all; clc;

t=linspace(-10,10,12000);

for it=1:12000

f=@(w)(1/pi).*((2.*w-2.*w.*cos(pi.*w))./w).*sin(w.*t(it));
F(it)=integral(f,0,1000);

end

figure('Name','inverse Fourier transform');
plot(t,F,'red');
ylim([-5 5]); % to restrict y axis
hold on;

The plot below was produced using the code above. Note that black dashed lines were drawn by me for clarity. You can see my result is quite weird. I don't think there is a problem with my code but still I cannot figure the problem. In the code I have restricted the y-axis limits. The plot at the bottom, Plot #2, was produced without restricting y-axis.

Plot #1:
1588315368249.png
Plot #2:
1588315557441.png
 
Last edited:
I see an error in your algebra in the original post. I happens when you multiply the numerator and denominator both by ##-j \omega##. Also, if you have access to the symbolic toolbox you can use Matlab to do the analytical Fourier transform. The command is Fourier - on the command line type
>> help fourier

to see examples of how to use it. Likewise ifourier is the inverse Fourier transform. Also, the symbolic step function is called heaviside in Matlab.
 
  • Like
Likes   Reactions: PainterGuy
I noticed you obtained the result
$$F(\omega) = j\frac{2\omega\cos \pi\omega - 2\omega}{\omega},$$ and you used that form in your second post. Is there some reason you didn't cancel the common factor of ##\omega##?

I suggest you calculate the Fourier transform of this function directly so you know what you're shooting for using your method. Then you don't have to guess if you ended up with the right result.
 
  • Like
Likes   Reactions: hutchphd
jasonRF said:
I see an error in your algebra in the original post. I happens when you multiply the numerator and denominator both by ##-j \omega##.

Thank you for pointing this out. I have fixed the error below.

1588360398579.png


It worked as well. The following plot was obtained after fixing the error in previous code.

1588359969098.png


vela said:
I suggest you calculate the Fourier transform of this function directly so you know what you're shooting for using your method.

Thank you for the suggestion. The method is good and I only made an algebraic error, and such an error could occur in the direct Fourier transform as well.
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 16 ·
Replies
16
Views
2K
  • · Replies 12 ·
Replies
12
Views
12K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 23 ·
Replies
23
Views
6K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 4 ·
Replies
4
Views
6K
  • · Replies 8 ·
Replies
8
Views
5K
  • · Replies 5 ·
Replies
5
Views
2K