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.
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.
Quick start
- Select exactly one Sound in Praat. If it has more than one channel, the script first converts it to mono.
- Run
Microphone_Simulation.praat. - Choose one of the 10 recording presets, or leave Preset = Custom.
- For Custom, choose the microphone pattern, stereo configuration, source azimuth, source distance, and AB spacing as applicable.
- Optionally enable Apply_distance_attenuation. Apply_proximity_effect, Draw_visualization, and Play_result are enabled by default.
- Click OK. The script creates a new mono or stereo Sound and optionally draws the analysis figure and plays the result.
10 Recording Presets + Custom
| Preset | Pattern | Configuration | Position / geometry |
|---|---|---|---|
| Studio Vocal | Cardioid | Mono | 0°, 30 cm |
| Blumlein Pair | Figure-of-eight | Blumlein | 0°, 100 cm |
| ORTF Standard | Cardioid | ORTF | 0°, 100 cm; fixed 17 cm / 110° pair |
| Spaced Omnis AB | Omnidirectional | AB | 0°, 200 cm; 50 cm spacing |
| Mid-Side | Cardioid Mid | Mid-Side | 0°, 100 cm |
| Decca Tree | Omnidirectional geometry | Decca | 0°, 300 cm; fixed 2 m L-R, C 1.5 m forward |
| Close XY | Cardioid | XY | 0°, 50 cm; coincident ±45° |
| Hypercardioid Spot | Hypercardioid | Mono | 0°, 150 cm |
| AB Wide | Omnidirectional | AB | 0°, 200 cm; 100 cm spacing |
| Close Vocal Bass-boost | Cardioid | Mono | 0°, 10 cm; proximity effect forced on |
| Custom | User setting where applicable | User setting | Uses 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.
| Pattern | Implemented gain | Notes |
|---|---|---|
| Omnidirectional | 1 | No azimuth-dependent attenuation. |
| Figure-of-eight | cos(θ) | Front and rear lobes have opposite polarity; side nulls at ±90°. |
| Cardioid | 0.5 + 0.5 cos(θ) | Rear null at 180°. |
| Hypercardioid | 0.25 + 0.75 cos(θ) | Signed rear lobe; zeros occur where cos(θ) = -1/3 (about ±109.5°). |
Stereo Configurations
| Configuration | DSP actually used | Delay / spacing |
|---|---|---|
| Mono | Selected analytic pattern at source azimuth. | None. |
| Mid-Side | Mid 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 Pair | Selected directional pattern evaluated at source azimuth ±45°. Omnidirectional is rejected by validation. | Coincident; no delay. |
| Blumlein Pair | Two fixed figure-of-eight responses at ±45°. The Pattern field does not change the polar equations in this branch. | Coincident; no delay. |
| AB Pair | Spaced 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 Pair | Two fixed cardioids at ±55°. Timing uses a 17 cm spacing and sin(azimuth) delay relation. | Fixed 17 cm; form spacing is ignored. |
| Decca Tree | Three 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. |
Spatial and Level Model
Azimuth
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
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
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.
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.
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.
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
| Parameter | Default | What the code does |
|---|---|---|
| Preset | Custom | 10 named presets plus Custom. |
| Pattern | Cardioid | Omnidirectional / Figure-of-eight / Cardioid / Hypercardioid. Its effect depends on configuration as described above. |
| Stereo_config | Mono | Mono / Mid-Side / XY / Blumlein / AB / ORTF / Decca. |
| Azimuth_degrees | 0 | No explicit clamp; trigonometric formulas naturally wrap angles. |
| Distance_cm | 100 | No explicit positivity validation. Used by global 1/r scaling, proximity activation, and AB/Decca geometry. |
| Mic_spacing_cm | 17 | Used by AB only. ORTF is fixed at 17 cm; Decca geometry is fixed. |
| Apply_distance_attenuation | no | Applies global 1 / max(distance_m, 0.01). |
| Apply_proximity_effect | yes | Approximate low-frequency boost when active. |
| Draw_visualization | yes | Builds the multi-panel Praat Picture figure. |
| Play_result | yes | Plays the final Sound after processing. |
Visualization
When Draw_visualization = yes, the script creates a static 8×8 Praat Picture layout after processing:
- Polar pattern panel: analytic pattern with source azimuth/distance marker. See the hypercardioid rear-lobe caveat above.
- Configuration diagram: selected microphone arrangement plus source position. AB, ORTF and Decca include an L-R ITD readout and indicate which side leads.
- Frequency-response panel: a short impulse is processed through a matching configuration path, converted to mono if necessary, transformed to an LTAS, and drawn on a 100 Hz-to-Nyquist logarithmic frequency axis over a 24 dB range relative to its maximum. This makes delay-comb structure visible for spaced arrays; it is a relative response display, not an absolute calibration.
- Output waveform: mono output or overlaid L/R waveforms using the actual post-ceiling output amplitude scale.
- Summary bar: preset, source, configuration, Pattern field, azimuth, distance, spacing field, distance toggle, proximity status, channel count, duration and peak.
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.
| Configuration | Output channels | Object name |
|---|---|---|
| Mono | 1 | original_Pattern_mono |
| Mid-Side | 2 | original_MS_Pattern |
| XY | 2 | original_XY_Pattern |
| Blumlein | 2 | original_Blumlein |
| AB | 2 | original_AB_<spacing>cm |
| ORTF | 2 | original_ORTF |
| Decca | 2 | original_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
- Speed of sound is fixed at 343 m/s.
- AB and Decca delays are based on path-length differences relative to the nearest receiver.
- ORTF timing uses the fixed 17 cm sine-delay approximation rather than the source-distance geometry used by AB/Decca.
- All delayed paths use
Shift times byfollowed byExtract partwith a rectangular window. - v0.4.2 requires exactly one selected Sound and rejects non-omnidirectional AB configuration.
- Peak protection is attenuation-only, not normalization.