Frequency-Domain Inspection for Periodic Defects
Translate repeating product structure and defect pitch into a robust spectral inspection with controlled windows and spatial confirmation.
A web inspection sees a faint streak every roller revolution, yet intensity thresholding struggles because the base material varies slowly across its width. In the spectrum the repetition is visible, but a transform peak alone does not reveal where the defect occurs or whether spectral leakage, speed change, and window boundaries created the alarm.
This is a vendor-neutral engineering method. The worked example is hypothetical and must be replaced by measurements from the real product, line, and risk assessment.
What you will learn
Identify the physical, optical, data, or process limit behind frequency-domain periodic-defect inspection.
Convert the inspection need into measurable acceptance criteria.
Compare practical architectures and their trade-offs.
Commission the method using repeatable evidence.
Validate the final system under representative production variation.
Technical foundation
Spatial pitch maps to spatial frequency
For sampling S pixels/mm and physical pitch P mm, the digital period is SP pixels and frequency is 1/(SP) cycles/pixel. In an N-sample transform, an ideal aligned component appears near bin k=N/(SP). Calibration and motion scaling therefore control spectral location.
Finite windows cause leakage
A crop is multiplication by a rectangular window, which spreads energy when the observed pattern does not contain an integer number of cycles. Detrending and tapered windows reduce some leakage but change amplitude and resolution, so the full pipeline needs calibration.
Global spectra lose location
Fourier magnitude indicates frequency and orientation but not directly where a local disruption occurred. Windowed analysis, filter-then-inverse-transform, or a spatial confirmation stage is needed when the decision requires defect position and extent.
Related guides on this publication: Motion Blur in Machine Vision: Calculate Exposure Time and How to Calculate Machine Vision Resolution for Small Defects and Machine Vision Lighting for Reflective and Shiny Parts.
Engineering workflow
1. Define the periodic signature
Evaluate: physical pitch, orientation, allowed tolerance, duration, spatial extent, line-speed relation, and defect consequence.
Why it matters: different sources produce different frequency trajectories.
Measure or calculate: measure pitch on parts and correlate it with roller, encoder, or tool cycles. Preserve settings, sample identity, operating state, and the calculation method so alternatives remain comparable.
Trade-off: source correlation improves diagnosis but needs machine data. Common failure: searching arbitrary peaks without a physical hypothesis.
2. Control sampling and motion
Evaluate: pixels/mm, encoder scaling, exposure blur, line rate, resampling, alias limit, and geometric distortion.
Why it matters: frequency estimates are only meaningful on a stable spatial axis.
Measure or calculate: verify calibrated pitch using a reference and calculate samples per minimum period. Preserve settings, sample identity, operating state, and the calculation method so alternatives remain comparable.
Trade-off: higher sampling improves separation but raises bandwidth and storage. Common failure: using time-indexed lines as distance-indexed data under speed changes.
3. Prepare the signal
Evaluate: ROI, shading removal, mean or trend subtraction, masks, missing lines, window function, and normalisation.
Why it matters: low-frequency background and crop edges can dominate the spectrum.
Measure or calculate: compare raw and prepared spectra on references and quantify amplitude bias. Preserve settings, sample identity, operating state, and the calculation method so alternatives remain comparable.
Trade-off: strong detrending removes background but may remove long-period defects. Common failure: normalising each image in a way that erases severity.
4. Specify spectral features
Evaluate: target bins or bands, harmonics, orientation wedges, local noise floor, peak width, ratios, and phase if relevant.
Why it matters: robust evidence is usually a band statistic rather than one pixel.
Measure or calculate: map physical pitch tolerance to bins and measure signal-to-local-background. Preserve settings, sample identity, operating state, and the calculation method so alternatives remain comparable.
Trade-off: wide bands tolerate variation but admit unrelated energy. Common failure: setting bands after viewing final test defects.
5. Recover spatial evidence
Evaluate: sliding windows, short-time transforms, band-pass masks, inverse transform, connected regions, and encoder position.
Why it matters: maintenance and rejection need location and extent.
Measure or calculate: measure localisation error, duplicate alarms, defect length, and compute latency. Preserve settings, sample identity, operating state, and the calculation method so alternatives remain comparable.
Trade-off: smaller windows localise better but reduce frequency resolution. Common failure: rejecting an entire roll from a global peak with no location.
6. Validate source and decision
Evaluate: nominal periodic texture, known defects, speed ramp, splice, wrinkles, vibration, lighting variation, and process events.
Why it matters: many normal operations create spectral transients.
Measure or calculate: test by source and subgroup with part-level false decisions and alarm persistence. Preserve settings, sample identity, operating state, and the calculation method so alternatives remain comparable.
Trade-off: persistence filters suppress transients but delay detection. Common failure: confusing a correlated spectrum with proof of root cause.
Worked example
Hypothetical coated web: Cross-web sampling is 8 pixels/mm and a roller-related mark repeats every 25 mm along travel after encoder resampling. A 2,048-line analysis window is used.
Digital period = 25 mm × 8 pixels/mm = 200 pixels
Frequency = 1 / 200 = 0.005 cycles/pixel
Expected FFT bin = 2,048 / 200 = 10.24
Frequency-bin spacing = 1 / 2,048 = 0.000488 cycles/pixel
The component falls between bins, so leakage is expected with a rectangular window. A tapered window and a small band around the predicted frequency are compared using calibrated defect strips and nominal roller texture. Window amplitude correction, speed resampling, harmonics, and spatial confirmation must be validated before setting the alarm.
Practical decision aid
| Design choice | Benefit | Trade-off |
|---|---|---|
| Long analysis window | fine frequency resolution | poor localisation and longer latency |
| Short window | better localisation and response | broader peaks and noisier amplitude |
| Tapered window | reduced leakage sidelobes | wider main lobe and amplitude correction |
| Encoder resampling | stable distance-domain frequency | depends on encoder quality and interpolation |
| Harmonic evidence | supports nonsinusoidal repeating defects | normal structure may share harmonics |
| Inverse-filter map | restores approximate location | ringing and mask design can mislead |
Use the table to choose the next controlled experiment, not as a universal product recommendation. A component or algorithm is acceptable only when the complete inspection cell meets pre-agreed technical and operational criteria.
Common mistakes and how to prevent them
Ignoring line-speed variation. time frequency moves without physical pitch change. Prevent it by resampling by encoder distance.
Confusing bins with physical frequency. recipes fail after resolution changes. Prevent it by storing calibration and transform length.
No detrending or edge treatment. shading and crop boundaries dominate. Prevent it by testing controlled preprocessing.
Using only global magnitude. local defects cannot be positioned. Prevent it by adding windowed or spatial confirmation.
Thresholding one peak amplitude. leakage and normal texture change the value. Prevent it by using bands and local noise references.
Assuming the strongest period is causal. correlation is mistaken for root cause. Prevent it by comparing machine-cycle evidence and interventions.
Validate under production conditions
Use defect standards or confirmed production examples spanning pitch, amplitude, length, orientation, and location, plus nominal periodic surface structure. Test encoder speed ramps, starts, stops, splices, crop boundaries, missing lines, vibration, lamp drift, field position, and product recipes. Compare frequency-band evidence, spatial localisation, part or roll decisions, latency, and false alarms. Verify suspected machine sources with synchronized process data or controlled interventions.
Use representative acceptable parts, confirmed defects, boundary samples, and nuisance variation. Repeat complete part presentations rather than processing one stored image many times. Include start-up, warm-up, maximum speed, changeover, maintenance, environmental limits, communication faults, and long-duration operation where relevant.
Define acceptance criteria before reviewing final results. Preserve raw counts and denominators for false accepts, false rejects, invalid acquisitions, timing overruns, and manually reviewed cases. After release, trend leading indicators and conduct labelled audits so deterioration is detected before a customer escape.
Key takeaways
Convert physical pitch into pixels and expected spectral bins.
Use distance-based sampling when line speed changes.
Account for finite-window leakage and amplitude effects.
Add local spectral or spatial confirmation when position matters.
Validate process transients and suspected source correlation explicitly.
Follow this Hashnode blog for more practical industrial machine-vision engineering, and connect with Kivanc Ekici on LinkedIn. For related machine-vision and automation information, visit ITAGE.
Frequently asked questions
What FFT bin corresponds to a defect pitch?
For transform length N and digital period P pixels, the ideal bin is N/P; noninteger values cause energy to spread across bins.
Why does a periodic peak move with conveyor speed?
If samples are time-spaced rather than distance-spaced, changing speed changes the number of samples per physical period.
Does a Hann window remove leakage?
It reduces sidelobes compared with a rectangular window but broadens the main lobe and changes amplitude; it does not eliminate all leakage.
Can a Fourier transform locate a defect?
A global magnitude spectrum cannot directly locate it. Use sliding windows, inverse filtering, or spatial confirmation.
How are periodic-defect thresholds set?
Use labelled nominal and defective production data, predicted frequency bands, local noise statistics, severity criteria, and part-level error targets.

