---
title: "DTFT of u[n−2] − u[n−6]"
subject: "Signals and Systems"
chapter: 3
key: "semester_4/signals_and_systems:dtft-step-difference"
source: https://www.bctengineer.com/q/semester_4/signals_and_systems/dtft-step-difference
site: BCT Engineering
---

# DTFT of u[n−2] − u[n−6]

Signals and Systems · Chapter 3: Fourier Transform

- Asked in: 2076 Baisakh, 5 marks
- Video: [DT Fourier transform of a square pulse](https://www.youtube.com/watch?v=MbQIsFn65Z4) — ProfKathleenWage
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_4/signals_and_systems/dtft-step-difference
- Whole chapter: https://www.bctengineer.com/md/semester_4/signals_and_systems/chapter-3

## Question

Find Discrete time Fourier transform of the discrete time signal x[n] = u[n−2] − u[n−6].

## Short answer

x[n]=u[n-2]-u[n-6] is 1 for n=2,3,4,5. Summing the geometric series: X(e^{jω}) = e^{-j2ω}(1-e^{-j4ω})/(1-e^{-jω}) = e^{-j3.5ω} sin(2ω)/sin(ω/2).

## Answer

$x[n] = u[n-2] - u[n-6]$ is a rectangular sequence that equals 1 for $n = 2, 3, 4, 5$ and 0 elsewhere:

$$
x[n] = \{0, 0, 1, 1, 1, 1\} \quad (n = 0 \text{ to } 5)
$$

**DTFT:**

$$
\begin{aligned}
X(e^{j\omega}) &= \sum_{n=2}^{5} e^{-j\omega n} = e^{-j2\omega} + e^{-j3\omega} + e^{-j4\omega} + e^{-j5\omega}
\end{aligned}
$$

**Closed form (geometric series of 4 terms, first term $e^{-j2\omega}$, ratio $e^{-j\omega}$):**

$$
\begin{aligned}
X(e^{j\omega}) &= e^{-j2\omega}\,\frac{1 - e^{-j4\omega}}{1 - e^{-j\omega}} \\
&= e^{-j2\omega}\,\frac{e^{-j2\omega}\left(e^{j2\omega} - e^{-j2\omega}\right)}{e^{-j\omega/2}\left(e^{j\omega/2} - e^{-j\omega/2}\right)} \\
&= e^{-j2\omega}\,e^{-j3\omega/2}\,\frac{2j\sin 2\omega}{2j\sin(\omega/2)} \\
&= e^{-j7\omega/2}\,\frac{\sin 2\omega}{\sin(\omega/2)}
\end{aligned}
$$

**Answer:**

$$
X(e^{j\omega}) = \frac{\sin(2\omega)}{\sin(\omega/2)}\,e^{-j3.5\omega}
$$

- Magnitude $|X| = \left|\frac{\sin 2\omega}{\sin(\omega/2)}\right|$, maximum value $4$ at $\omega = 0$ (= number of ones), zeros at $\omega = \pm\pi/2, \pm\pi$.
- Phase is linear, $-3.5\omega$ (plus $\pi$ jumps where the sine ratio is negative), because the pulse is symmetric about $n = 3.5$.

(Alternative: $u[n] \leftrightarrow \frac{1}{1-e^{-j\omega}} + \pi\sum_k\delta(\omega-2\pi k)$ with time shifting gives the same result, since the impulse terms cancel.)

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. For which n does x[n] = u[n-2] - u[n-6] equal 1?
   A. n = 2, 3, 4, 5
   B. n = 2, 3, 4, 5, 6
   C. n = 3, 4, 5, 6
   D. n = 0 to 5
   Answer: A. u[n-2] turns on at n = 2 and u[n-6] turns on at n = 6 and cancels it, leaving four ones. (Key point: Signal identification)

2. How is the DTFT summed into closed form?
   A. Geometric series of 6 terms starting at n = 0
   B. Geometric series of 4 terms: e^(-j2ω)(1 - e^(-j4ω))/(1 - e^(-jω))
   C. Infinite geometric series 1/(1 - e^(-jω))
   D. Using the time-scaling property of DTFT
   Answer: B. The sum from n = 2 to 5 has first term e^(-j2ω), ratio e^(-jω) and 4 terms. (Key point: Geometric series)

3. What is the DTFT?
   A. sin(2ω)/sin(ω/2) · e^(-j2ω)
   B. sin(3ω)/sin(ω/2) · e^(-j3.5ω)
   C. sin(2ω)/sin(ω/2) · e^(-j3.5ω)
   D. sin(4ω)/sin(ω) · e^(-j3.5ω)
   Answer: C. Factoring sines from the numerator and denominator gives sin(2ω)/sin(ω/2) and a phase e^(-j(2+1.5)ω) = e^(-j3.5ω). (Key point: Final answer)

4. What is |X| at ω = 0 and why?
   A. 1, since x[n] is a unit pulse
   B. 6, the length of the listing
   C. 0, since the signal has no DC
   D. 4, the number of ones (sum of samples)
   Answer: D. X(e^{j0}) is the sum of all samples, which is 4. (Key point: Magnitude at zero)

## Close variants set in other exams

- [DTFT of (1/2)^(n−1)u[n−1]](https://www.bctengineer.com/question.md?key=semester_4%2Fsignals_and_systems%3Adtft-shifted-geometric) — Signals and Systems, chapter 3, asked 3×
- [DTFT of (1/2)^(−n)u[−n−1]](https://www.bctengineer.com/question.md?key=semester_4%2Fsignals_and_systems%3Adtft-anticausal-sequence) — Signals and Systems, chapter 3, asked 3×

## Related in Signals and Systems

- [Fourier series vs transform; DTFT of aⁿ](https://www.bctengineer.com/question.md?key=semester_4%2Fsignals_and_systems%3Afs-vs-ft-dtft-geometric) — Signals and Systems, chapter 3
- [Derive the discrete-time Fourier series](https://www.bctengineer.com/question.md?key=semester_4%2Fsignals_and_systems%3Adtfs-derivation) — Signals and Systems, chapter 2, asked 15×
- [Fourier transform of a CT signal](https://www.bctengineer.com/question.md?key=semester_4%2Fsignals_and_systems%3Aft-unspecified-ct-signal) — Signals and Systems, chapter 3
- [Derive DTFT; DTFT periodic with 2π](https://www.bctengineer.com/question.md?key=semester_4%2Fsignals_and_systems%3Adtft-derivation-periodicity) — Signals and Systems, chapter 3, asked 3×
- [DTFT of sgn[n] and u[n]](https://www.bctengineer.com/question.md?key=semester_4%2Fsignals_and_systems%3Adtft-signum-unit-step) — Signals and Systems, chapter 3, asked 2×
- [Fourier transform of periodic sequences](https://www.bctengineer.com/question.md?key=semester_4%2Fsignals_and_systems%3Aft-of-periodic-sequence) — Signals and Systems, chapter 3, asked 3×

## Related in other subjects

- [Discrete and Fast Fourier Transform](https://www.bctengineer.com/question.md?key=semester_8%2Fcomputational_techniques_in_civil_engineering%3Adft-fft-brief) — Computational Techniques in Civil Engineering, chapter 2
- [Fourier transform of a DC signal](https://www.bctengineer.com/question.md?key=semester_5%2Fdata_communication%3Aft-dc-signal) — Data Communication, chapter 3
- [Fourier transform property: Time shifting](https://www.bctengineer.com/question.md?key=semester_6%2Fcommunication_systems%3Aft-property-time-shifting) — Communication Systems, chapter 1
- [Fourier transform of e^(-a|t|)](https://www.bctengineer.com/question.md?key=semester_5%2Fdata_communication%3Aft-exp-abs-ct) — Data Communication, chapter 3
