Microphone Simulation — User Guide

Idealized microphone and stereo-array simulation for a single source in the horizontal plane. The script models analytic polar-pattern gains, coincident and spaced microphone configurations, optional 1/r distance scaling, an approximate close-distance proximity effect, and a final attenuation-only peak ceiling.

Author: Shai Cohen Affiliation: Department of Music, Bar-Ilan University, Israel Version: 0.4.2 (2026) License: MIT License

What this does

Microphone Simulation takes exactly one Praat Sound object, converts multichannel input to mono, and renders that source through one of seven microphone configurations: Mono, Mid-Side, XY, Blumlein, AB, ORTF, or Decca Tree. The source is described by horizontal azimuth and distance; there is no elevation or room model.

Coordinate system (top view): Front (0°) | | Left --+-- Right (-90°) Mic (+90°) | Back (±180°)
Model scope: This is an idealized signal-processing approximation, not a simulation of a specific microphone capsule or acoustic room. Directionality is represented by analytic polar equations. Spaced configurations add geometric delay and relative level cues; optional proximity processing is a simple low-frequency shelf approximation.

Quick start

  1. Select exactly one Sound in Praat. If it has more than one channel, the script first converts it to mono.
  2. Run Microphone_Simulation.praat.
  3. Choose one of the 10 recording presets, or leave Preset = Custom.
  4. For Custom, choose the microphone pattern, stereo configuration, source azimuth, source distance, and AB spacing as applicable.
  5. Optionally enable Apply_distance_attenuation. Apply_proximity_effect, Draw_visualization, and Play_result are enabled by default.
  6. Click OK. The script creates a new mono or stereo Sound and optionally draws the analysis figure and plays the result.
Preset behaviour: A named preset overrides the pattern/configuration/position values that it explicitly assigns. Global toggles remain under user control, except Close Vocal Bass-boost, which explicitly forces the proximity-effect toggle on.

10 Recording Presets + Custom

PresetPatternConfigurationPosition / geometry
Studio VocalCardioidMono0°, 30 cm
Blumlein PairFigure-of-eightBlumlein0°, 100 cm
ORTF StandardCardioidORTF0°, 100 cm; fixed 17 cm / 110° pair
Spaced Omnis ABOmnidirectionalAB0°, 200 cm; 50 cm spacing
Mid-SideCardioid MidMid-Side0°, 100 cm
Decca TreeOmnidirectional geometryDecca0°, 300 cm; fixed 2 m L-R, C 1.5 m forward
Close XYCardioidXY0°, 50 cm; coincident ±45°
Hypercardioid SpotHypercardioidMono0°, 150 cm
AB WideOmnidirectionalAB0°, 200 cm; 100 cm spacing
Close Vocal Bass-boostCardioidMono0°, 10 cm; proximity effect forced on
CustomUser setting where applicableUser settingUses the form values

Polar Patterns

The analytic pattern is evaluated from the source azimuth relative to the relevant microphone axis. The gain can be signed: the rear lobe of a figure-of-eight and part of the hypercardioid response therefore carry opposite polarity.

PatternImplemented gainNotes
Omnidirectional1No azimuth-dependent attenuation.
Figure-of-eightcos(θ)Front and rear lobes have opposite polarity; side nulls at ±90°.
Cardioid0.5 + 0.5 cos(θ)Rear null at 180°.
Hypercardioid0.25 + 0.75 cos(θ)Signed rear lobe; zeros occur where cos(θ) = -1/3 (about ±109.5°).
Visualization note: The audio path keeps the signed hypercardioid response. The current polar-pattern drawing clips negative hypercardioid values to zero, so its rear lobe is not represented faithfully in that panel. Figure-of-eight is drawn with both lobes using the absolute magnitude.

Stereo Configurations

ConfigurationDSP actually usedDelay / spacing
MonoSelected analytic pattern at source azimuth.None.
Mid-SideMid uses the selected pattern. Side is a fixed figure-of-eight rotated 90°. Decode: L=(M+S)/√2, R=(M-S)/√2.Coincident; no delay.
XY PairSelected directional pattern evaluated at source azimuth ±45°. Omnidirectional is rejected by validation.Coincident; no delay.
Blumlein PairTwo fixed figure-of-eight responses at ±45°. The Pattern field does not change the polar equations in this branch.Coincident; no delay.
AB PairSpaced omni pair. Exact source-to-capsule distances set relative channel gains and arrival delays. Non-omni Pattern choices are rejected.Mic_spacing_cm is used.
ORTF PairTwo fixed cardioids at ±55°. Timing uses a 17 cm spacing and sin(azimuth) delay relation.Fixed 17 cm; form spacing is ignored.
Decca TreeThree omni-like point receivers: L/R at ±1 m laterally and C 1.5 m forward. Relative distance gains and delays are calculated, then C is added to each side at 0.7.Fixed geometry; form spacing is ignored.
Custom Pattern field: It directly controls Mono and XY and controls only the Mid microphone in M/S. Blumlein and ORTF use their fixed figure-of-eight/cardioid equations; AB is enforced as omni; Decca does not apply the Pattern field to its three receivers.

Spatial and Level Model

Azimuth

0° = front +90° = right -90° = left ±180° = back

AB geometry

