0
0
RosHow-ToBeginner · 4 min read

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 width T centered at zero
  • ω: Angular frequency variable
  • sinc(x) = sin(x) / x: The sinc function
  • T: 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 version sin(πx)/(πx). Adjust arguments accordingly.
  • Ignoring the pulse width T scaling 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

ConceptFormula / Note
Rectangular pulserect(t/T) = 1 for |t| ≤ T/2, else 0
Fourier transformF(ω) = T sinc(ωT/2)
Sinc functionsinc(x) = sin(x)/x
Numpy sincnp.sinc(x) = sin(πx)/(πx), adjust input accordingly
Pulse width effectLarger 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.