SPATIAL CHORUS WITH FRACTAL MODULATION LAB...

6
SPATIAL CHORUS WITH FRACTAL MODULATION LAB REPORT 2 Robert W Taylor 311123392 (SID) Digital Audio Systems, DESC9115, Semester 1 2012 Graduate Program in Audio and Acoustics Faculty of Architecture, Design and Planning, The University of Sydney SpatialChorus Spatial chorus with fractal modulation and extended user controls. Syntax [output] = SpatialChorus(input, fs , WidthL, WidthR, DelayL, DelayR, ModRate, ModCorr, ModType, ModFilterF, ModFilterQ, Mix, WetShift, DryShift) Parameters There are no predefined parameters in this function requiring the user to determine their own selection. An explanation of the parameters and suitable working ranges are detailed below: input – Wave input fs – Sample rate of sound source in Hz. DepthL, DepthR – Peak deviation from base delay measured as a ratio of the maximum amount of delay imposed. Value between 0 (less width) and 1 (more width). Independent controls for left/right output signals. (Suggested: 0.02 – 0.12) DelayL, DelayR – Delay offset of modulating signal in milliseconds. Independent controls for left/right output signals. (Suggested: 1015 ms) ModRate – Rate of modulation in Hz. (Suggested: 1 – 30 Hz) ModCorr – Correlation of left and right modulation signals. Value between 0 (no correlation) and 1 (correlation). (Suggested: 0 = decorrelated) ModType – Select the type of modulation signal 0 = Fractal, 1 = White noise, 2 = Brown noise, 3 = Pink noise. (Suggested: 0 = Fractal)

Transcript of SPATIAL CHORUS WITH FRACTAL MODULATION LAB...

SPATIAL CHORUS WITH FRACTAL MODULATION LAB REPORT 2

Robert W Taylor 311123392 (SID)

Digital Audio Systems, DESC9115, Semester 1 2012 Graduate Program in Audio and Acoustics

Faculty of Architecture, Design and Planning, The University of Sydney    

           SpatialChorus Spatial  chorus  with  fractal  modulation  and  extended  user  controls.    Syntax [output] = SpatialChorus(input, fs , WidthL, WidthR, DelayL, DelayR, ModRate, ModCorr, ModType, ModFilterF, ModFilterQ, Mix, WetShift, DryShift) Parameters

There  are  no  pre-­‐defined  parameters   in   this   function  requiring  the  user   to  determine  their  own   selection.  An  explanation  of   the  parameters   and   suitable  working   ranges  are  detailed  below:  

input  –  Wave  input  

 fs  –  Sample  rate  of  sound  source  in  Hz.  

 DepthL,   DepthR   –   Peak   deviation   from   base   delay   measured   as   a   ratio   of   the   maximum  amount  of   delay   imposed.  Value  between  0   (less  width)   and  1   (more  width).   Independent  controls  for  left/right  output  signals.  (Suggested:  0.02  –  0.12)  

 DelayL,  DelayR  –  Delay  offset  of  modulating  signal  in  milliseconds.  Independent  controls  for  left/right  output  signals.  (Suggested:  10-­‐15  ms)  

 ModRate  –  Rate  of  modulation  in  Hz.  (Suggested:  1  –  30  Hz)  

 ModCorr  –  Correlation  of  left  and  right  modulation  signals.  Value  between  0  (no  correlation)  and  1  (correlation).  (Suggested:  0  =  de-­‐correlated)  

 ModType  –  Select  the  type  of  modulation  signal 0  =  Fractal,  1  =  White  noise,  2  =  Brown  noise,  3  =  Pink  noise.  (Suggested:  0  =  Fractal)  

ModFilterF  –  Modulation  signal  filter  frequency  selection  in  Hz.  (Suggested:  1  –  30  Hz)    

ModFilterQ  –  Modulation  signal  filter  bandwidth  (Q)  in  Hz.  (Suggested:  1  –  5  Hz)    Mix  –  Mix  level  between  dry/wet  signals.  Values  between  -­‐1  (100%  dry),  0  (50/50),  1  (100%  wet).    (Suggested:  0  (50/50))  

 WetShift  –  Delay  of  the  modulated  channel  path  in  milliseconds.  (Suggested:  0  until  you  have  a  good  reason  to  do  otherwise)    DryShift  -­‐  Delay  of  the  un-­‐modulated  channel  path  in  milliseconds.  (Suggested:  0  if  you  want  spatial  movement)  

 OutputLevel  –  Overall  amplitude  of  output  signal.    Range  between  0  and  1.  (Suggested:  0.99)  

