## FIR notch filter from a lowpass filter

Designs an FIR notch filter from a lowpass filter by computing the difference between the prototype lowpass filter and its amplitude complementary

## Sensors in Biomedical AIOT

Biomedical devices are at the forefront of AI and IOT (more often called AIOT). What is your most important reason to use sensors for biomedical devices?

## To control

• Does the patient follow the medical instructions? Examples: is he doing his therapy on time and in the right way. Does he take his medications?  Especially groups of risk can be monitored so that timely action can be taken if necessary
• Is treatment going well?  For both doctor and client alike. And even better:  You can optimize the healing process
• Do medically devices still give the right measurement?

## To optimize

• Optimize your treatment: Compare the treatment results from your client with your other clients. And thus, find out point of improvement
• Give attention for those who need it. Nobody wants to spend time unnecessary in a waiting room
• Better use of existing resources
• Connect systems with each other
• Take the right decisions at the right time
• Preventive maintenance Security

## To innovate

• Be at the forefront of medical developments
• Track & trace
• Create optimal circumstances with modern technology

## To save

• Give the client the best care
• Spend your budget where most needed
• To prevent is better than to cure
• Prevent greater suffering, avoid extra high costs
• Nobody is waiting for unnecessary treatment
• Preventive maintenance on medical devices prevents higher repair costs and downtime

## How biomedics can benefit from IoT:

• Improve the quality and effectiveness of your medical treatment with IoT and thus the quality of life for your patient
• Do you want to spend your time on patients who really need it? Treat more patients in a better way in the same time within the same budget
• Improve and fasten your patient’s recovery… with knowledge of results of the treatment of thousands of patients
• Be on the forefront of IoT and help your patients in ways that were not possible before
• Better measurement with clean data
• Security: get control of your patients’ privacy

Sensor devices improve the quality of treatment and thus of life itself. Through prevention, medical treatment itself or therapy. Sensors solutions help to improve life and can even help to save lives. No wonder medical devices are one of the fastest growing sectors in IoT.

Households want to benefit from the newest possibilities IoT devices deliver. For better health and independence as much and as long as possible. Sensor devices can especially help people with chronic diseases, elderly people and people who need constant supervision.

For medical service providers, sensor devices can help to provide the best service as possible in times of increasing medical demand but also on a growing focus on costs. So, budgets must be spent in the best way as possible. Sensors and other IoT devices can help medical facilities to treat more patients in a better way and more efficiently.

• IoT solutions
• Sensor measurement
• Security

## IoT solutions

Our systems prevent accidents from happening and reduce the response time of healthcare professionals.

## Sensor measurement

In biomedical applications, sensors are already used in a lot of ways. EMG and ECG are just some examples. For making the right decisions on treatment, the measurement has to be accurate. However, most sensor data suffer from the following problems:

• Powerline interference, measurement noise and glitches
• Biomedical sensors are sending weak signals. So, in some cases, those signals have to be strengthened before analysis is possible.

Sometimes the filtering is done in the hardware of the medical equipment. However, these are very costly solutions. And most of the times, a simpler solution and thus less costly solution is what is being sort after.

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 analyse and take action on clean and accurate sensor data.

## Practical noise reduction tips for biomedical ECG filters

In ECG signal processing, the Removal of 50/60Hz powerline interference from delicate information rich ECG biomedical waveforms is a challenging task! The challenge is further complicated by adjusting for the effects of EMG, such as a patient limb/torso movement or even breathing. A traditional approach adopted by many is to use a 2nd order IIR notch filter:

$$\displaystyle H(z)=\frac{1-2cosw_oz^{-1}+z^{-2}}{1-2rcosw_oz^{-1}+r^2z^{-2}}$$

where, $$w_o=\frac{2\pi f_o}{fs}$$ controls the centre frequency, $$f_o$$ of the notch, and $$r=1-\frac{\pi BW}{fs}$$ controls the bandwidth (-3dB point) of the notch.

### What’s the challenge?

As seen above, $$H(z)$$ is simple to implement, but the difficulty lies in finding an optimal value of $$r$$, as a desirable sharp notch means that the poles are close to unit circle (see right).

In the presence of stationary interference, e.g. the patient is absolutely still and effects of breathing on the sensor data are minimal this may not be a problem.

However, when considering the effects of EMG on the captured waveform (a much more realistic situation), the IIR filter’s feedback (poles) causes ringing on the filtered waveform, as illustrated below:

Contaminated ECG with non-stationary 50Hz powerline interference (IIR filtering)

As seen above, although a majority of the 50Hz powerline interference has been removed, there is still significant ringing around the main peaks (filtered output shown in red). This ringing is undesirable for many biomedical applications, as vital cardiac information such as the ST segment cannot be clearly analysed.

The frequency reponse of the IIR used to filter the above ECG data is shown below.

IIR notch filter frequency response

Analysing the plot it can be seen that the filter’s group delay (or average delay) is non-linear but almost zero in the passbands, which means no distortion. The group delay at 50Hz rises to 15 samples, which is the source of the ringing – where the closer to poles are to unit circle the greater the group delay.

ASN FilterScript offers designers the notch() function, which is a direct implemention of H(z), as shown below:

ClearH1;  // clear primary filter from cascade
ShowH2DM;   // show DM on chart

