Sie sind auf Seite 1von 5

1

Daniel Bloshkin, Charles Eley, Savannah Mosiman, Andrew Heberger


DSP Final
Project Breath Detector (May 2015)

AbstractPneumonia is a problem that is not being properly


detected by current equipment and standards. This called for a
development of a new system that could be used to help detect
early development of pneumonia in young children. This system
needed to be able to detect abnormally low or high breathing
rates and signify these dangerous symptoms to someone that can
help. A cheap and easy way to test for abnormal breathing rates
was to use a temperature sensor that is connected to a
microcontroller and uses a filter structure to detect the
dangerous breathing levels. The system needed to be able to
detect breathing below twelve breaths per minute and higher
than forty breaths per minute. The initial diagnostics of the
system called for cascading three filters together to detect this
wide breathing range. By having three filters and comparing the
variance from each, it was easy to see which frequency range the
input was in. This allowed the system to correctly tell which
range the breathing was in and alert a user if there were
dangerous conditions.

I. INTRODUCTION
Pneumonia is now the leading killer of young children. It
has been found that pneumonia occurs most frequently in
childhood than any other age. It has become increasingly
difficult to identify the development of pneumonia in children
due to the lack of available laboratory tests for these
pathogens. A new system needed to be developed to help
detect these conditions and help diagnose pneumonia. By
monitoring the respiration rates of young children, lives can
be saved in all areas, especially in those that lack available
medical options. A respiration rate monitor is much more cost
efficient that creating a bigger system, and can be
implemented in peoples homes to help diagnose this
problem.

frequency range was considered to be healthy breathing. The


final range was anything over forty breaths per minute. This
range was used to detect similar respiratory infections.
Each filter was designed and tested individually to make
sure each piece of the system worked correctly independently,
and then could be integrated later without worrying of one of
the filters not functioning properly. The design constraints
allowed the filters to be any order and either a FIR or IIR.
Due to the memory constraints, all of the filters were chosen
to be IIR filters so that the memory usage was optimized.
Infinite impulse response filters use recursion so they are
more memory efficient than the finite impulse response which
uses convolution to transform the input. Also, each filter was
chosen to be a fourth order Chebyshev filter so that the roll off
was high enough at the corner frequencies but also so a
manageable amount of memory was used to store the filter
coefficients.
The plan was that once each filter was finished, known
sinusoidal waveforms were to be sent through the
independent filters. Refer to known generated sinusoidal
input in the appendix for more information as to how it was
created. By sending these known sinusoids through the filter
it would be easy to see how the system responded to the input.
By knowing the input, the desired output is also known.
Therefore, if the output was not what was expected, then the
filter was designed incorrectly and not applying the correct
transform to the input.

The specifications of the system were limited to a cheap 8bit microprocessor, a 10 bit A/D converter, and only 2k of
RAM memory. Also, a LM 61 temperature sensor was
allowed but no other components. By only using these
components it was ensured that a cheap system would be
developed that could be easily recreated in peoples homes to
help with this problem.
II.DISCUSSION AND RESULTS

At the beginning of the development it was decided that


three filters would be used. Each would be a bandpass filter
that covers the three frequency ranges of breathing. The first
range was used to detect dangerously low breathing, the
second detected normal breathing, and the third detected
abnormally high breathing. The frequency range used to
classify the breathing as abnormally low was from one to
eleven breaths per minute. A breathing rate in this frequency
range would signify a possible respiratory infection such as
pneumonia. The normal breathing range went from twelve to
thirty-nine breaths per minute. Any signal that landed in this

Figure 1: The first filter in the system when a low and high frequency input are
put through the system.

Figure 1 shows the output waves of the first IIR filter when
a low and high frequency wave were passed through. The first
bandpass filter was designed to pass signals that were
between one and eleven breaths per minute. The input signal
that generated the low frequency output had a frequency of
five breaths per minute and it can be easily seen that the filter
passed the signal. However, the input signal that generated
the high frequency output had a frequency of fifty breaths per
minute. Since this first filter had a cutoff at one and eleven it
is easy to see how the filter did not let the signal pass though.

