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.
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.
Quick start
- Select one mono Sound object in Praat (stereo auto-converted to mono).
- Run script… → Load Microphone Simulation script.
- Choose Preset (13 presets covering common recording scenarios) OR select "Custom".
- If Custom: Set Pattern (Omni/Fig-8/Cardioid/Hypercardioid), Stereo_config, Azimuth (0-360°), Distance_cm.
- For AB/ORTF: Adjust Mic_spacing_cm if needed.
- Enable Apply_near_field_distance for 1/r amplitude attenuation (optional).
- Enable Play_result to auto-play output.
- Click OK — processing instant, result appears as new Sound object.
Polar Patterns
What are Polar Patterns?
Directional sensitivity of microphones:
- Polar pattern: Graph showing mic sensitivity vs. angle
- On-axis (0°): Maximum sensitivity direction
- Off-axis: Reduced sensitivity at other angles
- Null points: Directions with zero/minimum sensitivity
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
| Configuration | Pattern | Spacing | Angle | Character |
|---|---|---|---|---|
| Mono | Any | — | — | Single mic, no stereo |
| Mid-Side (MS) | Card + Fig-8 | Coincident | M:0°, S:90° | Adjustable width, mono-compatible |
| XY | Directional | Coincident | ±45° | Coincident stereo, good imaging |
| Blumlein | Fig-8 | Coincident | ±45° | Natural room sound, figure-8 XY |
| AB | Omni | 50-200cm | 0° | Spaced omnis, ITD-based, spacious |
| ORTF | Cardioid | 17cm | ±55° | French standard, ITD+ILD, versatile |
| Decca Tree | Omni | L-C-R 2m | Various | Orchestral, 3-mic classical |
Configuration Details
Mid-Side (MS):
- M (Mid): Cardioid facing forward
- S (Side): Figure-8 facing left/right
- Decode: L = M+S, R = M-S (corrected polarity)
- Width adjustable in post by changing S level
XY Pair:
- Two directional mics (cardioid, hypercardioid, or fig-8)
- Coincident (same point, no spacing)
- Angled ±45° from center
- ILD (level difference) based stereo
AB Pair:
- Two omnidirectional mics only (validated)
- Spaced 50-200cm apart
- ITD (time difference) based stereo
- Wide, spacious image
ORTF:
- Two cardioid mics, 17cm spacing
- Angled ±55° (110° total angle)
- Both ITD and ILD cues
- French broadcasting standard
Decca Tree:
- Three omni mics: L, C, R
- L/R: ±1m lateral, C: 1.5m forward
- Mix: L+0.7C, R+0.7C
- Classical orchestral standard
13 Recording Presets
| Preset | Pattern | Config | Position | Use Case |
|---|---|---|---|---|
| Studio Vocal | Cardioid | Mono | 0°, 30cm | Close vocal recording |
| Blumlein Pair | Fig-8 | Blumlein | 0°, 1m | Natural room stereo |
| ORTF Standard | Cardioid | ORTF | 0°, 1m | Versatile stereo (recommended) |
| Spaced Omnis | Omni | AB 50cm | 0°, 2m | Moderate spacing, warm |
| Mid-Side | Card+Fig-8 | MS | 0°, 1m | Adjustable width |
| Classical Decca Tree | Omni | Decca | 0°, 3m | Orchestra, far-field |
| Close XY | Cardioid | XY | 0°, 50cm | Close stereo, focused |
| Hypercardioid Spot | Hyper | Mono | 0°, 1.5m | Focused mono pickup |
| ORTF Right Side | Cardioid | ORTF | +90°, 1m | Source from right |
| ORTF Left Side | Cardioid | ORTF | -90°, 1m | Source from left |
| ORTF Behind | Cardioid | ORTF | 180°, 1m | Rear capture |
| AB Wide Spacing | Omni | AB 100cm | 0°, 2m | Very spacious stereo |
| XY Figure-8 | Fig-8 | XY | 0°, 1m | Blumlein variant |
Spatial Parameters
Azimuth (Horizontal Angle)
Distance
Mic Spacing (AB, ORTF)
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| Source_sound | positive | 1 | Which selected sound to process |
| Preset | choice | Custom | 13 presets or manual configuration |
| Custom Settings (if Preset=Custom) | |||
| Pattern | choice | Cardioid | Omni / Fig-8 / Cardioid / Hypercardioid |
| Stereo_config | choice | None (Mono) | Mono / MS / XY / Blumlein / AB / ORTF / Decca |
| Azimuth_degrees | real | 0° | Source horizontal angle (0-360° or ±180°) |
| Distance_cm | real | 100cm | Source distance from microphone |
| Mic_spacing_cm | real | 17cm | Spacing for AB/ORTF (ignored for others) |
| Apply_near_field_distance | boolean | no | Enable 1/r amplitude attenuation |
| Play_result | boolean | yes | Auto-play output |
Technical Implementation
Fractional-Sample Delays
Accurate ITD using sinc interpolation:
- ITD often fractions of samples (e.g., 0.3 samples at 44.1kHz = 6.8µs)
- Integer-sample delays create audible quantization
- Script uses Praat's sinc interpolation for sub-sample accuracy
- Result: Smooth, artifact-free spatial imaging
Corrected M/S Polarity
Validation
Configuration constraints enforced:
- XY pair: Requires directional mics (Cardioid/Fig-8/Hyper) — omni blocked
- AB pair: Omnidirectional only (as documented)
- Source count: Must select at least one sound
Output
New Sound object (mono or stereo):
- Naming: "originalname_ConfigPattern" (e.g., "voice_ORTF", "drums_XY_Cardioid")
- Mono configs: Single channel output
- Stereo configs: Two-channel output (L/R)
Info window displays:
- Preset used (if applicable)
- Pattern and configuration
- Source position (azimuth, distance)
- Mic spacing (for AB/ORTF/Decca)
- Near-field status
- Applied corrections list
- ✓ 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:
- Teaching microphone techniques
- Understanding polar patterns
- Comparing stereo configurations
- Demonstrating ITD vs ILD
Virtual mic placement:
- Testing mic positions without physical setup
- Comparing techniques on same source
- Auditioning spacing/angle variations
Spatial audio simulation:
- Creating stereo from mono sources
- Positioning elements in stereo field
- Simulating recording sessions
Research:
- Psychoacoustic spatial perception
- Mic technique comparison studies
- ITD/ILD trade-off analysis
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:
- ORTF: Best all-around stereo (ITD+ILD balance)
- MS: When width adjustment needed in post
- AB: Spacious, natural for classical/jazz
- XY: Tight, focused, good mono compatibility
- Mono Cardioid: Solo instruments, vocals
Comparing techniques:
- Process same source with different presets
- Compare ORTF vs XY vs AB for your material
- Test azimuth variations (-90°, 0°, +90°)
- Try different distances to hear proximity effect simulation
Parameter experimentation:
- AB spacing: Try 50cm, 100cm, 150cm for spaciousness comparison
- Azimuth: Test 0° (center), ±45° (off-center), ±90° (side)
- Distance: Close (30cm), Medium (1m), Far (3m)
- Near-field: Enable for close-mic realism (distance attenuation)