interface BW={0.1,10,.1,1};

Main()

F=50;
Hd=notch(F,BW,"symbolic");
Num = getnum(Hd); // define numerator coefficients
Den = getden(Hd); // define denominator coefficients
Gain = getgain(Hd); // define gain


## Savitzky-Golay FIR filters

A solution to the aforementioned mentioned ringing as well as noise reduction can be achieved by virtue of a Savitzky-Golay lowpass smoothing filter. These filters are FIR filters, and thus have no feedback coefficients and no ringing!

Savitzky-Golay (polynomial) smoothing filters or least-squares smoothing filters are generalizations of the FIR average filter that can better preserve the high-frequency content of the desired signal, at the expense of not removing as much noise as an FIR average. The particular formulation of Savitzky-Golay filters preserves various moment orders better than other smoothing methods, which tend to preserve peak widths and heights better than Savitzky-Golay. As such, Savitzky-Golay filters are very suitable for biomedical data, such as ECG datasets.

### Eliminating the 50Hz powerline component

Designing an 18th order Savitzky-Golay filter with a 4th order polynomial fit (see the example code below), we obtain an FIR filter with a zero distribution as shown on the right. However, as we wish to eliminate the 50Hz component completely, the tool’s P-Z editor can be used to nudge a zero pair (shown in green) to exactly 50Hz.

The resulting frequency response is shown below, where it can be seen that there is notch at exactly 50Hz, and the group delay of 9 samples (shown in purple) is constant across the frequency band.

FIR  Savitzky-Golay filter frequency response

Passing the tainted ECG dataset through our tweaked Savitzky-Golay filter, and adjusting for the group delay we obtain:

Contaminated ECG with non-stationary 50Hz powerline interference (FIR filtering)

As seen, there are no signs of ringing and the ST segments are now clearly visible for analysis. Notice also how the filter (shown in red) has reduced the measurement noise, emphasising the practicality of Savitzky-Golay filter’s for biomedical signal processing.

A Savitzky-Golay may be designed and optimised in ASN FilterScript via the savgolay() function, as follows:

ClearH1;  // clear primary filter from cascade

interface L = {2, 50,2,24};
interface P = {2, 10,1,4};

Main()

Hd=savgolay(L,P,"numeric");  // Design Savitzky-Golay lowpass
Num=getnum(Hd);
Den={1};
Gain=getgain(Hd);


## Deployment

This filter may now be deployed to variety of domains via the tool’s automatic code generator, enabling rapid deployment in Matlab, Python and embedded Arm Cortex-M devices.

## Contactless vital life signs measurement… Fact or science-fiction?

Generations have been entertained by the gadgets and future technology portrayed in Sci-fi series, such as Star Trek, but is it all science fiction?

The Tricorder

One device that intrigued me for years was the so called ‘Tricorder’ and the ability for the doctor to read a person’s vital life signs or VLS (e.g. heart beat and respiration) with a handheld device from about a metre away.

Back to the 21st century!

With advances in radar technology over the last few years, a few chip manufacturers are now producing affordable radar devices suitable for biomedical VLS measurement. Radar technology that used to cost thousands of Euros, and was primarily aimed a military technology, is now available for a few hundred Euros, making it viable for home medical products.

Sounds great, but what can UWB (ultrawide band) pulse doppler radar do?

• millimetre accuracy: allowing for detection of the smallest changes, such as respiration and heart rate from several metres away.
• Penetrates duvets, blankets and clothes: The virtue of the small wavelength ensures accurate detection of humans in a bed or sitting in chair watching TV or reading a book.
• Penetrates Walls and doors: Tracking of VLS and movement when radar is mounted within a ceiling or behind a wall – no ugly module on the wall!
• High sensitivity: able to see the VLS from tiny premature babies.
• Ultra-safe technology: RF emission is 0.01% the energy typically found in a household WiFi router – meaning that prolonged exposure will have no detrimental effects on human health.

After receiving a request from a client about monitoring the health of an eldery person living alone or in a nursing home, we decided to conduct a few tests of our own to see what was possible with this new technology.

VLS of a subject lying in bed

After building a demonstrator, and placing the radar sensor about 1 metre from a subject sleeping (similar to the doctor in Star Trek), we obtained the following waveform:

Captured VLS data captured from a UWB radar – containing both heart beat and respiration information

Wow! Was our initial reaction to the test data – this is millimetre movement through a duvet! Notice how slow the biomedical signal is, as an average adult’s respiration rate at rest is about 12bpm, requiring relatively long data acquisition times (tens of seconds) for meaningful data analysis.

What’s the respiration and heart beat?

Passing the signal through our algorithm, we could easily estimate the respiration (RR) and heartbeat (HB) from the plot (see the two red squares on the two peaks). However, in order to be objective, we attached a clip-on pulse oximeter to the subject finger, and as seen they matched very well.

What does this all mean for me?
Contactless VLS measurement for home use is closer than you think, and is certainly not science-fiction anymore. This technology opens up many possibilities for monitoring when normal sensors are infeasible, such as premature babies, patients with dementia and even sleep trend analysis. We’ll improve our algorithm in order to make it more robust and faster, but as seen our results are very promising indeed, and open up the possibility of contactless vital life signs (VLS) measurements for many practical applications!