AB uses the entered source distance and azimuth to calculate the Euclidean distance to each microphone. The nearer capsule is the zero-delay reference; the farther capsule is delayed by its additional path length divided by 343 m/s. Each channel also receives the relative gain minDist / distChannel.

ORTF timing

deltaT = (0.17 / 343) × sin(azimuth) L/R delays are shifted so that neither delay is negative. Cardioid gains are evaluated at azimuth ±55°.

Decca Tree geometry

The script calculates distances from the source to L, C and R, uses the shortest path as the zero-delay reference, applies relative gains minDist / distChannel, and renders stereo as L + 0.7C and R + 0.7C.

Optional 1/r distance scaling

distance_m = Distance_cm / 100 if Apply_distance_attenuation: distanceAmp = 1 / max(distance_m, 0.01) else: distanceAmp = 1

This is a single post-processing gain referenced to 1 m. It can therefore boost sources inside 1 m as well as attenuate sources beyond 1 m. It is not a near-field acoustic model. AB and Decca additionally retain their own inter-microphone relative-distance gains whether or not this global toggle is enabled.

Proximity Effect Approximation

If Apply_proximity_effect is enabled, the source distance is below 30 cm, and the selected Pattern is not Omnidirectional, the script adds a low-frequency shelf approximation concentrated below roughly 150 Hz.

proxScale = 1 - Distance_cm / 30 proxBoostDb = 6 × proxScale Filtered copy = Praat Filter (de-emphasis) at 150 Hz Output = original + filtered × (10^(proxBoostDb/20) - 1)

For ordinary positive distances, the nominal boost tapers from about +6 dB at 0 cm to 0 dB at 30 cm. This is an approximate spectral effect, not a physical model of a particular directional microphone.

Configuration detail: In M/S the proximity process is applied to the Mid path, not the fixed Side path. In XY and Blumlein it is applied to both output paths when active. ORTF applies it to both cardioid paths when active. AB is omni-only after v0.4.2, so proximity is inactive there. Decca does not apply the proximity procedure.

Final Peak Ceiling

Version 0.4.2 no longer normalizes every result to 0.99. The script first measures the output absolute extremum using Sinc70. Only if the peak exceeds 0.99 is the Sound attenuated to 0.99.

if outputPeak > 0.99: ceilingGain = 0.99 / outputPeak Scale peak: 0.99 else: gain remains unchanged

This preserves polar-pattern attenuation and optional 1/r level differences whenever no clipping protection is required. If those processes produce a peak above 0.99, the shared ceiling necessarily reduces the entire result.

Parameters & Defaults

ParameterDefaultWhat the code does
PresetCustom10 named presets plus Custom.
PatternCardioidOmnidirectional / Figure-of-eight / Cardioid / Hypercardioid. Its effect depends on configuration as described above.
Stereo_configMonoMono / Mid-Side / XY / Blumlein / AB / ORTF / Decca.
Azimuth_degrees0No explicit clamp; trigonometric formulas naturally wrap angles.
Distance_cm100No explicit positivity validation. Used by global 1/r scaling, proximity activation, and AB/Decca geometry.
Mic_spacing_cm17Used by AB only. ORTF is fixed at 17 cm; Decca geometry is fixed.
Apply_distance_attenuationnoApplies global 1 / max(distance_m, 0.01).
Apply_proximity_effectyesApproximate low-frequency boost when active.
Draw_visualizationyesBuilds the multi-panel Praat Picture figure.
Play_resultyesPlays the final Sound after processing.
Edge cases: The form does not enforce a positive source distance or positive AB spacing. In particular, placing a Custom source exactly on an AB or Decca receiver can make the relative-distance division undefined. Use physically meaningful positive distances and spacing.

Visualization

When Draw_visualization = yes, the script creates a static 8×8 Praat Picture layout after processing:

Spacing readout: the summary/Info display can show the form's Mic_spacing_cm value for ORTF and Decca even though those branches use fixed 17 cm and fixed Decca geometry respectively. Treat the configuration diagram and the implementation descriptions above as authoritative.

Output

The selected source is not modified. A new Sound is produced, with the original duration and sampling frequency retained by the processing path.

ConfigurationOutput channelsObject name
Mono1original_Pattern_mono
Mid-Side2original_MS_Pattern
XY2original_XY_Pattern
Blumlein2original_Blumlein
AB2original_AB_<spacing>cm
ORTF2original_ORTF
Decca2original_DeccaTree

There is no file export in this script. The result remains a Praat Sound object unless the user saves it separately.

Limitations

  • Horizontal only: azimuth and distance are modeled; there is no elevation.
  • No room acoustics: no reflections, reverberation or environmental propagation.
  • No specific microphone model: no capsule frequency response, phase response, self-noise, distortion, handling noise or manufacturing variation.
  • Ideal analytic patterns: polar directivity is frequency-independent except for the separate proximity approximation.
  • Spaced-array timing: implemented with Praat time shifting followed by rectangular extraction; the script does not explicitly implement a dedicated fractional-delay interpolation filter.
  • Input collapses to one point source: any multichannel source is converted to mono before microphone rendering.
  • No automatic parameter clamps: azimuth, distance and spacing are real-valued form fields with limited validation.

Implementation Notes