Login / Register  0 items | $0.00 NewWhat is KVR? Submit News Advertise
User avatar
autodafe
KVRAF
 
1641 posts since 16 Jul, 2001, from Milan, Italy

Postby autodafe; Fri Oct 06, 2017 6:49 am Linear Morphing between values in a formant filter

I got some sample code from musicdsp about a nice formant filter, whihc has coefficients for some vowels sounds A E I O U of a female voice, defined in a 5x11 array as follows:

Code: Select all
const double coeff[5][11] = {
   { 3.11044e-06,
   8.943665402, -36.83889529, 92.01697887, -154.337906, 181.6233289,
   -151.8651235, 89.09614114, -35.10298511, 8.388101016, -0.923313471  ///A
   },

   { 4.36215e-06,
   8.90438318, -36.55179099, 91.05750846, -152.422234, 179.1170248,  ///E
   -149.6496211, 87.78352223, -34.60687431, 8.282228154, -0.914150747
   },
   { 3.33819e-06,
   8.893102966, -36.49532826, 90.96543286, -152.4545478, 179.4835618,
   -150.315433, 88.43409371, -34.98612086, 8.407803364, -0.932568035  ///I
   },
   { 1.13572e-06,
   8.994734087, -37.2084849, 93.22900521, -156.6929844, 184.596544,   ///O
   -154.3755513, 90.49663749, -35.58964535, 8.478996281, -0.929252233
   },
   { 4.09431e-07,
   8.997322763, -37.20218544, 93.11385476, -156.2530937, 183.7080141,  ///U
   -153.2631681, 89.59539726, -35.12454591, 8.338655623, -0.910251753
   }
};



I wanted to create additional intermaediate values for in-between sounds A-E E-I I-O and O-U
I have read something about linear morphing but I can't find a way to apply to this values. WOUld it be possible to generate the interediate coefficients using a formula? or should I simply apply the average values between each couple of values of the arrays?
User avatar
Ichad.c
KVRian
 
990 posts since 8 Feb, 2012, from South - Africa

Postby Ichad.c; Sat Oct 07, 2017 6:27 am Re: Linear Morphing between values in a formant filter

A linear cross-fade between values worked fine for me. Here is how it sounds when driven by a sequence.

https://soundcloud.com/ichad-c/hydi-gremlin-preview

P.S. I didn't use that exact table.
quikquak
KVRist
 
294 posts since 6 Aug, 2005, from England

Postby quikquak; Sat Oct 07, 2017 7:11 am Re: Linear Morphing between values in a formant filter

It may sound like a more natural transition to 'smoothstep' or cosine interpolate the value:-

Code: Select all
double CosineInterpolate(
   double y1,double y2,
   double mu)
{
   double mu2;

   mu2 = (1-cos(mu*PI))/2;
   return(y1*(1-mu2)+y2*mu2);
}


Example taken from here:- http://paulbourke.net/miscellaneous/interpolation/
User avatar
autodafe
KVRAF
 
1641 posts since 16 Jul, 2001, from Milan, Italy

Postby autodafe; Sat Oct 07, 2017 11:21 pm Re: Linear Morphing between values in a formant filter

thnaks a lot quikquak,your function has proven very helpful!
iiphii
KVRer
 
7 posts since 12 May, 2016

Postby iiphii; Sun Oct 08, 2017 2:49 am Re: Linear Morphing between values in a formant filter

I don't know if there is a "correct" way of doing this. However for me, it would make the most sense to look at the poles of the formant filters in the complex plane, and interpolate them in polar coordinates. That is, interpolating the magnitude and angle individually, with say, linear interpolation.

This seems most appealing to me, since the location of the poles on the z-plane provide a clear link to the frequencies and shapes of the resonances.
mystran
KVRAF
 
4579 posts since 11 Feb, 2006, from Helsinki, Finland

Postby mystran; Sun Oct 08, 2017 3:58 am Re: Linear Morphing between values in a formant filter

iiphii wrote:I don't know if there is a "correct" way of doing this. However for me, it would make the most sense to look at the poles of the formant filters in the complex plane, and interpolate them in polar coordinates. That is, interpolating the magnitude and angle individually, with say, linear interpolation.


While this is usually better than interpolation direct form coefficients, you can do slightly better still if you interpolate the angular frequencies in log-domain. This way your linear interpolation actually sounds linear to the ears. As far as the magnitude goes, I'd usually just interpolate the damping factor 1/Q as-is, since that works well enough, but I suppose you could do that in log-domain as well if you wanted to.
Image <- plugins | forum
User avatar
autodafe
KVRAF
 
1641 posts since 16 Jul, 2001, from Milan, Italy

Postby autodafe; Sun Oct 08, 2017 5:17 am Re: Linear Morphing between values in a formant filter

this is the fnal result, i think it sounds quite cool. AEIOU and their in-between values, modulated in VCV Rack

https://www.youtube.com/watch?v=9EqaQ5t-bO8
User avatar
Ichad.c
KVRian
 
990 posts since 8 Feb, 2012, from South - Africa

Postby Ichad.c; Sun Oct 08, 2017 5:50 am Re: Linear Morphing between values in a formant filter

Sounds good!
quikquak
KVRist
 
294 posts since 6 Aug, 2005, from England

Postby quikquak; Sun Oct 08, 2017 6:39 am Re: Linear Morphing between values in a formant filter

What I meant by more natural was the transition between two sounds having an ease-in and ease-out movement of formants because of the physical limitations of face muscles:

https://en.oxforddictionaries.com/definition/diphthong
& https://en.wikipedia.org/wiki/Diphthong

Image
Image
User avatar
Ichad.c
KVRian
 
990 posts since 8 Feb, 2012, from South - Africa

Postby Ichad.c; Sun Oct 08, 2017 7:11 am Re: Linear Morphing between values in a formant filter

Forgot to mention that my amplitude is in log-domain, but the rest in linear. After looking at Quickquak's post though, think I'll give the transition region some more consideration if I do a version 2.0.

Moderator: Moderators (Main)

Return to DSP and Plug-in Development