🎮 Simulator EP05_02: Notch Filter
Symmetric Pair
1
1
0
Move Δv e Δu to choose the peak — note that the symmetric pair is also filtered.
Spectrum 5×5 (Red = Removed by the Filter)
–
An industrial inspection camera captures images of circuit boards, but the production line’s power supply introduces a periodic electrical interference — a stripe pattern almost imperceptible to the naked eye, yet visible in the Fourier spectrum as pairs of bright peaks symmetrically positioned around the center. The computer vision team cannot redo the capture: they must surgically locate and erase these peak pairs in the spectrum, preserving all other useful image information.
This is the role of the notch reject filter: unlike a low-pass filter (which affects a continuous region), it targets specific points and their symmetric counterparts, leaving the rest of the spectrum untouched.
| Concept | Role in the notch filter |
|---|---|
| Peak at \((\Delta v, \Delta u)\) | Frequency of the periodic interference visually detected in the spectrum |
| Symmetric point \((-\Delta v,-\Delta u)\) | Every DFT of a real signal is Hermitian: peaks always appear in pairs symmetric about the center |
| Radius \(r\) | Controls the “width” of rejection — a large \(r\) removes more energy around the peak, but also useful information |
Input:
Output:
| Input | Output | Observation |
|---|---|---|
| 5 5 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 1 1 1 0 |
1 2 3 4 5 6 0 8 9 10 11 12 13 14 15 16 17 18 0 20 21 22 23 24 25 |
Center \((c_y, c_x) = (2, 2)\). Reported peak \((\Delta v, \Delta u) = (1, 1)\) generates the point \((3, 3)\) (value 19) and its symmetric counterpart \((1, 1)\) (value 7), both zeroed with \(r=0\) (only the exact points). |
%%writefile EP05_02.cpp
// your solutionOverwriting EP05_02.cpp
TestSuite("EP05_02.cpp").run()✔️ EP05_02.cases already exists in casos/
📋 5 case(s) loaded from casos/EP05_02.cases
🔍 Testing C++: EP05_02.cpp
⚠️ EP05_02.cpp: Empty file (fewer than 3 lines). Tests skipped.