Customer Stories

Respiri Develops Mobile App for Wheeze Detection and Asthma Management

Challenge

Develop and implement an acoustic respiratory monitoring system for wheeze detection and asthma management

Solution

Develop algorithms for detecting wheeze and ambient noise in MATLAB, and use MATLAB Coder to generate code from the algorithms for mobile devices and a web server

Results

  • Manual coding effort reduced
  • Algorithm development iterations accelerated
  • Code maintenance overhead reduced

“MATLAB enables us to rapidly develop, debug, and test sound-processing algorithms, and MATLAB Coder simplifies the process of implementing those algorithms in C. There’s no other environment or programming language that we could use to produce similar results in the same amount of time.”

The AirSonea device and mobile app housing the wheeze analysis algorithms.

Managing asthma can be difficult for both the physician and the patient. When physicians assess asthma patients in a clinical environment, they listen for wheezing, a primary sign of asthma and an indication of obstructive airflow in the lungs. But when physicians cannot examine patients directly, they must rely on the patients or patients’ parents to describe the wheezing and any other symptoms. This self-reporting of asthma symptoms and current condition is unreliable, particularly when the patient is a child.

Engineers at Respiri have developed technology that asthma patients can use to record and analyze their own breathing. Instead of listening for wheeze sounds, the AirSonea® technology detects wheeze patterns in an image created from recorded breath sounds. Respiri used MATLAB® to develop acoustic respiratory monitoring algorithms, and used MATLAB Coder to implement them as a mobile app and cloud-based server software.

Challenge

Respiri needed to develop an algorithm capable of identifying wheeze sounds of varying frequency, amplitude, and duration from 30-second audio recordings produced by a specialized sensor held near the patient’s trachea. To minimize the effects of ambient noise, the team needed to measure and analyze sounds from the user’s environment.

Partnering with Two Bulls, an app development company in Melbourne, they decided to create an app that would process recordings on the mobile device, invoke the wheeze analysis algorithm, and return results to the patient. The app would also provide an independent evaluation of external noise by using the mobile device’s built-in microphone to record ambient sounds.

In the past, it took months for Respiri engineers to manually code algorithms in C. They needed a way to rapidly translate their algorithms for wheeze detection and ambient noise analysis into C code that could be deployed on a mobile device.

Solution

Respiri engineers used MATLAB and Computer Vision Toolbox to develop the wheeze detection algorithm. The algorithm converts the 30-second audio recording into a spectrogram and then analyzes the spectrogram to identify potential wheeze candidates based on energy patterns and other common characteristics of wheeze. The algorithm performs further processing to reject false positives.

To develop the ambient noise detection algorithm, the engineers applied a Hamming window, performed a fast Fourier transform, and located spectral maxima in multiple frequency ranges using MATLAB and Signal Processing Toolbox.

After debugging and testing both algorithms in MATLAB, the team used MATLAB Coder to generate executable functions from their MATLAB code. This step enabled the team to verify that the code was suitable for code generation and to check for run-time errors.

Next, the engineers used MATLAB Coder to generate C code from the algorithms. To verify the generated code, they invoked it from within MATLAB and compared the results with the results produced by the original MATLAB algorithms.

In a subsequent round of testing, the engineers compiled the generated C code using Microsoft® Visual Studio®, and again compared results for verification.

The team integrated the C code for the noise detection algorithm and wheeze detection into an app for Apple iPhone; a version for Google® Android devices is planned.

The final system was tested in an anechoic chamber using test software that the team had developed with MATLAB and MATLAB Coder.

AirSonea is awaiting FDA clearance in the United States and has received Conformité Européenne (CE Mark) certification in the European Union and TGA approval in Australia.

Results

  • Manual coding effort reduced. “On similar projects in the past, we had to recode our algorithms in C and then debug the C implementation,” says Yulya Goryachev, senior algorithm engineer at Respiri. “Now, we generate the C code automatically with MATLAB Coder, which requires significantly less time and effort.”

  • Algorithm development iterations accelerated. “After making a change to an algorithm, we simply re-generate the C code and test it immediately,” says Goryachev. “Previously, the engineers had to rely on C programmers. If they were busy with other projects, it was often days before they could implement the changes.”

  • Code maintenance overhead reduced. “Maintaining the algorithm and C source code separately required the full-time effort of a software engineer,” notes Goryachev. “MATLAB Coder enables us to maintain one algorithm in MATLAB and convert it to C at release time, freeing that engineer to work on other projects.”