Skip to content

mattigoofy/phaser-effect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

phaser-effect

Phaser effect implementation in Matlab and on a DSP-board.

The full implementation onto the board is not given, since it was not created by me.

Theoretical Background

A phaser is a time-varying comb filter that moves across the frequency spectrum. It is implemented using a cascade of identical All Pass Filters (APFs) (source). Each APF is called a stage. The output of all stages is mixed with the original signal using a dry-wet mix. The processed signal can also be scaled with a depth parameter and fed back to the input.

Block diagram of a phaser

The comb filtering effect occurs because the phase-shifted signal is combined with the original. At certain frequencies, signals cancel (out of phase), and at others, they reinforce (in phase). The APF coefficient is updated per sample using a Low Frequency Oscillator (LFO), creating the characteristic “swooshing” sound.

An APF passes all frequencies with constant amplitude, but alters the phase (source):

$$ y[n] = -coeff \cdot (x[n] - y[n-1]) + x[n-1] $$

Block diagram of an APF

Matlab Simulation

The Matlab implementation includes:

  • A per-sample phaser process function
  • LFO-based coefficient update
  • Configurable number of stages

Tests performed:

  • APF frequency response (impulse input, coeff = 0.5) → constant 0 dB magnitude, varying phase
  • Phaser response with 8 stages, 50% mix, 80% depth, 0.5 Hz LFO → clear comb filtering
  • Phaser with 30% feedback → increased resonance/distortion

APF frequency response
Phaser frequency response
Phaser with feedback

Practical Implementation (DSP)

Fixed-Point Arithmetic

  • Q2.14 format used
  • No floating-point operations
  • Fixed-point sine (Q4.12) used for LFO (source)

Decimator

Used to reduce the effective LFO frequency by updating the phase only every few samples.

Stereo Support

  • Separate LFO phase, decimator counter, and APF buffers per channel
  • Maximum 5 stages in stereo due to processing limits
  • More stages possible in mono

Push Buttons

Runtime control:

  • Button 1 → number of stages
  • Button 2 → volume
  • Both → LFO frequency

Parameters increase in fixed steps until maximum, then wrap to minimum. Values are shown on an OLED display.
Debouncing is implemented to detect simultaneous presses.

Volume range:

  • −12 dB to +20 dB (0.5 dB steps)
  • Register values: −24 to 40

About

Phaser effect implementation in Matlab and on a DSP-board

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors