## How to design FIR Filters in ASN Filter Designer

What are Finite Impulse Respsonse (FIR) Filters? And how to design FIR Filters in ASN Filter Designer and which filters does ASN Filter Designer support?

ASN Smart algorithms and technology offer the IoT approach and results you need.

Since 2006, ASN has successfully helped many international organisations. With data analysis, algorithms, security and successful implementations for their embedded IoT applications.

• 62 Tried & tested IP blocks that are used worldwide
• Combability with Arm Cortex-M technology, used in over 80% of IoT devices
• Biomedical ECG, EMG, Lab-on-chip and vital life signs algorithmic solutions
• High precision gas and flow rate measurement solutions
• Human/object radar based motion tracking
• Sensor signal processing

### 62 application IP Blocks

Our tried and tested application IP blocks are tried and tested worldwide for variety of IIoT/IoT applications, including:

• Biomedical (EMG, ECG, vital life signs, lab-on-chip)
• Smart Grids
• Machine and motor maintenance
• Oil and gas
• Smart street lighting
• Noise cancellation
• Industrial sensors

### Compatibility with Arm Cortex-M technology

The ASN Filter Designer has an automatic code generator for Arm Cortex-M cores. This means that we support virtually every Arm based demo-board: ST, Cypress, NXP, Analog Devices, TI, Microchip/Atmel. And over 200+ other manufacturers. Our compatibility with Arm’s industry standard CMSIS-DSP software framework removes the frustration of implementing complicated digital filters in your IoT application. As a result, you get code that is optimal for Cortex-M devices and that works 100% of the time.

### From algorithmic concept to NPD

Our NPD (product development process) provides a systematic and efficient way of productising a developed IoT algorithmic concept. This allows you to get your IoT application to market based on first time right principles.

### Biomedical ECG, EMG, Lab-on-chip and vital life signs

One of our specialised sectors is the one of biomedical. For this sector, our ASN Filter Designer is very suitable for data filtering of ECG and EMG. After data filtering, you can export your cleaned data to Matlab. Or immediately export it to an Arm microcontroller for deployment. In parallel to the ASN Filter Designer, we have developed algorithms for a Lab-on-chip and Vital Life Signs measurement.

### High precision gas and flow rate measurement solutions

One of our other specalisms are high precision gas and flow rate measurement solutions. Our comprehensive collection of application IP blocks has allowed many international companies to obtain outstanding measurement performance for their IoT applications!

And we can do much more for you… just ask us!

## How drones fuel ‘smart air’: air control and congestion

While the developments in the use of drones are going very fast, most of its use is still in an experimenting phase. Besides, the technique is working on an individual basis. From start-ups to big companies like Google, Amazon and UPS. Companies are experimenting by delivering pizzas on the beach. In the future, when drones have become widely adapted, a new form of air control must be developed. In crowded areas in particular. When drones might take up from anyplace and land anywhere anytime, air control is far more difficult than control of normal airplanes. And of course, delivery drones are supposed to work without human interference, even beyond sight from the owner of these drones.

## Communication

Drones need to communicate with each other, and with other participants of air traffic. Furthermore, questions about prevention from flying over fires and forbidden areas must be solved. For instance airports, strategic points as driveways and military zones. Taking in consideration they might fly of its course due to wind.

## Congestion

When pizza delivery will be just as common as delivery by scooter nowadays, a form of air congestion is going to take place as well. Companies are already proposing to use different ‘airlines’ for speedy delivery and slower registering traffic. But then, there must come a solution how to handle the event when delivery drones are in each other environment without colliding. Or to prevent that the whole traffic gets stuck because every device is waiting on other drones.

The ‘congestion’ takes also place in the use of frequencies. Drones use the same frequencies as a lot of other uses. For instance, airlines and military.

## Standardization and legislation

That means standardization and legislation is needed. Standardization, to make certain that drones from different users/companies can communicate with each other. And to make decisions to fly safely and as efficiently as possible. Like other kinds of traffic, legislation is needed to set some rules how all devices can participate in drone traffic and traffic in general. And, when industry won’t be able to solve the already issues mentioned on trust and acceptability, legislation might also come in to set restrictions in the use of drones.

## Final Thoughts

