- KVKV-X
Digital filters
What Is a Digital Filter?
A digital filter is a signal processing technique for removing unwanted noise from a signal or extracting only specific frequency components. PLC analog input values often contain noise, and low-pass or notch filters make stable control and measurement possible.
Overview
This page introduces digital filter sample programs
for the KEYENCE KV series and KV-X series.
Low-pass filters (LPF),
high-pass filters (HPF),
band-pass filters (BPF),
notch filters and more
are implemented as function blocks
to remove noise from analog inputs
and extract specific frequency components.
The waveforms and sample programs for each filter are published,
so use them as a reference for signal processing and analog data analysis on PLCs.

Original waveform
The original waveform contains a 30 Hz sine wave with 500 Hz noise
We apply the following 8 types of filters

Low-pass filter
Cuts off frequencies above 100 Hz to remove noise

High-pass filter
Cuts off frequencies below 100 Hz to remove noise

Band-pass filter
Passes one octave of frequencies around 30 Hz

Notch filter
Removes one octave of frequencies around 30 Hz

Low-shelf filter
Amplifies frequencies below 100 Hz

High-shelf filter
Amplifies frequencies above 100 Hz

Peaking filter
Amplifies one octave of frequencies around 30 Hz

All-pass filter
Shifts the phase around the cutoff frequency
Symbols
Input/output variables common to all functions
- In
- Input value
- SampFreq
- Sampling frequency
- Freq
- Cutoff frequency
- BandWidth
- Bandwidth
- gain
- Gain
- Result
- Result
The sampling frequency defaults to the task period of the executing task. For high-speed analog units that acquire multiple analog values per scan, enter the sampling frequency (Hz) according to the unit settings
LPF (low-pass filter)
A filter that passes frequencies below the cutoff frequency
HPF (high-pass filter)
A filter that passes frequencies above the cutoff frequency
BPF (band-pass filter)
A filter that passes only the bandwidth around the cutoff frequency
With a cutoff frequency of 30 Hz and a bandwidth of one octave, the range is 30/2 to 30×2, so 15 Hz to 60 Hz is passed
NotchF (notch filter)
A filter that passes everything except the bandwidth around the cutoff frequency
The opposite of BPF: everything except 15 Hz to 60 Hz is passed
LowShelfF (low-shelf filter)
A filter that amplifies frequencies below the cutoff frequency by the specified gain
HiShelfF (high-shelf filter)
A filter that amplifies frequencies above the cutoff frequency by the specified gain
PeekingF (peaking filter)
A filter that amplifies the bandwidth centered on the cutoff frequency by the specified gain
AllPassF (all-pass filter)
A filter that changes only the phase around the cutoff frequency
LPF (low-pass filter)
A filter that passes frequencies below the cutoff frequency
HPF (high-pass filter)
A filter that passes frequencies above the cutoff frequency
BPF (band-pass filter)
A filter that passes only the bandwidth around the cutoff frequency
With a cutoff frequency of 30 Hz and a bandwidth of one octave, the range is 30/2 to 30×2, so 15 Hz to 60 Hz is passed
NotchF (notch filter)
A filter that passes everything except the bandwidth around the cutoff frequency
The opposite of BPF: everything except 15 Hz to 60 Hz is passed
LowShelfF (low-shelf filter)
A filter that amplifies frequencies below the cutoff frequency by the specified gain
HiShelfF (high-shelf filter)
A filter that amplifies frequencies above the cutoff frequency by the specified gain
PeekingF (peaking filter)
A filter that amplifies the bandwidth centered on the cutoff frequency by the specified gain
AllPassF (all-pass filter)
A filter that changes only the phase around the cutoff frequency
References
Implementing simple digital filters (Japanese)
Download
* Operation on the KV-X was verified with the simulator
