Digital Phonocardiogram

Human–machine interface · final build

Static snapshot. Numbers and examples were computed on 2026-10-05 UTC from the committed model and results. The live monitor runs on the Raspberry Pi.

Hardware

How a sound becomes the numbers the software reads: the electronics, the filter that shapes the signal and the fixture that lets recordings be tested without patients.

Status of the build

Hardware build in progress

The hardware is not connected to this software yet. The sensor changed from a piezoelectric contact sensor to a microphone, and the microphone type is not final: it may be analog or digital (I2S). The hardware team will confirm the final chain.

Until then this page shows the design intent from the project report. It is not a built or measured circuit.

The signal chain

The sound reaches the microphone, and five more stages carry the signal to the Raspberry Pi. Hover, focus or tap a stage to read what it does.

Front end Microphone Protectionand clamp Voltageamplifier Bandpass20–600 Hz A D ADC Raspberry Pi If the microphone is digital (I2S), its amplifier and converter are inside it, and the band-limiting happens in software, as the feature code already does. Raspberry Pi 5

Scroll sideways to see the whole diagram.

Figure 1. The electrical signal chain, from the microphone to the Raspberry Pi. The symbols are generic; the protection circuit in particular is to be confirmed by the hardware team. Design intent — component values to be added by the hardware team
What each stage does and why
StageWhat it doesWhy it is there
MicrophoneTurns the sound that arrives through the silicone into a small electrical signal.It is the sensor. It replaced the piezoelectric contact sensor, and its type is not final.
Protection and clampLimits how far the voltage at the amplifier input can swing.A large spike must not reach, and damage, the amplifier. It was designed for the piezo sensor and will be checked for the microphone.
High-impedance voltage amplifierMakes the weak signal larger without drawing current from the sensor.A stage with a high input impedance does not load the sensor and weaken the signal. It is a voltage amplifier, not a charge amplifier: a decision already made.
Active bandpass, 20–600 HzPasses 20–600 Hz and attenuates everything outside it.Heart sounds and murmurs lie inside this band, and the high edge leaves headroom against aliasing before the converter. See the response chart below.
ADCTurns the filtered voltage into numbers (samples).The Raspberry Pi works with numbers. The interface (USB audio codec, I2S codec or SPI converter), and so the sample rate and bit depth, is not decided yet.
Raspberry Pi 5Cuts the samples into 5 s windows, extracts the features, runs the classifier and serves these pages.The analysis runs locally on the Pi, with no network or cloud service.

If the microphone is digital (I2S)

A digital I2S microphone has its amplifier and converter inside it, so the analog stages above would not be needed in the same form, and the band-limiting would happen in software. The feature code already band-limits every window to 20–600 Hz, so the classifier sees the same band either way.

The bandpass response

A bandpass filter lets a range of frequencies through and weakens the rest. This chart shows how much of each frequency gets through a 20–600 Hz bandpass filter, as a gain in decibels (dB). It draws two versions: the analog design the electronics are meant to follow, and the digital software model that the simulated condition applies to the recordings.

Frequency axis
Gain axis
Chart of the filter gain against frequency. This browser does not support the canvas element.

Figure 2. Gain of the bandpass filter against frequency. Both curves are computed from filter designs, not measured from a circuit. Design (software model)

Loading the filter design…

Why the low edge is 20 Hz

The first and second heart sounds (S1 and S2) have energy below 100 Hz, and the classifier uses them as timing landmarks to see the rhythm of the heartbeat. A higher low edge would cut them away, so 20 Hz is deliberate.

Why the high edge is 600 Hz

Murmur energy lies mainly between about 100 and 400 Hz, so 600 Hz keeps most of it with little attenuation. It also leaves headroom against aliasing (high frequencies folding down into the band when the signal is sampled), provided the converter samples fast enough; the sample rate is not decided yet.

Adding measurements

When the front end has been measured, the points can be drawn over the design curve. Create data/hardware/measured_response.csv with the header freq_hz,gain_db (or freq_hz,vout_over_vin, where a ratio is converted to dB with 20·log10) and one row per frequency, then reload this page. A row that cannot be read is reported with its line number.

The test fixture

To test the whole chain without patients, every test recording is played through a fixture: a loudspeaker inside a 3D-printed coupler, a cast silicone layer that mimics skin on top of it, and the sensor on top of that. The sensor therefore hears sound that has crossed the coupler and the silicone before the electronics see it.

3D-printed coupler Loudspeaker Cast silicone layer Microphone sound sound
Figure 3. The fixture in cross-section. A schematic, not to scale: no dimensions are given because none are decided yet.

Why a phantom?

A phantom is a stand-in for a body. Patient testing is not possible and is out of scope. A phantom gives exact ground truth, because the dataset says whether each recording has a murmur, and it is repeatable: the same recording can be played again and again, which also shows how much two captures of the same file already differ.

The thickness and hardness of the silicone layer have not been decided yet.

Photos and schematic

These slots fill with the hardware team's pictures. Put an image in hmi/static/img/hardware/ and reload; the slot is chosen by a word in the file name (schematic, breadboard or fixture).

Schematic Not added yet. Put a file with “schematic” in its name in hmi/static/img/hardware/.
Breadboard Not added yet. Put a file with “breadboard” in its name in hmi/static/img/hardware/.
Fixture Not added yet. Put a file with “fixture” in its name in hmi/static/img/hardware/.

Where to look in the code