The application possibilities of drones are very promising for delivery and registration uses. It is still in its experimental phase. But with developments going fast, soon it will reach the maturity phase. For this, there are two-fold kind of challenges.

One of these are challenges on privacy, safety and security. These challenges have to be solved before their use will get widespread trust and acceptance. Besides, there are technical and communication issues: where multiple drones are being used – especially in cities- challenges how drones can and have to behave in traffic has to be solved.

In both challenges, sensors play a pivotal role in solving the technical questions. Find out more about Drones and DC motor Control

## Are you a logistics provider or art supporter? How Track and Trace helps you to defeat graffiti

For public infrastructure, removing graffiti costs millions of euro each year. Besides the direct costs, there are the costs of not using the equipment and environmental costs. And naturally, the trains, buses, metro, etc. are your visit card to customers.

## The thrill of success

Sometimes, graffiti can look beautiful. But mostly, it looks -and is- vandalism.

Non-removal is an invitation to even more graffiti. Tests in New York have turned out that the immediate removal of graffiti, at least the same day, discourages further graffiti. Besides, the subway of New York is guarded closely, so it has become difficult for vandals to create their painting.

To create something beautiful is mostly not the aim of the sprayers. Most painters do it for the ‘thrill’. The first thrill is to finish their work before they are noticed. The other is to see their work travelling the next day, knowing it will travel the whole country. There are solo-sprayers. But mostly, sprayers work in groups. Actions are being planned, to out-smarten the (railway) police.

