Fourier Transform of Rectangular Pulse: Formula and Example
The
Fourier transform of a rectangular pulse of width T centered at zero is a sinc function given by F(ω) = T sinc(ωT/2). This transform shows how the pulse spreads in frequency as a smooth oscillating function.Syntax
The Fourier transform of a rectangular pulse rect(t/T) is defined as:
F(ω) = ∫ rect(t/T) e-jωt dt = T sinc(ωT/2)
rect(t/T): Rectangular pulse of widthTcentered at zeroω: Angular frequency variablesinc(x) = sin(x) / x: The sinc functionT: Pulse width
This formula shows the frequency content of the pulse as a sinc function scaled by the pulse width.
python
def rectangular_pulse_fourier(omega, T): import numpy as np # Handle the sinc function with numpy's normalized sinc # numpy.sinc(x) = sin(pi*x)/(pi*x), so adjust argument accordingly return T * np.sinc(omega * T / (2 * np.pi))
Example
This example computes and plots the Fourier transform of a rectangular pulse of width 1. It shows the sinc shape in frequency.
python
import numpy as np import matplotlib.pyplot as plt def rectangular_pulse_fourier(omega, T): return T * np.sinc(omega * T / (2 * np.pi)) T = 1.0 omega = np.linspace(-20, 20, 400) F = rectangular_pulse_fourier(omega, T) plt.plot(omega, F) plt.title('Fourier Transform of Rectangular Pulse (Width T=1)') plt.xlabel('Angular Frequency ω') plt.ylabel('Magnitude') plt.grid(True) plt.show()
Output
A plot window showing a sinc function centered at zero frequency with main lobe width related to T=1
Common Pitfalls
Common mistakes when working with the Fourier transform of a rectangular pulse include:
- Confusing the definition of the sinc function. The mathematical sinc is
sin(x)/x, but many libraries use a normalized versionsin(πx)/(πx). Adjust arguments accordingly. - Ignoring the pulse width
Tscaling factor, which affects the amplitude and width of the transform. - Not centering the pulse at zero, which shifts the phase and changes the transform.
python
import numpy as np # Wrong: Using np.sinc without adjusting argument # This gives incorrect frequency scaling def wrong_fourier(omega, T): return T * np.sinc(omega * T / 2) # Missing division by pi # Correct: Adjust argument for numpy's normalized sinc def correct_fourier(omega, T): return T * np.sinc(omega * T / (2 * np.pi))
Quick Reference
| Concept | Formula / Note |
|---|---|
| Rectangular pulse | rect(t/T) = 1 for |t| ≤ T/2, else 0 |
| Fourier transform | F(ω) = T sinc(ωT/2) |
| Sinc function | sinc(x) = sin(x)/x |
| Numpy sinc | np.sinc(x) = sin(πx)/(πx), adjust input accordingly |
| Pulse width effect | Larger T narrows main lobe in frequency |
Key Takeaways
The Fourier transform of a rectangular pulse is a sinc function scaled by pulse width.
Use the correct sinc definition and adjust arguments when using libraries like numpy.
Pulse width controls the frequency spread: wider pulses have narrower frequency content.
Centering the pulse at zero is important for correct phase and transform shape.
Common errors come from ignoring scaling factors or using wrong sinc arguments.