Microphone Simulation — User Guide

Physically accurate microphone modeling: simulates polar patterns (omni, figure-8, cardioid, hypercardioid), stereo configurations (XY, AB, ORTF, MS, Blumlein, Decca Tree), and spatial positioning (azimuth, distance) with fractional-sample ITD and distance attenuation.

Author: Shai Cohen Affiliation: Department of Music, Bar-Ilan University, Israel Version: 2.3 (2025)

What this does

This script simulates realistic microphone recording by applying polar pattern responses (omnidirectional, figure-8, cardioid, hypercardioid), stereo configurations (XY, AB, ORTF, Mid-Side, Blumlein, Decca Tree), and spatial cues (interaural time difference, distance attenuation). Takes mono source, positions it in 3D space (azimuth, distance), processes through microphone model(s), outputs mono or stereo result. Uses fractional-sample sinc interpolation for accurate ITD, corrected M/S polarity, and validated configurations. Useful for understanding microphone techniques, virtual mic placement, spatial audio simulation.

Coordinate system (top view): Front (0°) | Source (azimuth) | Left --+-- Right (-90°) Mic (+90°) | Back (±180°)

Quick start

  1. Select one mono Sound object in Praat (stereo auto-converted to mono).
  2. Run script… → Load Microphone Simulation script.
  3. Choose Preset (13 presets covering common recording scenarios) OR select "Custom".
  4. If Custom: Set Pattern (Omni/Fig-8/Cardioid/Hypercardioid), Stereo_config, Azimuth (0-360°), Distance_cm.
  5. For AB/ORTF: Adjust Mic_spacing_cm if needed.
  6. Enable Apply_near_field_distance for 1/r amplitude attenuation (optional).
  7. Enable Play_result to auto-play output.
  8. Click OK — processing instant, result appears as new Sound object.
Quick tip: Start with ORTF Standard preset (most versatile stereo technique). Try Studio Vocal for mono, Mid-Side for adjustable width. All presets use physically accurate models with corrected polarity and fractional-sample delays.

Polar Patterns

What are Polar Patterns?

Directional sensitivity of microphones:

Four Pattern Types

🌐 Omnidirectional

Formula: gain = 1.0 (uniform)

Sensitivity: Equal in all directions

Null: None

Use: Room ambience, classical music, Decca Tree, AB stereo

∞ Figure-of-Eight (Bidirectional)

Formula: gain = cos(θ)

Sensitivity: Maximum front (0°) and back (180°), equal opposite polarity

Null: Sides (±90°)

Use: Mid-Side (Side mic), Blumlein pair, room rejection

♥ Cardioid (Heart-Shaped)

Formula: gain = 0.5 + 0.5×cos(θ)

Sensitivity: Maximum front (0°), reduced sides, minimum back

Null: Back (180°)

Use: Most common (vocals, XY, ORTF, MS Mid), stage/studio

▶ Hypercardioid

Formula: gain = 0.25 + 0.75×cos(θ)

Sensitivity: Narrower pickup than cardioid, some rear lobe

Null: ~120° (sides-rear)

Use: Focused spot pickup, rejection of sides, stage monitors

Stereo Configurations

ConfigurationPatternSpacingAngleCharacter
MonoAnySingle mic, no stereo
Mid-Side (MS)Card + Fig-8CoincidentM:0°, S:90°Adjustable width, mono-compatible
XYDirectionalCoincident±45°Coincident stereo, good imaging
BlumleinFig-8Coincident±45°Natural room sound, figure-8 XY
ABOmni50-200cmSpaced omnis, ITD-based, spacious
ORTFCardioid17cm±55°French standard, ITD+ILD, versatile
Decca TreeOmniL-C-R 2mVariousOrchestral, 3-mic classical

Configuration Details

Mid-Side (MS):

XY Pair:

AB Pair:

ORTF:

Decca Tree:

13 Recording Presets