2
In order to get this information known input signals were sent
through the single filter to make sure it was working
correctly. This verified that the first bandpass filter was
working as expected and the next step was to test the middle
filter that detected normal breathing in a range of twelve to
thirty-nine breaths per minute.

Figure 2: The second filter in the system when a low, medium and high frequency
input are put through the system.

Figure 2 shows the output waves of the second IIR filter


when a low, medium, and high frequency wave were passed
through. In order to test the middle bandpass filter three
separate inputs were put into the filter. One was below the
first cutoff with a frequency of five breaths per minute and
expected to not be passed through the system. The second
input was right in the middle of the frequency range with a
value of twenty breaths per minute. The final input was
passed the upper cutoff frequency with a value of fifty breaths
per minute and was also expected not to be passed through
the system. The graph shows that the low and high input
waves resulted in a truncated output and the middle frequency
input passed through which means the middle bandpass filter
was working as expected.

Figure 3: The final filter in the system when a low and high frequency input are
put through the system.

Figure 3 shows the output waves of the final bandpass filter


when a low and high input signal was put through the system.
This final filter had a low cutoff at forty breaths per minute
and a high cutoff at one hundred fifty breaths per minute. The
first input had a frequency of five breaths per minute and that
was blocked by the filter as expected. The high input signal

had a frequency of fifty breaths per minute and was passed


through the system and the output looked pretty similar to the
input. This shows that the final filter was working as
expected.
After all three filters had been fine-tuned and confirmed to
be working as expected it was time to cascade them all to
create the desired system. Finally, all three filters were
implemented in the Arduino code and optimized to conserve
memory and fit under the design specifications. With all of
the filters in place it was important to test the system as a
whole before continuing. This was done by sending the same
known sinusoidal wave forms through the new system.
Now that all of the filters had been cascaded together a
trigger was needed to determine which filter the input signal
resided. This was important because depending on which
region of frequency the input was in, different things needed
to happen. For an input that landed in the abnormally low
breathing zone, a noise needed to be generated in a speaker to
let the user know that either the system was not connected
properly or that the breathing was extremely low and there
could be a possible respiratory problem. When the input lands
in the normal breathing rate zone nothing is supposed to
happen. However when the breathing signal lands in the
abnormally high zone a different sound is needed to be played
and a light needs to turn on indicating a warning about being
in the high breathing zone.
A trigger was generated in order to determine which
frequency zone the input to the system landed in. This was
done by finding the running average of each filter. Once the
average was found the variance of the data was calculated for
each filter. Then, each variance from each of the three filters
in cascade was compared to find which frequency zone the
input was located. The logic to do this can be found in the
appendix but the explanation is as follows. It was found that
at times that all of the variances were less than twenty that
the system should report that there is no breath being detected
at all and that would result in a low breathing rate warning.
Once that condition had been checked for the next step was to
check if the variance from the middle filter was higher than
the variance of both the first and last filter. This would locate
the breathing input in the middle filter which symbolized
normal breathing. The next condition was to check if the
input was in the high breathing zone by seeing if the final
variance was higher than the first two. The final condition
checked to see if the variance from the low breathing rate
filter was higher than the other and if so it would represent a
low breathing warning. By using these trigger condition the
system could correctly detect low, normal, or high breathing
rates and respond accordingly with sounds and lights based
on the location of the input.
Arduino code was needed to generate the audio tones and
blink the LED. The sample code that was used to implement
these features can be found in the appendix. The sounds and
LED blinking were put into the trigger conditions explained
above. If a low warning was detected the LED would be

3
turned off if it was already on and a sound would be outputted
to signify that the breathing was in the low frequency zone. If
the input was detected in the middle of the system the LED
was turned off and no sound was played. Lastly, if the
breathing rate was located in the high breathing zone then the
LED would be turned on and a different audio tone would be
played to signify high breathing.
The output of the Arduino program was used to provide
useful information such as the variances from each of the
three filters and the execution time and whether there was a
low or high warning or if the breathing was normal. This is
shown in the following figure.

