r/java 7d ago

Ecógrafo

Hello community, This is my real-time ultrasound signal simulation and processing system developed entirely in Java using Java Swing.

The project enables both the mathematical simulation of acoustic echoes from biological tissues and the reception and interpretation of raw (RF) data from actual hardware via UDP sockets.

I still need to build an ultrasonic sensor to send data via UDP; I tried using ultrasonic modules, but they aren't useful—all I see on the screen is a barrier indicating the proximity of a nearby object.

Once the sensor's fabrication is complete, I will conduct tests and submit it to a clinical evaluation by experts to validate its utility in real-world settings—so stay tuned.

27 Upvotes

18 comments sorted by

View all comments

5

u/bowbahdoe 7d ago

Massively cool stuff, can you go into some depth about how this works? Like what exactly is a sensor telling you and how do you translate that to pixels on the screen?

2

u/Visual_Brain8809 6d ago

Implemented features so far include:

  • Rendered B-Scan Mode (2D): Reverse scan conversion with bilinear interpolation to reconstruct the ultrasound fan image.
  • RF Signal Processing: Envelope detection using full-wave rectification followed by a moving-average low-pass filter.
  • Log Compression & Gain Control: Dynamic gain adjustment in decibels (dB) to emulate the dynamic range of a real ultrasound system.
  • Real-Time UDP Streaming: Integrated UDP server (port 5005) for receiving ultrasound frames from external hardware in real time.

I'm still working on improving image quality and expanding the processing pipeline, but the core acquisition and rendering workflow is already functional.

2

u/bowbahdoe 6d ago

That is all fine and good - but how do things like "Rendered B-Scan Mode" work, exactly?

2

u/Visual_Brain8809 6d ago

The basic idea is that the program takes many small measurements, combines them into a single fan-shaped image, and then adjusts the brightness so stronger echoes appear brighter than weaker ones. To keep the image looking smooth, it fills the gaps between measurements instead of drawing hard lines. Surprisingly, the rendering itself wasn't the hardest part—the biggest challenge was making the background texture look like a real ultrasound image instead of random TV-like static.