EN
 
English
Italian
French
German

Filters

In the field of signal processing, a filter is a device that suppresses unwanted components or features from a signal. The most commonly used filters are low-pass, high-pass, band-pass and band-stop. Characteristics that describe filter are its type, cutoff frequency, order (steepness).

Let's start with some terminology followed by a basic introduction. Then we are going to acquaint ourselves with analog and digital filters, as well as converters and do a comparison of the two. Next on the list will be the different types of filters and their uses. Finally, we are going to see how to setup and use all of these filters in Dewesoft X.

In the field of signal processing, a filter is a device or process that, completely or partially, suppresses unwanted components or features from a signal. This usually means removing some frequencies to suppress interfering signals and to reduce background noise.

Although the task of filters is pretty simple, they are invaluable in today's electronics, particularly in telecommunications.

Terminology

Here is a short list of terms that will be used in this tutorial. Some terms might not be explained here, but will have an explanation later in the text.

  • Attenuate - to decrease the amplitude of and electronic signal, with little or no distortion.
  • Low-pass filter - a filter that passes low frequencies and attenuates the high ones. 
  • High-pass filter - a filter that passes high frequencies and attenuates the low ones. 
  • Band-pass filter - a filter that passes only frequencies in a specific band. 
  • Band-stop filter - a filter that only attenuates frequencies in a specific band. 
  • Notch filter - a filter that rejects only a specific frequency (an extreme band-stop filter).
  • Comb filter - a filter that has multiple regularly spaced narrow pass-bands.
  • All-pass filter - a filter that passes all frequencies, but the phase of the output is modified.
  • Cutoff frequency - the frequency beyond which the filter will not pass a signal.
  • Roll-off - a rate at which attenuation increases beyond the cutoff frequency. The steepness of the transition between the pass-band and stop-band.
  • Transition band - the band of frequencies between a pass-band and stop-band.
  • Ripple - the maximum amplitude error of the filter in the passband in dB.
  • The order of the filter - the degree of the approximating polynomial (increasing order increases roll-off and brings the filter closer to the ideal response).

Analog filters are basic block of signal processing and are designed to operate on a continuously signal (the signal has the value at every instance of time). They are electronic circuits that are dependent on the elements used:

  • passive (capacitors, inductors and sometimes resistors),
  • active (active elements such as amplifiers combined with passive elements).

They can be linear or non-linear, depending on the type of the equation that describes them. Most analog filters have an infinite impulse response or IIR (this means that the impulse response of the filter, in theory, will never reach zero but in real applications the signal will approach zero and can be neglected). This is because the analog circuit consists of resistors, capacitors, and/or inductors and the latter have a "memory" and their internal state never really relaxes after an impulse.

An example of an 1st order low pass filter:

Digital filter

A digital filter is a signal processing system that performs mathematical operations on a sampled (a continuous signal that has been reduced to a discrete one), discrete-time (unlike the continuous signal, the discrete one does not have a value at every instance of time - it is quantized ), digital (a physical signal that is a representation of a sequence of discrete values - for example, an arbitrary bit stream or a digitized analog signal) signal.

It is used in the same way as analogue filters. They are used to modify a signal (to suppress unwanted parts of the signal).

Filter characteristics:

  • type (lowpass, highpass, bandpass, bandstop)
  • cutoff frequency
  • order (steepness)
  • FIR, IIR

It can have either a Finite Impulse Response or FIR (the response of the filter after an impulse will reach exactly zero, after a certain, finite amount of time.) or an Infinite Impulse Response (IIR) if feedback is present in the topology of the filter.

A comparison between the continuous and discrete signal:

Comparing analogue and digital filters

Analogue filters are much more subjected to non-linearity (resulting in smaller accuracy) because the electronic components that are used for filtering are inherently imperfect and often have values specified to a certain tolerance limit (resistors often have a tolerance of ±5% ). This can be further affected by temperature and time changes. The elements of the circuits also introduce thermal noise, because every element is subject to heating. As we might expect, the more complex the circuit, the greater the magnitude of component errors. On top of that, analogue filters cannot have a FIR response because it would require delay elements.

But where they shine is high-frequency filtering, low latency, and speed. Like it was mentioned in the converter section, a digital filter can not work without preemptive anti-alias filtering, which can only be achieved with a low-pass analog filter. The speed of the analog filter can easily be 10 to 100 times that of a digital one. Also worth mentioning is that in very simple cases, an analog filter surpasses its digital counterpart in terms of cost efficiency.

The digital filter shines in a lot of areas where the analog does not. It is more accurate, supports both IIR and FIR, it can be programmed, making them easier to build and test while giving them greater flexibility. It's also more stable since it isn't affected by temperature and humidity changes. They are also far superior in terms of cost efficiency, especially as the filter gets more complex.

