quadratic residue diffuser calculator
Quadratic Residue Diffuser Calculator guide
A one-dimensional quadratic residue diffuser uses parallel wells of equal width and different depths. Choose an odd prime number of wells and enter the lowest design frequency you want to use for the depth sequence. Read the table from left to right across one period. Measure each quoted depth down from a common face plane.
Play the instrument ↑- Default result
- 98 mm deepest well
Calculation and units
For well n in a period of P wells, start with n = 0 and take the remainder of n squared divided by P. Multiply this integer by c divided by 2Pf, where c is metres per second and f is hertz. The factor of two accounts for the trip into the well and back out. Convert metres to millimetres after applying the residue.
Worked examples
Select a named case in the Worked example control to load these values. You can then edit any input to compare the result.
Seven wells at one kilohertz
Prime well count = 7 · Design frequency (Hz) = 1000 · Speed of sound (m/s) = 343.
98 mm deepest well. One depth step is 24.5 mm. Residues from well zero: 0 1 4 2 2 4 1. Depths run from the common front plane to each well floor. Table readings (Well, Residue, Depth (mm)): 0, 0, 0; 1, 1, 24.5; 2, 4, 98; 3, 2, 49; 4, 2, 49; 5, 4, 98; 6, 1, 24.5.
Squares modulo seven produce a mirrored pair of depth patterns around the central boundary. Label the flush well zero before transferring numbers onto the backboard.
Lower design octave
Prime well count = 7 · Design frequency (Hz) = 500 · Speed of sound (m/s) = 343.
196 mm deepest well. One depth step is 49 mm. Residues from well zero: 0 1 4 2 2 4 1. Depths run from the common front plane to each well floor. Table readings (Well, Residue, Depth (mm)): 0, 0, 0; 1, 1, 49; 2, 4, 196; 3, 2, 98; 4, 2, 98; 5, 4, 196; 6, 1, 49.
Keep the well count fixed and halve the design frequency. All depths double because a wave travels twice as far during the same fractional cycle.
Higher design octave
Prime well count = 7 · Design frequency (Hz) = 2000 · Speed of sound (m/s) = 343.
49 mm deepest well. One depth step is 12.25 mm. Residues from well zero: 0 1 4 2 2 4 1. Depths run from the common front plane to each well floor. Table readings (Well, Residue, Depth (mm)): 0, 0, 0; 1, 1, 12.25; 2, 4, 49; 3, 2, 24.5; 4, 2, 24.5; 5, 4, 49; 6, 1, 12.25.
Higher tuning reduces the required cabinet depth. Check the narrowest practical well opening separately before assuming the shallower panel will work across the desired bandwidth.
Eleven well panel
Prime well count = 11 · Design frequency (Hz) = 1000 · Speed of sound (m/s) = 343.
140.31818 mm deepest well. One depth step is 15.59091 mm. Residues from well zero: 0 1 4 9 5 3 3 5 9 4 1. Depths run from the common front plane to each well floor. Table readings (Well, Residue, Depth (mm)): 0, 0, 0; 1, 1, 15.59091; 2, 4, 62.36364; 3, 9, 140.31818; 4, 5, 77.95455; 5, 3, 46.77273; 6, 3, 46.77273; 7, 5, 77.95455; 8, 9, 140.31818; 9, 4, 62.36364; 10, 1, 15.59091.
Increasing the prime changes the sequence itself. Reusing the seven-well cuts and simply adding four more partitions would give a different phase pattern.
Short three-well sequence
Prime well count = 3 · Design frequency (Hz) = 1200 · Speed of sound (m/s) = 343.
47.63889 mm deepest well. One depth step is 47.63889 mm. Residues from well zero: 0 1 1. Depths run from the common front plane to each well floor. Table readings (Well, Residue, Depth (mm)): 0, 0, 0; 1, 1, 47.63889; 2, 1, 47.63889.
This small order is convenient for checking arithmetic by hand. Two equal nonzero wells are expected, so matching depths do not indicate a missing partition.
Different propagation speed
Prime well count = 13 · Design frequency (Hz) = 800 · Speed of sound (m/s) = 330.
190.38462 mm deepest well. One depth step is 15.86538 mm. Residues from well zero: 0 1 4 9 3 12 10 10 12 3 9 4 1. Depths run from the common front plane to each well floor. Table readings (Well, Residue, Depth (mm)): 0, 0, 0; 1, 1, 15.86538; 2, 4, 63.46154; 3, 9, 142.78846; 4, 3, 47.59615; 5, 12, 190.38462; 6, 10, 158.65385; 7, 10, 158.65385; 8, 12, 190.38462; 9, 3, 47.59615; 10, 9, 142.78846; 11, 4, 63.46154.
A different sound speed rescales the physical layout at fixed tuning. Compare the deepest well with the available construction depth before rounding any individual cut.
Interpreting the result
A shop drawing needs a cross-section as well as a list of lengths. Draw a horizontal line for the front face, mark the well centers at your chosen pitch, and transfer the depth numbers downward from that line. Mark the opening with residue zero as flush. If cutting fillers for a common back panel, subtract the target depth from the available internal depth before cutting the filler.
Measurement and model limits
This model determines the ideal depth sequence at one frequency. The width of each opening, divider thickness, absorption in narrow wells, finite panel width and mounting position affect actual performance. The deepest well does not by itself establish a measured diffusion bandwidth. Allow for end plates and the front lip when translating the acoustic dimensions into a cabinet.
Music theory tools → · Quarter Wave Resonator Length Calculator →
Answers before you play
Common questions
Why does the first well have no depth?
The square of zero has remainder zero for every prime. This well serves as the reference path for the other reflected waves in the period.
Can I replace seven wells with eight?
The sequence here uses the quadratic residues of an odd prime. Select a supported prime and recalculate every row when changing the order of the diffuser.
Why do some depths repeat?
Different well indices can have the same square modulo the prime. Repeated depths are part of the spatial pattern and should remain in their original positions.
Can I change the speed of sound?
Yes. Use a value appropriate to the medium and temperature. The dimensions scale proportionally when frequency and well count stay fixed.