Nowadays, public transport companies have guidelines when graffiti is noticed: an employer (e.g. the train manager notices the painting, signs a cleaning company and this company cleans the graffiti the same day with a mobile team.

But as the saying goes: prevention is better than curing! How can you diminish the change of graffiti paintings? Track & Trace solutions help.

## Know if someone enters your shunting yard unwanted

The shunting yard is a known spot for graffiti painters. At night, or just on the day itself because it’s easy to enter the premises.

Most marshal yards or guarded by security. However, because they are quiet, it is rather easy to enter the site and hide from security. Besides, most graffiti painters operate in groups. So, they are practiced to paint a wagon in no-time.

“Meanwhile I also know, also from stories that I hear from colleagues from the country, that such artists are unstoppable. We can make the gates so high, and the locks so wide, but if these people want it, they will succeed.”

The Dutch regional TV broadcast OogTV:

“Meanwhile I know, also from stories that I hear from colleagues from the country, that such artists are unstoppable. We can make the gates so high, and the locks so wide, but if these people want it, they will succeed.” (https://www.oogtv.nl/2019/05/gloednieuwe-treinen-ontsnappen-niet-aan-graffitikunstenaars-dit-is-zo-zonde/)

## How Tracy can help: perimeter and object guard

Track and trace can help preventing graffiti in 2 ways:

• Perimeter detection
• Object guard

Know if someone enters the marshal yard or any other perimeter. Act immediately on ‘strange’ behavior, such as: unidentified persons on the premises. Or persons at times when you expect nobody will be there.  So, you can prevent graffiti to take place or at least, to prevent the painter from finishing his ‘artwork’.

## How ASN Filter Designer eases DSP for engineers

DSP for engineers: the ASN Filter Designer is the ideal tool to analyze and filter the sensor data quickly. Create an algorithm within hours instead of days. When you are working with sensor data, you probably recognize these challenges:

• My sensor data signals are too weak to even make an analysis. So, strengthening of the signals is needed
• Where I would expect a flat line, the data looks like a mess because of interference and other containments. I need to clean the data first before analysis

Until now, you’ve probably spent days or even weeks working on your signal analysis and filtering? The development trajectory is generally slow and very painful.

In fact, just think about the number of hours that you could have saved if you had design tool that managed all of the algorithmic details for you. ASN Filter Designer is an industry standard solution used by thousands of professional developers worldwide working on IoT projects.

Our close collaboration with Arm and ST ensures that all designed filters are 100% compatible with all Arm Cortex-M processors, such as ST’s popular STM32 family.

## Challenges for engineers

• 90% of IoT smart sensors are based on Arm Cortex-M processor technology
• Sensor signal processing is difficult
• Sensors have trouble with all kinds of interference and undesirable components
• How do I design a filter that meets my requirements?
• How can I verify my designed filter on test data?
• Clean sensor data is required for better product performance
• Time consuming process to implement a filter on an embedded processor
• Time is money!

Designers hit a ‘brick wall’ with traditional tooling. Standard tooling requires an iterative, trial and error approach or expert knowledge. Using this approach, a considerable amount of valuable engineering time is wasted. ASN Filter Designer helps you with an interactive method of design, whereby the tool automatically enters the technical specifications based on the graphical user requirements.

## Fast DSP algorithm development

• Fully validated filter design: suitable for deployment in DSP, micro-controller, FPGA, ASIC or PC application.
• Automatic detailed design documentation: expediting peer review and lowing project risks by helping the designer create a paper trail.
• Simple handover: project file, documentation and test results provide a painless route for handover to colleagues or other teams.
• Easily accommodate other scenarios in the future: Design may be simply modified in the future to accommodate other requirements and scenarios, such as 60Hz powerline interference cancellation, instead of the European 50Hz.

## ASN Filter Designer: the fast and intuitive filter designer

The ASN Filter Designer is the ideal tool to analyze and filter the sensor data quickly. When needed, you can easily deploy your data for further analyze for tools such as Matlab and Python. As such it’s ideal for engineers who need and powerful signal analyser and need to create a data filter for their IoT application. Certainly, when you have to create data filtering once in a while. Compared to other tools, you can create an algorithm within hours instead of days.

### Easily deploy your algorithms to Matlab, Python, C++ and Arm

A big timesaver of the ASN Filter Designer is that you can easily deploy your algorithms to Matlab, Python, C++ or directly on an Arm microcontroller with the automatic code generators.

## Instant pain relief

Just think about the number of hours that you could have saved if you had design tool that managed all of the algorithmic details for you.

ASN Filter Designer is an industry standard solution used by thousands of professional developers worldwide working on IoT projects. Our close collaboration with Arm and ST ensures that the all filters are 100% compatible with all Arm Cortex-M processors.

How much pain relief can 125 Euro buy you?

Because a lot of engineers need our ASN Filter Designer for a short time, a 125 Euro license for just 3 months is possible!

## Preventive Maintenance and the challenges of qualified Personnel

Preventive Maintenance is one of the golden nuggets of IOT. How does this focus affect the deployment of personnel?

• Efficiencty of personnel: more and better results
• Challenge of scarcity of personnel
• The challenges of the aging engineer

## Efficiency of personnel: more and better results

There was and is a lot of attention what sensors can do for preventive maintenance: with preventive maintenance, huge costs of big repair costs are avoided by acting on time. One aspect in this way of thinking, was that existing personnel could work more efficiently. In old days, mechanics and engineers did their regular scheduled rounds of maintenance, where every device got similar time of attention, whether the device was in a bad state or not. Sensors measure the state of maintenance of devices real-time. As such, personnel can give attention to devices which really needs it. By using your existing personnel in this more efficient way, high personnel costs are saved because no other personnel would have been hired.

## Challenge of Scarcity of personnel

When Preventive Maintenance became popular some years ago as one of the fields of Internet of Things, the world was still in the last phase of the economic crisis. Industry has in some ways still crisis thought: yes, personnel is hard to find. But they don’t make the connection that efficiency has changed in the guise of ‘cost saver’ to ‘benefit most from opportunities’. Because personnel is so hard to find, industry has to use the available personnel as efficient and effectively as possible. Besides, engineering for infrastructure isn’t a popular study any longer. So, engineers are even harder to find.

With preventive maintenance with the aid of sensors, personnel can give attention to the devices which really needs them.

## The challenges of the aging engineer

There is more: most infrastructure has been built 20 years ago. Already, there’s the challenge that those engineers have moved on to other jobs. So, it’s very possible indeed that in a company, nobody knows how this infrastructure works exactly any longer. Last years, a new challenge has come up: those engineers are beginning to retire. That means that a pool of this specific knowledge is already decreasing and will even lessen more in the years to come. Therefore, it is very important to have measures for maintenance in place, before this knowledge has disappeared completely.

## Benefits:

• Create the future. Better serve your client, with solutions which weren’t possible until now!
• More satisfied customers
• More control on your processes
• Better Security

One of the most important areas for IoT is Preventive Maintenance. With the modern solutions, you can measure if assets are working properly. And if not, you can repair or replace them, even before those assets have created damage. Examples are:

• Are the industrial motors running properly?
• Is the oil pressure and quality still ok?
• Are there any glitches in the electrical wiring?
• How can I save on energy?

With IoT, you can give your equipment a longer lifetime and thus save on repair and replacement costs. Besides, you can spare on costs because you have grip on your processes. For instance: more efficiency on energy costs, better results through optimal deployment of employees

Your customers will become more satisfied with your services. With solutions which weren’t possible until now, products can ‘think’ for their users. In IOT, users raise the expectations and will be dissatisfied with devices which do not help them.

A dashboard helps you to view in one glance which assets are working properly and which are probably in need of repair or replacement. Further, you learn when, where and how intensely your assets are being used, so you use your assets more efficiently.

In a world of connected devices, security is very important. Hackers will try to break in: to steal, to cause harm or to shut down your devices. Without security, hackers can make their entry from anywhere: from one of your devices, but also an unsecured device from one of your employee’s at home. So, in the world of IOT, security of these devices is key.

## IoT solutions

IoT solutions prevent accidents from happening and reduce the response time for maintenance. As results, your costs of maintenance will be lower and equipment will have a longer lifetime through Preventive Maintenance.

Sensor measurement solutions look for deviations in normal use. So, you can act upon the first deviations and before the device isn’t working at all. Examples are:

• Monitoring the health of an industrial motor
• Monitoring oil quality in chain mechanisms
• Smart metering for saving energy

### Clean sensor data required for sensor fusion and accurate decision making

Sensor data (audio, pressure, temperature, weight, etc.) have to be measured. However, most sensor signals are disturbed by:

• Powerline interference and glitches.
• Environmental factors (including: dust and other contaminants).

ASN Consultancy is the modern way of working of algorithm design to separate the wanted sensor signals from the undesirable unwanted signals. So, you can analyze and take action on clean and accurate sensor data.

### Dashboard

Our tailormade dashboard solutions provide you all the information you need at one glance. So, you act on devices which are not working properly anymore. You can see the use of each device and can even predict the use in time, based on your history data. With this information, you can gain more efficiency or you can improve the satisfaction of your customers.

### Security

With a world where everything is connected, security is very important. Because of its importance, its size and the results of an eventual disruption, infrastructure is an important target for terrorist and (future) enemy governments.

## Container thefts increasing; IOT Track and Trace helps

Container thefts are increasingly common. “What should you do with such a thing?” headlines the newspaper article. Recently, the police found a number of containers that were once stolen. Tracy, the IOT track and trace device, can help you.

## Why should someone want to steal a container?

So, why should someone want to steal a container? For an outsider, it might sound a bit strange. Customers see the container mostly as a kind of large, metal ‘box’ to dispose waste. For a container company, the hiring of the container means trust in your logistic solutions. But for a thief, a container means an easy to steal loot: it’s already packed and stands ready to pick-up!

## Stealing is that simple: the scrap metal booty is already packed!

Stealing containers with scrap metal is especially popular. That does not have to mean that a container actually contains scrap metal or is completely full: the thief’s hope for loot is enough. Stealing a container is pretty simple: all the thief needs is a truck. He can put the container on the back with a cable or grab arm in no time. This theft means a major loss for companies: a container can easily cost 5 to 10 thousand euros, beside the eventual value of the cargo. And possibly the trust the customer has in you.

All that most companies do untill now is to share on social media camera images of their container or the truck that was stolen. Hoping to find the thief. Or at least to prevent a recurrence.

## Tracy IoT helps: track and trace

• Perimeter detection

• Track and trace on container: Immediate theft signal

### Perimeter detection

Tracy checks whether persons enter the site. When “strange” people enter the site, a signal is immediately triggered. Besides, Tracy monitors the movement of people and assets within the perimeter. Tracy uses Ultra Wide Band (UWB). One of the big advantages of UWB is its accuracy, so you know immediately where to look.

### Track and trace on container: Immediate theft signal

When there are movements around a container, a signal goes off. If these are “strange”, for example at late times when nobody should be present, you can take immediate action. If the container is taken along anyway, it can be detected by the UWB signal.

## Linear phase IIR filters – analysis and design

Although the design of FIR filters with linear phase is an easy task. This is certainly not true for IIR filters that usually have a highly non-linear phase response, especially around the filter’s cut-off frequencies. This article discusses the characteristics needed for a digital filter to have linear phase, and how an IIR filter’s passband phase can be modified in order to achieve linear phase using all-pass equalisation filters.

## Why do we need linear phase filters?

Digital filters with linear phase have the advantage of delaying all frequency components by the same amount, i.e. they preserve the input signal’s phase relationships. This preservation of phase means that the filtered signal retains the shape of the original input signal. This characteristic is essential for audio applications as the signal shape is paramount for maintaining high fidelity in the filtered audio. Yet another application area that requires this, is ECG biomedical waveform analysis, as any artefacts introduced by the filter may be misinterpreted as heart anomalies.

The following plot shows the filtering performance of a Chebyshev type I lowpass IIR on ECG data – input waveform (shown in blue) shifted by 10 samples ($$\small \Delta=10$$) to approximately compensate for the filter’s group delay. Notice that the filtered signal (shown in red) has attenuated, broadened and added oscillations around the ECG peak, which is undesirable.

In order for a digital filter to have linear phase, its impulse response must have conjugate-even or conjugate-odd symmetry about its midpoint. This is readily seen for an FIR filter,

$$\displaystyle H(z)=\sum\limits_{k=0}^{L-1} b_k z^{-k}\tag{1}$$

With the following constraint on its coefficients,

$$\displaystyle b_k=\pm\, b^{\ast}_{L-1-k}\tag{2}$$

$$\displaystyle z^{L-1}H(z) = \pm\, H^\ast (1/z^\ast)\tag{3}$$

Analysing Eqn. 3, we see that roots (zeros) of $$\small H(z)$$ must also be the zeros of  $$\small H^\ast (1/z^\ast)$$. This means that the roots of $$\small H(z)$$ must occur in conjugate reciprocal pairs, i.e.  if $$\small z_k$$ is a zero of $$\small H(z)$$, then $$\small H^\ast (1/z^\ast)$$ must also be a zero.

## Why IIR filters do not have linear phase

A digital filter is said to be bounded input, bounded output stable, or BIBO stable, if every bounded input gives rise to a bounded output. All IIR filters have either poles or both poles and zeros, and must be BIBO stable, i.e.

$$\displaystyle \sum_{k=0}^{\infty}\left|h(k)\right|<\infty \tag{4}$$

Where, $$\small h(k)$$ is the filter’s impulse response. Analyzing Eqn. 4, it should be clear that the BIBO stability criterion will only be satisfied if the system’s poles lie inside the unit circle, since the system’s ROC (region of convergence) must include the unit circle. Consequently, it is sufficient to say that a bounded input signal will always produce a bounded output signal if all the poles lie inside the unit circle.

The zeros on the other hand, are not constrained by this requirement, and as a consequence may lie anywhere on z-plane, since they do not directly affect system stability. Therefore, a system stability analysis may be undertaken by firstly calculating the roots of the transfer function (i.e., roots of the numerator and denominator polynomials) and then plotting the corresponding poles and zeros upon the z-plane.

Applying the developed logic to the poles of an IIR filter, we now arrive at a very important conclusion on why IIR filters cannot have linear phase.

A BIBO stable filter must have its poles within the unit circle, and as such in order to get linear phase, an IIR would need conjugate reciprocal poles outside of the unit circle, making it BIBO unstable.

Based upon this statement, it would seem that it’s not possible to design an IIR to have linear phase. However, a discussed below, phase equalisation filters can be used to linearise the passband phase response.

## Phase linearisation with all-pass filters

All-pass phase linearisation filters (equalisers) are a well-established method of altering a filter’s phase response while not affecting its magnitude response. A second order (Biquad) all-pass filter is defined as:

$$A(z)=\Large\frac{r^2-2rcos \left( \frac{2\pi f_c}{fs}\right) z^{-1}+z^{-2}}{1-2rcos \left( \frac{2\pi f_c}{fs}\right)z^{-1}+r^2 z^{-2}}\tag{5}$$

Where, $$\small f_c$$ is the centre frequency, $$\small r$$ is radius of the poles and $$\small f_s$$ is the sampling frequency. Notice how the numerator and denominator coefficients are arranged as a mirror image pair of one another.  The mirror image property is what gives the all-pass filter its desirable property, namely allowing the designer to alter the phase response while keeping the magnitude response constant or flat over the complete frequency spectrum.

Cascading an APF (all-pass filter) equalisation cascade (comprised of multiple APFs) with an IIR filter, the basic idea is that we only need to linearise the phase response the passband region. The other regions, such as the transition band and stopband may be ignored, as any non-linearities in these regions are of little interest to the overall filtering result.

### The challenge

The APF cascade sounds like an ideal compromise for this challenge, but in truth a significant amount of time and very careful fine-tuning of the APF positions is required in order to achieve an acceptable result. Each APF has two variables: $$\small f_c$$ and $$\small r$$ that need to be optimised, which complicates the solution. This is further complicated by the fact that the more APF stages that are added to the cascade, the higher the overall filter’s group delay (latency) becomes. This latter issue may become problematic for fast real-time closed loop control systems that rely on an IIR’s low latency property.

Nevertheless, despite these challenges, the APF equaliser is a good compromise for linearising an IIRs passband phase characteristics.

### The APF equaliser

ASN Filter Designer provides designers with a very simple to use graphical all-phase equaliser interface for linearising the passband phase of IIR filters. As seen below, the interface is very intuitive, and allows designers to quickly place and fine-tune APF filters positions with the mouse. The tool automatically calculates $$\small f_c$$ and $$\small r$$, based on the marker position.

Right clicking on the frequency response chart or on an existing all-pass design marker displays an options menu, as shown on the left.

## An IIR with linear passband phase

Designing an equaliser composed of three APF pairs, and cascading it with the Chebyshev filter of Figure 1, we obtain a filter waveform that has a much a sharper peak with less attenuation and oscillation than the original IIR – see below. However, this improvement comes at the expense of three extra Biquad filters (the APF cascade) and an increased group delay, which has now risen to 24 samples compared with the original 10 samples.

The frequency response of both the original IIR and the equalised IIR are shown below, where the group delay (shown in purple) is the average delay of the filter and is a simpler way of assessing linearity.

Notice that the group delay of the equalised IIR passband (shown on the right) is almost flat, confirming that the phase is indeed linear.

## Automatic code generation to Arm processor cores via CMSIS-DSP

The ASN Filter Designer’s automatic code generation engine facilitates the export of a designed filter to Cortex-M Arm based processors via the CMSIS-DSP software framework. The tool’s built-in analytics and help functions assist the designer in successfully configuring the design for deployment.

Before generating the code, the IIR and equalisation filters (i.e. H1 and Heq filters) need to be firstly re-optimised (merged) to an H1 filter (main filter) structure for deployment. The options menu can be found under the P-Z tab in the main UI.

All floating point IIR filters designs must be based on Single Precision arithmetic and either a Direct Form I or Direct Form II Transposed filter structure. The Direct Form II Transposed structure is advocated for floating point implementation by virtue of its higher numerically accuracy.

Quantisation and filter structure settings can be found under the Q tab (as shown on the left). Setting Arithmetic to Single Precision and Structure to Direct Form II Transposed and clicking on the Apply button configures the IIR considered herein for the CMSIS-DSP software framework.

Select the Arm CMSIS-DSP framework from the selection box in the filter summary window:

The automatically generated C code based on the CMSIS-DSP framework for direct implementation on an Arm based Cortex-M processor is shown below:

The ASN Filter Designer’s automatic code generator generates all initialisation code, scaling and data structures needed to implement the linearised filter IIR filter via Arm’s CMSIS-DSP library.

## What we have learnt

The roots of a linear phase digital filter must occur in conjugate reciprocal pairs. Although this no problem for an FIR filter, it becomes infeasible for an IIR filter, as poles would need to be both inside and outside of the unit circle, making the filter BIBO unstable.

The passband phase response of an IIR filter may be linearised by using an APF equalisation cascade. The ASN Filter Designer provides designers with everything they need via a very simple to use, graphical all-pass phase equaliser interface, in order to design a suitable APF cascade by just using the mouse!

The linearised IIR filter may be exported via the automatic code generator using Arm’s optimised CMSIS-DSP library functions for deployment on any Cortex-M microcontroller.