The downsides of digital filters are latency because the signal has to go through two converters and still be processed at high frequencies. In today's modern circuits, both filters are used to complement each other and achieve maximum speed and accuracy.

A comparison of digital and analog filters:

Digital filters Analog filters
high accuracyless accurate due to component tolerances
linear phase (FIR filters)non-linear phase
no drift due to component variationsdrift due to component variations
flexible, adaptive filtering possibleadaptive filters difficult
easy to simulate and designdifficult to simulate and design
computation must be completed in the sampling period - limits real-time operationsanalog filters required at high frequencies and for an anti-aliasing filter
requires high-performance ADC, DAC and DSPno ADC, DAC or DSP required

Now that you learned the basics of filters and how they work, we are going to focus only on digital filters and different digital filter types, since the main goal of this tutorial is to teach you how to use them in Dewesoft.

The next chapters will show you how to set appropriate filters in Dewesoft, how to use them and explain what their purpose is. But first, a simple example will show you the usage of filters.

Using filters

Let's find out why we should even use filters. We have a tuning fork instrumented with strain gage connected on Dewesoft measuring device SIRIUS.

When the tuning fork is connected to the STG module, it can be seen in the channel setup.

If we take a look at the recorder when a static force is applied on the tuning fork, we can see the changing offset of the signal.

We might also try hitting the tuning fork so it makes a sound reflecting the natural frequency of the tuning fork (the conventional way it is used). We can see this as a high-frequency vibration with falling amplitude because of air friction and friction in the fork.

