← Back to Portfolio

Research Project · Machine Knitting

Knitted Acoustic Barcode

A knitted barcode that embeds binary data in the spacing between raised garter regions and decodes it from acoustic waveforms captured while sliding across the fabric.

  • Machine Knitting
  • Python
  • Acoustic Sensing
  • Signal Processing
  • K-means
Knitted Acoustic Barcode sample with detected acoustic peaks and decoded bits

Physical Representation

Knitted Acoustic Barcode diagram showing 0 as two front-bed and two back-bed rows and 1 as two front-bed and four back-bed rows

The spacing between raised regions carries the data. Two front-bed rows stay fixed, while the number of back-bed rows changes the acoustic interval shown in the diagram.

0

Short interval

2 front-bed rows + 2 back-bed rows

1

Long interval

2 front-bed rows + 4 back-bed rows

Encoding Workflow

01 · Data

Convert the source to binary

A number or UTF-8-encoded text becomes a sequence of 0 and 1 symbols.

02 · Structure

Expand bits into bed-row intervals

pattern-generator.js maps each bit to its front-/back-bed run, adds margins and repeated marker structure, and creates inverse upper and lower halves.

03 · Pattern

Generate a machine-readable image

The generator writes a red/green PNG in which color identifies front- and back-bed knitting.

04 · Knitout

Translate pixels into machine operations

image-kp.js reads the bed assignment, inserts loop transfers where needed, and outputs a Knitout .k program for the knitting machine.

Open-source tool: image-kp.js in CMU Textiles Lab's Knitout Examples ↗ converts a color-coded image into a knit/purl sheet in Knitout format.

Decoding Workflow

01 · Scan

Record the raised structure

A probe with a contact microphone slides across the fabric, and its piezo signal is captured through the USB audio interface.

02 · Filter

Expose the contact events

The raw waveform passes through fourth-order 50 Hz high-pass and 500 Hz low-pass Butterworth filters, then its absolute value is taken.

03 · Peaks

Measure the acoustic spacing

Peaks above 40% of the processed global maximum are detected with at least 40 ms separation. The decoder measures every peak-to-peak interval.

04 · Bits

Recover the binary sequence

Deterministic one-dimensional K-means splits intervals into short 0 and long 1 clusters, then concatenates the labels into a bit string. The current decoder reads all detected intervals in the selected recording window.