Description  Chorus  is  a  member  of  the  family  of  ‘delay  based  effects’.  Like  flanging  and  vibrato  the  resultant  effect  is  based  on  the  principals  of  comb  filtering  and  pitch  variance  due  to  dynamic  modulation.  Vibrato  and  flange  both  use  smooth  sinusoidal  modulation  of  the  delay  time  to  create  their  respective  effects.  Chorus  on  the  other  hand  uses  random  modulation  via  a  noise  signal  as  the  modulator.    Chorus   effects   in   general   give   the   user   no   control   over   both   the  modulation   signal   and   the   spatial  aspects  inherent  in  chorusing.  This  function  represents  a  new  design  for  a  ‘spatial’  chorus  effect  that  incorporates  a  modulation  signal  derived  from  a  fractal  algorithm  with  low-­‐pass  filter  control,  and  the  implementation  of  extensive  user  controls  and  parameters  that  center  around  the  de-­‐correlation  of  left/right  signal  paths  resulting  in  a  spatially  enhanced  outcome.  

Basic concepts of chorusing  

Speed:  (Modulation  rate)  refers  to  the  numbers  of  times  the  delay  offset  is  modulated  per  second  resulting  in  a  pitch  variance  (vibrato)  that  is  similar  to  the  doppler  effect.  The  pitch  goes  down  as  the  sound  moves  away  and  up  at  it  moves  closer.  

 Delay:  Refers  to  the  delay  offset  of  the  delay-­‐modulated  signal  (wet  signal).  When  this  delay  is   imposed,   one   of   the   fundamental   elements   of   Delay-­‐based   effects   is   produced,   comb  filtering,   which   of   course   is   particularly   relevant   to   flanging.   The   combination   of   the   non-­‐modulated   (dry)   signal   and   the  delayed  modulated   (wet)   signal  produces  a   series  of  peaks  and   troughs   in   the   frequency   spectrum.   However,   the   delay   function   of   a   chorus   is  more  closely  linked  to  speed  as  it  is  the  modulation  of  the  delay  time  that  causes  variances  in  pitch  (like  vibrato),  and  this  forms  the  principal  characteristic  of  chorusing.  

 Depth:  Refers  to  the  deviation  from  the  mean  delay  offset  of  the  non-­‐modulated  (wet)  signal  and  provides  the  strength  of  fluctuation  of  the  modulation.  The  depth  is  defined  as  a  ratio  to  the  delay  offset.  The  maximum  amount  of  depth  is  determined  by  the  ‘wet  signal’  delay  offset  to  the  ‘dry  signal’,  hence  the  amount  of  depth  available  (measured  in  !")  is  dependent  upon  this  ratio.  A  delay  offset  of  5ms  and  a  depth  ration  of  1:0.2  will  result  on  a  depth  of  

26.5  !";  a  delay  of  10ms  with  the  same  ratio  will  result  in  a  depth  of  52.9  !".  As  the  delay  increases,  so  does  the  ‘speed’  of  the  depth.    

                                                                Additional design elements

Modulation  type  selection:  4  different  types  of  modulation  signal  can  be  selected.  Although  the  a  fractal  algorithm  is  the  basis  of  this  chorus  design  and  is  recommended,  for  the  purpose  of  testing  and  evaluation  three  other  standard  forms  of  noise  can  be  generated.  (refer  to  Spatial  Chorus  Toolkit)    Fractal  modulation:  A  stochastic,  statistically  self-­‐similar  pseudo-­‐random  noise  signal  (fractal)  is  used  to  modulate  the  delay-­‐line  of  the  chorus  effect.  (refer  to  Spatial  Chorus  Toolkit)  

 Second  order  low-­‐pass  filter:  To  maintain  and  control  the  sub-­‐audio  rates  necessary,  a  second  order  low  pass  filter  is  implemented  to  remove  any  spectral  content  above  the  desired  frequency  and  in  many  ways  this  is  crucial  to  the  outcome.  The  cut-­‐off  frequency  and  bandwidth  of  the  filter  significantly  changes  the  spectral  content  of  the  modulation  signal,  which  in  turn  directly  affects  the  outcome  of  the  chorusing.  If  the  bandwidth  (Q)  is  wide,  a  resonant  peak  is  introduced  at  the  cut-­‐off  frequency  resulting  in  a  large  peak  with  significantly  more  energy  at  a  single  frequency.  This  in  turn  will  reduce  the  randomness  of  the  modulation  signal  tending  more  towards  flanging.  Alternatively,  if  the  Q  is  narrow,  the  randomness  is  retained.  (refer  to  Spatial  Chorus  Toolkit)    

                                                 Q  =  1       Q  =  5  

 Modulation  signal  correlation  mixing:  The  main  spatial  element  of  the  chorus  design  is  independent  modulating  signals  for  discrete  left  and  right  signal  processing.  With  both  signals  modulating  independently  of  each  other,  a  definitive  spatial  width  effect  is  created  by  separate  pitch  variance  evident  at  each  ear.  (refer  to  Spatial  Chorus  Toolkit)    

                                                             0%  correlation              70%  correlation  

Spline   interpolation:   Interpolation   is   necessary   to   process   non-­‐integer   values   of   the  sampling  frequency  due  to  variable  delay  times.  (sourced  directly  from  Pierre  Dutilleux  and  Udo  Zo  ̈lzer,  ‘DAFx—Digital  Audio  Effects’  Chapter  3  –  Delays,  Page  68)  [1]  

! ! =  !(! − ! + 1   ∙  !"#$!

6

+  ! ! −! ∙  (1 + !"#$)! − 4   ∙  !"#$!

6

+  ! ! − ! − 1   ∙  (2 − !"#$)! − 4(1 − !"#$)!

6

+  ! ! − ! − 2   ∙  (1 − !"#$)!

6

 Dry   signal   shift:   The   inclusion   of   a   dry   signal   delay   is   the   second   spatial   element   to   this  chorus  design.  Delaying   the  non-­‐modulated   (dry)   signal   in   line  with   the  delay  offset   of   the  modulated  (wet)  signal  means  that  the  wet  signal  can  fluctuate  between  leading  and  lagging  the  dry  signal  in  the  time  of  arrival  at  the  ear.  This  spatial  variation  is  like  that  associated  with  the  variation  in  Interaural  Time  Delay  (ITD)  for  a  sound  source  taking  a  circular  path  around  the  head.  [2]  

                   

Dry/wet  mix:  to  determine  how  much  of  the  chorus  effect  will  be  present  in  the  result  is  implemented  much  like  an  effects  send  and  return.    

Spatial Chorus Toolkit

 Four  additional  functions  provide  key  components  to  the  working  effect  and  are  required  to  be  present  in  the  MatLab  environment  for  it  to  function.    Fractal  modulator  [frand64.m]  :  This  function  implements  a  64-­‐sample  fractal  algorithm  to  create  a  stochastic,  statistically  self-­‐similar  pseudo-­‐random  noise  signal.  Seven  sets  containing  random  numbers,  each  one  double  the  size  of  the  previous  between  1  and  64  are  then  randomized,  which  can  be  described  by  ! =  1/!.  (Created  by  Assoc.  Professor  William  L.  Martens)    

!! =   !!!, !!", !!", !!", !!", !!", !!", !!"  !! =   !!!, !!", !!", !!"  !! =   !!!, !!"    

!!"#! =  !!    !! !!  !! !! !!

 

 !!"#$ =   !!!,!!",!!",!!",!!",!!",!!",!!"  

 (where  the  !!"  entry  is  the  sum  of  the  !! −  !  rows  of  !!"#!)  

                                                                       

 Generation  of  filter  coefficients  [M_fq2coef.m]  :    This  function  converts  the  frequency  and  bandwidth  parameters  to  coefficients.  It  returns  a  standard  filter  vector  (a).  (Created  by  Luis  Miranda)    

 Independent  left/right  modulation  signal  mixing  [pcor_sigs.m]:  This  function  controls  the  degree  of  correlation  between  the  left  and  right  independent  modulator  signals.  (Created  by  Assoc.  Professor  William  L.  Martens  and  Luis  Miranda)  

Noise  generator [makenoise.m]  :  This  general  purpose  function  creates  various  types  of  noise  signals  as  alternatives  to  the  fractal  version  for  testing  and  evaluation.  The  appropriate  variations  of  noise  signals  have  been  pre-­‐determined  (see  parameters).    (Created  by  Dr  Densil  Cabrera)

Diagnostics    The  primary  aim  of  the  function  is  to  create  spatial  effects  from  a  mono  source  and  therefore  this  function  only  accepts  mono  inputs.   Examples of suitable working parameters The  underlying  aim  of  the  stereo  chorus  effect  is  to  emulate  the  combination  of  multiple,  like  voices  in  unison  and  provide  an  extended  stereo  image.  In  reality,  this  means  small,  rapid  and  random  fluctuations  and  specific  working  parameter  ranges  are  required  to  achieve  an  individual  sonic  characteristic.  As  an  example,  with  small  delay  times  between  1-­‐2ms,  changes  in  timbre  are  at  their  most  noticeable.  It  could  be  argued  that  this  is  not  a  desirable  outcome  for  a  chorus  effect  as  that  is  more  an  attribute  of  flanging.  When  delay  times  are  above  2ms,  the  timbre  attributes  caused  by  the  interference  to  the  frequency  spectrum  become  less  evident  and  the  pitch  variance  becomes  more  dominant.  At  delay  times  more  than  30ms  an  echo  becomes  apparent  which  again  is  not  desirable.    Although  the  parameters  supply  a  large  range  and  quite  severe  sounding  results  are  possible,  it  is  advisable  to  stay  within  specific  value  ranges  to  achieve  more  standard  results.  Generally  a  modulation  rate  of  10-­‐15ms,  a  depth  of  between  0.02  and  .1,  and  a  delay  offset  of  between  10-­‐15ms  will  provide  a  pleasing  result  for  most  applications.    [output]  =  SpatialChorus(input,  fs,  .08,  .08,  12,  12,  10,  0.5,  0,  10,  3,  0,  0,  0,  0.99);    Also  note  that  the  perception  of  the  fluctuation  strength  of  the  chorus  is  dependent  on  the  frequency  spectrum  of  the  input  signal.  Signals  with  predominately  lower  frequency  content  will  most  likely  require  larger  ranges  of  parameters  to  achieve  similar  results  as  those  with  higher  frequency.  [3]    

To  obtain  spatial  ‘width’  it  is  advised  to  have  the  modulators  de-­‐correlated  (0),  and  slight  variations  between  left  and  right  depth  and  delay  parameters    [output]  =  SpatialChorus(input,  fs,  .05,  0.1,  10,  18,  10,  0,  0,  10,  3,  0,  0,  0,  0.99);    To  obtain  spatial  ‘movement’  it  is  advised  to  delay  the  un-­‐modulated  (dry)  signal  at  the  same  rate  as  the  delay  offset  (5-­‐10ms).    [output]  =  SpatialChorus(input,  fs,  .04,  .08,  10,  12,  10,  0,  0,  10,  3,  0,  0,  10,  0.99);    Combining  the  two  spatial  attributes  together  will  achieve  a  significant  increase  in  spatial  effect  as  a  whole.    [output]  =  SpatialChorus(input,  fs,  .05,  0.1,  10,  18,  10,  0,  0,  10,  3,  0,  0,  10,  0.99);   References

[1]   Pierre   Dutilleux   and   Udo   Zo  ̈lzer,   ‘DAFx—Digital   Audio   Effects’,   John   Wiley   &   Sons,   2002.  (Chapter  3:  Delay-­‐based  Audio  Effects  Pages  68-­‐73).  

[2]  William   L.   Martens   and  Marui,   Atsushi,   “Categories   of   Perception   for   Vibrato,   Flange,   and  Stereo   Chorus:   Mapping   out   the   Musically   Useful   Ranges   of   Modulation   Rate   and   Depth   for  Delay-­‐based  Effects”,  Conference  on  Digital  Audio  Effects,  Montreal,  Canada,  September  2006.  

[3]   Hugo   Fastle,   Eberhard   Zwicker,   ‘Psychoacoustics   –   Facts   and   Models’   Springer   Series   in  Information  Sciences,  1990-­‐2007.  ISBN:  978-­‐3-­‐540-­‐23159-­‐2  (Chapter  10,  Page  250).  

See also frand64  |  M_fq2coef |  makenoise |  sound |  wavread |  filter  |    freqz  |  abs  |                     Was  this  topic  helpful?        yes|no    ©  1984-­‐2011  The  MathWorks,  Inc.  •  Terms  of  Use  •  Patents  •  Trademarks  •  Acknowledgment