Figure 5: Output from Arduino program after a high frequency input went
through.

Figure 5 shows the Arduino output from a high breath


input. This is the final possible condition that can result from
the system and now the warning is that the breathing rate is
in the high frequency zone. This time the variance from the
final bandpass filter is the highest signifying that the input
had a frequnecy that was located in the range of forty to one
hundred fifty breaths per minute.

Figure 3: Output from Arduino program after a low frequency input went
through.

Figure 3 shows the output information from the Arduino


program serial monitor when a low breathing rate is sent
through the system. It is clear that the highest variance is
from the low bandpass filter and it says that a low warning is
detected. When this happens, a flat line audio tone is
generated.

Figure 6: The system diagram during the testing phase.

Figure 4: Output from Arduino program after a medium frequency input went
through.

Figure 4 shows the Arduino output from a medium breath


input. This time the output says that the breath was good and
in a normal range. This happens because the breath rate
frequency lies within the middle bandpass filter zone. The
variance from the middle bandpass filter is the highest in this
case and the trigger chooses the middle filter as the location
of the input signal. No physical indicators are used in this
case because the breathing is normal and no resperitory
infections should be present.

Figure 6 shows Arduino board set up with a small circuit


that contains an LED and a speaker. This is the
implementation used when testing the system. When the
system detects high breathing the LED turns on the the
speaker generates a tone. When the system detects a low
breathing rate only a audio tone is generated. This figure does
not show the temperature sensor used as it was only placed
into the circuit when the actual demonstration was being
conducted. At first a through hole LM-61 temperature sensor
was used during the testing phase but when it was time for
the demonstration a surface mount LM-61 was used. The
surface mount component was used for the demonstration
because it is more accurate. Since it is smaller is has a lesser
surface area which causes the mass to be smaller and the rate
at which the temperature changes to increase, meaning it is
more sensitive.
III. CONCLUSION
Overall, the results from this project show that a low cost
system can be built to test for pneumonia in young children.

4
This system is cost efficient and can be easily installed in
peoples houses to help reduce the number of people that
suffer from respiratory infections. By only using low cost
components and DSP filter concepts, a breath detector can be
used to help diagnose pneumonia.

APPENDIX
// Generating known sinusoids
float Freq = 0.0;
if (z == 0) {Freq = 0.01833;}
else if (z == 1){Freq = 0.01833;}
else {Freq = 0.02;}
for(int n=0;n<255;n++){
input[n] = 100.0*sin(2.0*3.14*Freq*n);}

// Setting the trigger


if (MedVariance<20 && HighVariance<20)
{ Serial.println("Low Warning");
// Play a sound }
else if (MedVariance > LowVariance &&
MedVariance > HighVariance)
{
Serial.println("Good");
}
else if (HighVariance > LowVariance
&& MedVariance < HighVariance)
{
Serial.println("High Warning");
digitalWrite(ledPin, HIGH);
// Play a sound
}
else if (LowVariance > HighVariance
&& LowVariance > MedVariance)
{
Serial.println("Low Warning");
// Play a sound
}

// Blinking the LED


int ledPin = 13;
pinMode(ledPin, OUTPUT);
// Turn the LED on
digitalWrite(ledPin, HIGH);
// Turn the LED off
digitalWrite(ledPin, LOW);
// Generating an audio tone
tone(8,1000);
delay(500);
tone(8,800);
delay(500);
tone(8,400);
delay(500);

5
REFERENCES
[1]

Lab: Final Project Description, Digital Signal Processing 0609-547,


R.I.T. Spring 2015.

[2]

A practical guide for the diagnosis and treatment of pediatric


pneumonia, CAN MED ASSOC J, March 1, 1997.

[3] Datasheet: LM61 2.7v, SOT-23 or TO-92 Temperature Sensor.

Das könnte Ihnen auch gefallen