When looking at the FFT screen (let's change it to the logarithmic scale to see all the amplitudes), we can see that there is an obvious peak at approximately 440 Hz. We can also place a cursor at this point by simply clicking on the peak in the FFT. The frequency shown is 439.5 Hz. It is not exactly 440 Hz because FFT has a certain line resolution.

This line resolution depends on the sampling rate and the number of lines chosen for the FFT. If we want to have a faster response on the FFT, we would choose fewer lines, but we would have a lower frequency resolution. If the user wants to see the exact frequency, it is necessary to set a higher line resolution. This is well described in the reference guide, but a simple rule of thumb is: if it takes 1 second to acquire the data from which the FFT is calculated, the resulting FFT will have 1 Hz line resolution. If we acquire data for 2 seconds, line resolution will be 0.5 Hz.

This is also a perfect example to learn about using the filters in Dewesoft X. Clearly, there is one part of the signal in the form of the offset (static load) and one part in a form of dynamic ringing with a 440 Hz frequency.

If we want to extract those two components from the original waveform, we need to set two filters - one low pass and one high pass. So we add two filters in the Math section.

1. First, we set the input channel, in this case tunning fork. Then we set it on Low pass, 6th order filter and we set the cutoff frequency Fhigh to 200 Hz. This will pass all the signals below 200 Hz frequency and all the frequencies above this will be cut off

2. The second filter is set to High pass, 6th order with the same cutoff Flow frequency.

If we show those two filters on the recorder, we can see that the signal is nicely decomposed to the static load and dynamic ringing. The user can use this technology to cut off unwanted parts of the signal or to extract wanted frequency components of the certain signal.

FIR filter uses only current and past input digital samples to obtain a current output sample value. It does not utilize past output samples.

FIR filter calculates in the way that it takes the input channel data and multiplies it with the specific curve. The easiest example of FIR filter is the averaging filter. Let's say we want to average the input data over three samples. The equation would be like this:

Our simple average filter would have a result like this:

Obvious disadvantage is that we would need a lot of input points to be able to filter the data sharp.

IIR filter uses current input sample value, past input, and output samples to obtain current output sample value. We could rewrite the formula like this:


So we are using the previous sample to basically perform exponential averaging, but this very simple and efficient formula will filter the data much more:

Comparison of both:

By the way, these functions were simulated in a Dewesoft X formula by using prev and .data functions:

Infinite and finite impulse response

Let's first take a look at the advantages and disadvantages of the IIR response, then the FIR response and finish with a quick summary and overview of both.

The main advantage of IIR filters over FIR filters is their efficient implementation, which helps them to meet specifications in terms of pass-band, stop-band, ripple and/or roll-off. For this, we require a lower order IIR filter, compared to a similar FIR filter. This effectively corresponds to fewer calculations needed, resulting in rather large computational savings. The best use of IIR filters is when the linear characteristics are not of concern and for lower order tapping.

The main disadvantages of IIR are instability, feedback, non-linearity and has limited cycles.

FIR, on the other hand, can make linear characteristics always possible, requires no feedback, is inherently stable, can be easier to design for meeting particular frequency responses and does not have limited cycles. The disadvantage of FIR filters is that they require more memory and computing power than an IIR with similar sharpness or selectivity, particularly when it comes to lower order tapping.

The following table offers a quick comparison of IIR and FIR filter:

IIR FIR
impulse response is infiniteimpulse response is finite
can be unstablealways stable
sharp cut-offslow
IIR is recursiveFIR is non-recursive
multi-rate signals are not supported by IIRmulti-rate signals are supported in FIR
phase response is not linearphase response is always linear
IIR is less accurateFIR is more accurate
IIR transfer function consists of zeros and polesFIR transfer function consists only of zeros
IIR requires less computing power than FIRFIR requires more computing power that IIR
can have limited cyclesno limited cycles

Here you will learn how to add a new filter using Dewesoft X.

New filter can be added on the Dewesoft X math setup screen by clicking the Add math and selecting the appropriate filter.

We can select the filter type from the following options:

  • IIR filter (IIR - Infinite Impulse Response)
  • FIR filter (FIR - Finite Impulse Response)
  • Frequency domain filter

IIR filters are digital filters with the infinite impulse response, that means that the response to the impulse will be non-zero over an infinite length of time. It supports low pass, high pass, band pass and band stop type of filters and multiple input channels. You can select from Chebyshev, Butterworth and Bessel prototypes of a filter. A drawback of the IIR filter is that the phase is not linear.

We add a new IIR filter in a math section.

When you press the IIR filter button, the following IIR Filter setup window will open. On the left side of the setup screen, we have to select the input channel on which the filter will be applied. If we want to apply the same filter to multiple channels we can do that just by selecting all the channels we want to have filtered.

In IIR filter setup we can select between two designs:

  • Preset filter (Opened by default)
  • Manual filter

The IIR allows high, low, band-pass and band-reject filters.

With filter option on IIR Filter settings section you can set:

  • Type and Prototype
  • Order
  • Cut-off frequency (Low, High)
  • Scale
  • Ripple (only with Chebyshev filter)

You can see the effects of these settings directly in the Response/Coefficients/Zeros&Poles display for Filter Type: Low pass, High pass, Band pass, Band stop and different Prototypes.

Types of filters:

Low pass - low pass filter cuts the high frequencies of the signals.
High pass - high pass filter cuts the DC and low frequencies.
Band pass - band pass filter filters high and low frequencies, so there is only one band of values left
Band stop - band stop filter filters only one section of frequencies, for example, band around 50 Hz to cancel the supply voltage effects

Prototypes of filters:

Butterworth - Butterworth is without the ripple and maintains the shape with higher orders. Roll-off is defined with (-20 dB/decade)*order. It is also known as maximally flat magnitude, suggesting that the filter response is really flat in the passband.
Chebyshev I - sometimes the selection of the filters is defined by the application, but in general, the Chebyshev has the highest roll-off of all three, but has a ripple in the pass band and doesn't maintain the shape with higher orders.
Bessel - Bessel filter is the filter with maximally linear phase response. The roll-off, however, is the least step of all three filter types.

Order

The order of the filter defines the steepness of the filter. For the Butterworth the roll-off is (-20 dB/decade)*order, so for the sixth order the roll-off would be -120 dB/decade. That would mean if the amplitude at 100 Hz (already in the stop band) is 1, the amplitude at 1000 Hz would be 10(-120/20)=10-6.

The highest as the order is, more calculation power will be needed to calculate the filter. We need 6 multiplications for each two orders of the filter.

Cut-off frequency

Fc1 (low frequency) - you can enter Flow for high pass, band pass and band stop filter.

Fc2 (high frequency) - you can enter Fhigh for low pass, band pass and band stop filter.

High and low frequency - you can enter Fhigh and Flow for band pass and band stop filter.

Fc1 value must be always lower than Fc2. These values are limited by filter stability. In Dewesoft X, the filters are calculated in sections, which enable the ratio between cutoff and sample frequency in a range of 1 to 100000. So we are able to calculate 1 Hz high pass filter with 100 kHz sampling rate.

Ripple

Ripple is the maximum amplitude error of the filter in the passband in dB. This field appears only for Chebyshev filter prototype.

The ripple is often given in dB: 

The ripple amplitude of 3 dB results from: 

Scale

Scale factor means the final multiplication factor before the value is written to an output channel. It helps us to change the unit, for example. A good example of using the Scale is shown in the Integration section.

This page will offer a brief summary of the three different IIR filter prototypes in Dewesoft X.

Butterworth

The Butterworth filter is a type of signal processing filter designed to have a maximally flat frequency response (having no ripples) on the pass-band and rolls off towards zero in the stop-band. It is also referred to as a maximally flat magnitude filter and offers the smoothest possible curve of any class of filter of the same order.

Chebyshev

Chebyshev filters have a steeper roll-off and more pass-band ripple (type I) or stop-band ripple (type II) than Butterworth filters. Chebyshev filters have the property that they minimize the error between the idealized and the actual filter characteristic over the range of the filter, but with ripples in the passband. Because of the passband ripple inherent in Chebyshev filters, the ones that have a smoother response in the passband but a more irregular response in the stopband are preferred for some applications.


Bessel

Bessel filter is a type of a linear filter with a maximally flat group delay (maximally linear phase response) over its pass-band. The result is a linear phase response, meaning that the passing waveforms will be minimally distorted. It is often used in audio crossover systems. Analog Bessel filters are characterized by almost constant group delay across the entire passband, thus preserving the wave shape of filtered signals in the passband.

Let's take a look at the example of a laser output signal, with sharp transitions. We can see the ringing in a signal.

The task was, to determine the maximum value of the signal.

First we use the Butterworth filter prototype (orange). We can see the output of the filter exceeds the maximum value of the signal - the value was wrong.


Then we applied the Bessel filter prototype (green). We can nicely see the maximum value was right at that filter prototype.

Let's look at the direct comparison between FIR and IIR filter.

Again, we will show you demo with tuning fork. We connect the forks to STG module. Forks natural frequency is approximately at 440 Hz, so both filter will be set as high-pass filters with cutoff frequency at 200 Hz.




We excite the fork so that it vibrates at natural frequency.

When we apply FIR filter we can see that there is no phase delay.

And then we apply IIR filter in the signal. We can clearly see the phase delay.

On the lower side we see some useful information of the chosen filter. First is the Response curve.

The red curve shows the amplification/attenuation of the filter in dB related to the frequency. To refresh the memory, dB scaling is calculated with equation a[dB] = 20 * log10(A), so the attenuation ratio is calculated with A=10(a/20).

If we read out the value of -34 dB as attenuation, the ratio between input at output at that frequency will be A = 10(-34/20) = 0,02. So if the input is 1 V sine wave, the output will be 0,02 V sine wave.

The phase (green curve) shows the delay of the signal in degrees.

The lower table shows the coefficients with which the filters will be calculated. The filter is split in several sections for increased stability, so the result from the first section is taken to the next section and so on. These coefficients can be also copy/pasted with right mouse click on the table to be used from/in other calculation programs.

Zeroes & poles diagram shows the position of filter zeroes and filter poles and can suggest the stability of the filter.


We add a new FIR filter in the math section.

When you press FIR filter the following FIR filter setup window will open. On the left side of the setup screen, we have to select the input channel on which the filter will be applied. If we want to apply the same filter to multiple channels we can do that just by selecting all the channels we want to filter.

A nice property of FIR is that the phase response is linear. The phase shift in time is half of the number of samples if the filter is calculated for the samples in the past.

Since Dewesoft X has the calculation delay, we can use the trick to compensate the filter delay and have absolutely no phase shift in pass as well as in the transition band of the filter. This is a major benefit compared to the IIR filter where we always have a phase shift.

For FIR filters you can set:

  • Filter type and Window type
  • Order (no. of taps)
  • Cut-off frequency (Flow and Fhigh)
  • Scale
  • Ripple (only with Kaiser window type)

You can see the effect of these settings directly in the Response/Coefficients preview for Filter type: Low pass, High pass, Band pass, Band stop and different Window types

Filter type

Low pass - low pass filter cuts the high frequencies of the signals.

High pass - high pass filter filters DC and low frequencies.

Bandpass - band pass filter filters high and low frequencies, so there is only one band of values left.

Band stop - band stop filter filters only one section of frequencies.

All-pass - an all-pass filter is a signal processing filter that passes all frequencies equally in gain but changes the phase relationship between various frequencies. It does this by varying its phase shift as a function of frequency.

Window type

The window defines the behaviour of the filter in the transition and the stop band (the height of the sidebands bands and the width of the main band). Window are explained in detail in our FFT guide.

Blackman or Kaiser - when more dynamic range is necessary (we want to see very small signal among large ones), Blackmankmann or Kaiser window is a better choice, because sidebands are 10 times lower than with the Hanning window. However, the sideband width is wider. Here it comes to the point - if more lines in FFT are chosen, we can use these windows and still larger sidebands have no real disadvantage.

Rectangle - the rule of thumb is when we want a pure transformation with no window‘s side effects (for advanced calculations), we should use Rectangular window (which is, by the way, equal to no window).

Hamming, Hanning - for general purpose, Hamming or Hanning windows are commonly used because they provide a good compromise between fall off and amplitude error (maximum of 15%). This comes from the fact that old frequency analysers didn‘t have that many possibilities in terms of frequency lines and these two windows have narrow sideband.

Flat top - if correct amplitudes are searched, we should use the flat-top window. The amplitudes would be wrong by only a fraction (as low as 1%). Of course, there is a penalty - neighbour frequencies are also very high (sideband width is high). This window is most suitable for calibration. But here it is the same: with modern equipment with lots of lines, this is no longer that much of a problem.

Order

The order of the filter defines the number of coefficients of the filter and that will directly affect the slope of the transition band. The filter order is not directly comparable to FIR filter.

Ripple (only with Kaiser window type)

When a Kaiser Window type is selected, new Ripple field appears on the right side of the Window type field. In this field, you can enter ripple value in dB. It tells the maximum allowed passband band ripple of the filter. The higher this value is, the bigger will be non-linearity in the pass band, but the filter will be stepper.


Cut-off frequency

The filter cutoff frequency defines the -6 dB point (half amplitude) of the filter. You can enter Cut-off frequency in field:

Fhigh (High frequency) - You can enter Fhigh for High pass, Band pass and Band stop filter.
Flow (Low frequency) - You can enter Flow for Low pass, Band pass and Band stop filter.
Flow and Fhigh - You can enter Fhigh and Flow for Band pass and Band stop filter.

Flow value must be always lower than FHigh. These values are limited by filter stability. In Dewesoft X, the filters are calculated in sections, which enable the ratio between cutoff and sample frequency in a range of 1 to 100000. So we are able to calculate 1 Hz high pass filter with 100 kHz sampling rate.

Scale


For filters, you can enter also Scale. Scale factor means the final multiplication factor before the value is written to output channel. It helps us to change the unit, for example.

When acquiring analog data with sharp transitions (like square waves) with 24 bit signal-delta ADCs (with an antialiasing filter), we can see some ringing. To eliminate ringing, or at least smooth it out, a FIR filter can be used.

Zoomed in region of the signal at sharp transition.

First we need to add the FIR filter. We can find a filter by clicking “add math” button under “math” tab as it was described on the previous page.

For best results, this is how to set up the filter:

  1. On the left, select the channel or channels on which the filter will be applied
  2. Use the low pass filter type
  3. Set the Fhigh to 1000 Hz
  4. Recommended Order (no. of taps) is 4

After applying the FIR filter, you can see below that the ringing has been smoothed.

Zoomed in region of the smoothed signal

Comparison of original (red) and smoothed (blue) signal.

The Custom defined filter setup requires:

  • number of sections and coefficients,
  • scale factor means the final multiplication factor before the value is written to output channel - for example it can be used to change the unit,
  • individual filter coefficients value.

A FIR filter consist of a single section, because it is stable by definition. IIR filters can have several sections.

We define the number of coefficients per section which are number of rows in the table. This basically defines the filter order.

The last thing to define are the filter coefficients. Enter a(input) and b(recur.) values in the z-plane and press the Update button to change the filter settings. We can also copy/paste the coefficients from the clipboard by right-clicking and choosing 'Copy to clipboard' or 'Paste from clipboard' menu item.

The question now is: how to define the coefficient? The answer to this question lies in the knowledge of filter design in s-plane and converting the filter to z-plane.

Usually, the filters are defined in the s-plane. Let's take a simple example of a general formula for a second order filter:

To get the filter coefficients in the z-plane (time domain coefficients) we need to use the bilinear transformation:

where fs is the sample frequency. The upper equation reveals an important fact of filters defined in the z plane - they work only for one sample rate. Therefore, if we need the filters at different sampling rates, the coefficients need to be recalculated.

If we substitute the s in the general formula for second order filter with the formula for bilinear transformation, we get:


The first third of the equation is valid for z0 coefficient, second third for z-1 and the third one for z-2. The upper part of the general formula for second order filter (with g coefficients) is valid for the input part while the lower part (with h coefficients) is valid for recursive part of the equation.

If we need higher order filter, we need to make the equation similar to upper equation with a larger number of the coefficients. The result will have also z-3 factor.

Let's now make a simple example for a second order Butterworth filter. It has the following prototype in the s-plane:

where the ωc is the cutoff frequency in rd/s. We have to adapt the cutoff frequency to the sample rate with pre warning:


If we write out the factors for this filter from a general equation:

Now let's make the following filter:

  • cutoff frequency: fc = 100 Hz
  • sampling rate: fs = 1000 Hz

First we do the pre warping. We can use a technique called pre warping to account for the nonlinearity and produce a more faithful mapping. The warping effect changes the band edges of the digital filter relative to those of the analog filter in a nonlinear way.


And now we need to calculate the coefficients for the direct and recursive part of the filter with substituting factors in the equation:







Finally, we set the number of coefficients to 3, number of sections to 1 and enter 6 calculated values in the table and press Update. All entered values are colored red and button Update also flashes until Update is pressed.


But we still have to normalize all the numbers to z0 in b(recur.) column (number in row z0 and in column b(recur.) must be set to 1)! To get the right coefficients, all other numbers must be divided with that particular number.

This means that the real values look like this:

After entering in all the right coefficients, we have to press the Update button. After updating the red color will disappear and the filter will be ready to use.


Remember, this is valid only for a sampling rate of 1000 Hz. For others, we need to recalculate the fcp and coefficients.

To make a second order Butterworth filter it is much easier with Dewesoft X standard filters, but if we need a specific filter, it is necessary to design it 'by hand'.

It is possible to import a custom filter from Matlab (registered trademark of MathWorks company).

To enter Filter Design & Analysis Tool in Matlab, write fdatool in Command window.

After that, the filter design window will show.

Design the IIR filter in Matlab and then click on the filter coefficients button. Filter coefficients should appear in SOS matrix form. That is how they are presented in Dewesoft X.

In Dewesoft X, you can't enter the scale factors so you just have to include them in the filter. One section in Dewesoft X equals one SOS section in Matlab. All you have to do is scale it the right way. First three coefficients in Matlab are input and are calculated by multiplying them with the coefficient by the corresponding scale factor. The second three coefficients are recursive and all you need to do is just to copy them from b.

These are calculation formulas for a specific section i:


a(input)b(rekur.)
z0Scale i * Section i(1)Section i(4)
z-1Scale i * Section i(2)Section i(5)
z-2Scale i * Section i(3)Section i(6)

The coefficients for our example are calculated below:

You can choose between Response curve preview and Coefficients display.

The red response curve shows the amplitude damping of the filter. The amplification ratio is expressed in dB (similar to IIR filter). The green curve shows the phase delay. In the pass band as well as in the transition band the phase delay is always zero and in the stop band the phase angle is not even important because of high damping ratio.

On Response curve preview you can choose between Logarithmic and Linear display, you can also edit coordinates value and auto scale Y axis.

The other display is the display of Coefficients. The upper graph shows the filter coefficients with which the raw data is convoluted. The lower graph shows the response of the filter to the step signal.

Let's look at the difference of the FIR filter compared to the standard IIR filter. Let's take a very simple 20 Hz second order filter (at 1 kHz sampling rate).

The IIR filter is calculated with 6 coefficients while similar FIR filter is calculated with 40 coefficients for the same damping. Therefore, the FIR filter is more CPU (central processing unit) demanding for the same performance.

Another fact is while we can get ratios of cutoff frequency to sample rate of 1/100000 and more, we can achieve only limited results with FIR filter. The ratio increases with higher number of coefficients.

Let's look at the response graph at 20 Hz (exactly at the limit). The green curve is the original sine wave while the red curve one is calculated with IIR filter. We can clearly see the phase delay of the output.

The blue curve is the response of the FIR filter which has absolutely no phase shift. For lots of applications, it is very important that the signals are not delayed and there the use of FIR filters is very advantageous.

We add a new Frequency domain filter

When you press the Setup button on the newly activated Frequency domain filter line, the following setup window will open. On the left side of the setup screen, we have to select the input channel on which the filter will be applied. If we want to apply the same filter to multiple channels we can do that just by selecting all the channels we want to filter.

Frequency domain filter description

This filter is quite different than the other types of filters. While IIR and FIR filters are time domain filters, frequency domain filter calculates the spectrum of the signal with specific number of lines and overlap and then extracts the RMS value of a certain range of this signal. Therefore, the result is not the full curve, but only one value per frequency spectrum.

The usage of this filter is to extract low peaks of signals where there are big harmonics nearby where it wouldn't be possible to choose IIR filter which would extract low amplitude.

The example below shows the electro motor winding failure which can be seen as low values at the rotation frequency where the line frequency is very high:

To set the frequency domain filter, it is recommended to observe the signal in the display and choose the right number of lines and a window which fits the best and then set the filter parameters.

Frequency domain filter calculation parameters

Number of lines


This defines the resolution of the filter as well as the number of points in the calculation. The resolution needs to be high enough so that the wanted harmonic can be clearly extracted, but not too high to have a lower result update rate.

Overlap


Overlap defines (same for FFT averaging) how many 'old' data is taken for the next calculation. This increases the result update rate with the same number of lines.

Window type

The window defines the behavior of the filter in the transition and the stop band (the height of the sidebands and the width of the main band).


Blackman - when more dynamic range is needed (we want to see a very small signal among large ones), Blackman window is a better choice because sidebands are 10 times lower than with the Hanning window. However, the sideband width is wider. Here it comes to the point - if more lines in FFT are chosen, we can use these windows and still larger sidebands have no real disadvantage.

Rectangular - the rule of thumb is when we want a pure transformation with no window‘s side effects (for advanced calculations), we should use a Rectangular window (which is, by the way, equal to no window).
Hamming, Hanning - for general purpose, Hamming or Hanning windows are commonly used because they provide a good compromise between falloff and amplitude error (maximum of 15%). This comes from the fact that old frequency analysers didn‘t have that many possibilities in terms of frequency lines and these two windows have narrow sideband.
Flat top - if correct amplitudes are searched, we should use the flat-top window. The amplitudes would be wrong by only a fraction (as low as 1%). Of course, there is a penalty - neighbor frequencies are also very high (sideband width is high). Flat top window is most suitable for calibration. But here it is the same: with modern equipment with lots of lines this is no longer that much of a problem.

RMS amplitude extraction parameters

When filter type is chosen as Tracking, RMS amplitude extraction parameters must be defined.

Frequency source


Fixed - fixed frequency will always take fixed value for the center frequency.

Tracking - tracking frequency means that the center frequency will depend on a second input channel (for example rotation frequency).


Center frequency

If we choose fixed frequency source, we need to enter the center frequency in Hz. The center frequency is the middle value of frequency for value extraction.

Delta frequency

In this field, you can enter delta frequency in Hz. This value depends on the wanted frequency band. It also depends on the window and number of lines (line resolution).

If we choose Tracking as Frequency source, we need to enter the Frequency channel and Number of harmonics instead of Center frequency:

Frequency channel

Frequency channel is the channel with a current frequency which needs to be extracted. The unit of this channel must be in Hz.

Number of harmonics

When tracking is selected as frequency source we have to also define the number of harmonics. Number of harmonics describes how many harmonics needs to be extracted from the spectrum. If we enter a value of 5, there will be 5 channels created for each input channel. First channel will have the center frequency as the frequency channel, second will have twice the frequency of the input and so on.

If Custom filter is selected from the Filter type, then we can design our own filter. With this option, we can create any type of the filter curve in the frequency domain and calculate RMS value. Sometimes it is not easy to define filter characteristics in the time domain, but we have it defined in the frequency domain. Custom FFT filter is perfect for such case.

If the frequency source is external, we can define the channel where the frequency is defined and the filter will change the characteristic to always filter correctly like in the time domain. This is especially useful for example for CA noise calculation on the external clock.

Mathematical operations such as derivation and integration are also a kind of a filter. Derivation is a kind of a low-pass filter and integration is a high-pass filter which can also filter DC component.

Derivation

The derivative of a function of a real variable measures the sensitivity to change of a quantity (a function or dependent variable) which is determined by another quantity (the independent variable).

For example, the derivative of the position of a moving object with respect to time is the object's velocity: this measures how quickly the position of the object changes when time is advanced.

The derivative of a function can be geometrically interpreted as the slope of the curve of the mathematical function f(x) plotted as a function of x. But its implications for the modeling of nature go far deeper than this simple geometric application might imply. Its importance lies in the fact that many physical entities such as velocity, acceleration, force and so on are defined as instantaneous rates of change of some other quantity. The derivative can give you a precise instantaneous value for that rate of change and lead to precise modeling of the desired quantity.

The derivate of the function f(x) evaluated at x=a gives the slope of the curve at x=a.

Double derivation

Double derivation of a function f is the derivative of the derivative of f. The second derivative measures how the rate of change of a quantity is itself changing. For example, the second derivative of the position of a vehicle with respect to time is the instantaneous acceleration of the vehicle, or the rate at which the velocity of the vehicle is changing with respect to time

Integration

The integral of the function f(x) over the range x=b to x=c gives the area under the curve between those points.

The integral of a function can be geometrically interpreted as the area under the curve of the mathematical function f(x) plotted as a function of x.

The integral gives you a mathematical way of drawing an infinite number of blocks and getting a precise analytical expression for the area. That's very important for geometry - and profoundly important for the physical sciences where the definitions of many physical entities can be cast in a mathematical form the area under a curve. The area of a little block under the curve can be thought of as the width of the strip weighted by (i.e., multiplied by) the height of the strip.

For example, finding the center of mass of a continuous body involves weighting each element of mass by its distance from an axis of rotation, a process for which the integral is necessary if you are going to get a precise value. A vast number of physical problems involve such infinite sums in their solutions, making the integral an essential tool for the physical scientist.

Double integration

Double integration is useful mainly to directly integrate displacement from acceleration, so use it for dynamic signals

To add a new derivation or integration math in Dewesoft X go to Add math section and select Integral, derivate.

Derivation and double derivation is used, as the name already suggests, to calculation derivation of chosen input signals. Here the application range is not divided into two areas since the procedure is similar in all cases. The basic calculation is simple: we subtract the current value from the previous one and divide by the time interval.

Derivation setup


However, this might produce very noisy signals, especially with high sampling frequency. We can look at the derivation of the 20 dB/decade growing filter in the frequency domain. Sometimes it is, therefore, nice to cut the high-frequency contents. We can choose an option to Filter high frequencies. We choose the Order (at least 2 for derivation and at least 3 for double derivation) and Fhigh - cutoff frequencies of the signal.

Let's assume the example of calculating acceleration out of speed of the vehicle. With a car it is a fact that we can't have the acceleration higher than for example 10 Hz coming from the real vehicle acceleration - higher values are basically vibrations.

So we can choose the 10 Hz as the Fhigh high frequency and just get the real vehicle acceleration. Scale - scaling factor is similar, here the input is divided into second for derivation and divided with second squared for double derivation. So let's calculate the scaling factor for example above:

km/hour/sec = 1000 m/3600 sec/sec = 0.278 m/s2 = 0.278 / 9,81 g = 0.0283 g

We have to enter this value in the scale field to get correct results.

Double derivation setup

There are two main purposes of integration: first is to get for example traveled distance from a measured velocity or to get the energy from a measured power. Another type of integration is to calculate the velocity vibration from the measured acceleration.

A clear difference between two basic functions is that in the first application the carrier of information is the DC value - the offset (traveled distance or spent energy). In the other application, the offset is only a measurement error and the carrier of information is the dynamic part of the signal - vibration velocity in our example.

For operations such as integration and derivation, we have to add the Integral, Derivative line from the Add math module. Once it has been added, go to Setup.

Here we can choose the desired operation and the channels we wish to modify:

Let's first take a look how to integrate distance from velocity. If we have for example velocity in km/h as an input channel, we choose it and switch OFF the option to 'Filter low frequencies and DC'. Now the only thing left is to define the Scale. We have to know that integration adds a sec to the unit

Example: So if we have km/h as input, we have km/h * sec = 1000 m / 3600 sec * sec= 0.278 m. Therefore, if we want to have the output in meters, we have to enter 0.278 as the scale factor. If we want to have the output in km, we have to enter 0.000278. Let's practice on another example - if we have input channel as power in kW, we have at output: kW * sec = kW * 1/3600 * h = 0.000278 kWh - this is our scaling factor.

The second application is to use integration on dynamic signals like vibration acceleration. If we have measured acceleration, there is always some offset because of amplifier and AD converter offset. This offset will result in drift of result, which is not wanted, in this case. Therefore, we need to use the option 'Filter low frequencies and DC' to cut this offset.

Then we need to define the Order. Be aware that integration is equivalent to a filter with order 1, so we need to choose a high pass filter with order 2 or higher to really cut DC values. The Flow tells us where the resulting velocity will be cut off. High values of Flow (like 10 Hz) will result in very fast stabilization in the case of overload, but it might on the other side already cut the information we require. Low values (< 1Hz) will result in quite slow stabilization times (typically 5÷10 seconds for 1 Hz filter) but will pass through virtually entire frequency range.

For vibration measurement, a usual value is from 3 to 10 Hz for general purpose measurement. For low-frequency vibration like a human body or building vibration, a value between 0.3 and 1 Hz is used. For special application, like sea sickness or high structures (like TV towers or cranes) movement a very low frequency like 0.1÷0.3 Hz is used, but we have to know that the stabilization will be a very long process. In this case, we also need to make sure that the sensors we are using have such low-frequency range. General purpose ICP sensors have the cutoff frequency between 0.3 to 1 Hz and, therefore, are not useful in such applications

Let's look at the Scale - scaling factor for this application. Let's assume that we measure the acceleration in g. If we want the results in mm/s, we need to have a scaling factor: 1 g * sec = 9,81 m/sec/sec * sec = 9,81 m/s = 9810 mm/s. So we need to enter 9810 in the field scaling.

Output unit

For output signal from our filter, we can choose from already defined units.

Double integration is useful mainly to directly integrate displacement from acceleration, so to use it for dynamic signals. Our output unit will be multiplied by sec*sec. Therefore we need to choose again the option to filter low frequencies and DC, but we have to take care since the double integration is similar to a second-order filter, we need to choose order 3 or higher for low-frequency filter.

Let's see how to calculate the Scale - scaling factor. Usually, we want the measurement result in μm (micrometers). So we have to enter a scaling factor of:

1 g * sec * sec = 9,81 m/sec/sec * sec * sec = 9,81 m = 9,81 * 106 μm.


Let's make an example with an accelerometer on a shaker, while recording with a high-speed camera.

Green is the signal from the accelerometer, red is the signal for velocity and blue is the signal for displacement.

We apply the velocity setup (integration setup).

Displacement setup (double integration).

Accelerometer at the top position - calculated displacement is consistent with the actual position of an accelerometer (camera).


Accelerometer at middle position - calculated displacement is consistent with the actual position of an accelerometer (camera).

Accelerometer at bottom position - calculated displacement is consistent with the actual position of an accelerometer (camera).

Because integration and derivation is a type of IIR filter, we have a phase delay between signals.

This is an example of how to measure the phase delay between signal. We will use math called Correlation (add it under math section). We have to calculate cross-correlation between two signals.

Add a 2D graph and apply on the cross-correlation. Select the Complex presentation as Phase (deg). We have to zoom in to get the phase at the frequency of the shaker (in our case, this was 50 Hz). According to the theory, the phase shift is 90°.

This website uses cookies to ensure you get the best experience on our website. Learn more