PresetPatternConfigPositionUse Case
Studio VocalCardioidMono0°, 30cmClose vocal recording
Blumlein PairFig-8Blumlein0°, 1mNatural room stereo
ORTF StandardCardioidORTF0°, 1mVersatile stereo (recommended)
Spaced OmnisOmniAB 50cm0°, 2mModerate spacing, warm
Mid-SideCard+Fig-8MS0°, 1mAdjustable width
Classical Decca TreeOmniDecca0°, 3mOrchestra, far-field
Close XYCardioidXY0°, 50cmClose stereo, focused
Hypercardioid SpotHyperMono0°, 1.5mFocused mono pickup
ORTF Right SideCardioidORTF+90°, 1mSource from right
ORTF Left SideCardioidORTF-90°, 1mSource from left
ORTF BehindCardioidORTF180°, 1mRear capture
AB Wide SpacingOmniAB 100cm0°, 2mVery spacious stereo
XY Figure-8Fig-8XY0°, 1mBlumlein variant

Spatial Parameters

Azimuth (Horizontal Angle)

Azimuth: 0° to 360° (or ±180°) 0° = Front (straight ahead) +90° = Right -90° = Left ±180° = Back (behind microphone) Effect on recording: Omnidirectional: No effect (equal all directions) Directional mics: Reduced gain off-axis Stereo pairs: Creates L/R balance and ITD

Distance

Distance: Centimeters from microphone Effect (if near-field enabled): Amplitude attenuation: gain = 1/distance 30cm (close): +10 dB vs 1m reference 100cm (1m): 0 dB (reference) 200cm (far): -6 dB vs 1m reference ITD effect (spaced mics): Closer sources = larger ITD (more delay difference) Far sources = smaller ITD (approaching plane wave)

Mic Spacing (AB, ORTF)

Spacing affects ITD (Interaural Time Difference): ITD = (spacing × sin(azimuth)) / speed_of_sound Example: 17cm spacing (ORTF), source at 90° ITD = (0.17 × sin(90°)) / 343 = 0.495 ms Wider spacing = larger ITD = more spacious Narrower spacing = smaller ITD = tighter image Typical values: ORTF: 17cm (standard) AB: 50-100cm (moderate-wide) Decca: 200cm L-R spacing (very wide)

Parameters

ParameterTypeDefaultDescription
Source_soundpositive1Which selected sound to process
PresetchoiceCustom13 presets or manual configuration
Custom Settings (if Preset=Custom)
PatternchoiceCardioidOmni / Fig-8 / Cardioid / Hypercardioid
Stereo_configchoiceNone (Mono)Mono / MS / XY / Blumlein / AB / ORTF / Decca
Azimuth_degreesrealSource horizontal angle (0-360° or ±180°)
Distance_cmreal100cmSource distance from microphone
Mic_spacing_cmreal17cmSpacing for AB/ORTF (ignored for others)
Apply_near_field_distancebooleannoEnable 1/r amplitude attenuation
Play_resultbooleanyesAuto-play output

Technical Implementation

Fractional-Sample Delays

Accurate ITD using sinc interpolation:

Corrected M/S Polarity

CORRECTED Mid-Side implementation: Side microphone: gain = cos(θ + 90°) = -sin(θ) (Positive-left convention) Decode matrix: L = (M + S) / √2 R = (M - S) / √2 This matches standard M/S decode: S positive = more left S negative = more right

Validation

Configuration constraints enforced:

Output

New Sound object (mono or stereo):

Info window displays:

Version 2.3 corrections:
  • ✓ M/S polarity corrected (S positive = left)
  • ✓ Fractional-sample delays (sinc interpolation)
  • ✓ AB pair omni-only enforcement
  • ✓ XY pair directional-mic validation
  • ✓ Distance attenuation option (1/r)

Applications

Education:

Virtual mic placement:

Spatial audio simulation:

Research:

Limitations

Physical modeling limitations:
  • Horizontal plane only: No elevation (assumes source at ear height)
  • No head shadowing: Simplified ITD/ILD (no HRTF)
  • No room acoustics: Anechoic model (no reflections, reverb)
  • Ideal patterns: Perfect polar responses (no real-world imperfections)
  • Far-field default: Distance attenuation optional (enable for close-mic realism)
  • No proximity effect: Directional mics have bass boost up close (not modeled)
  • Mono input required: Stereo sources converted to mono first

Usage Tips

Choosing configurations:

Comparing techniques:

Parameter experimentation: