If you have a problem or need to report a bug please email : support@dsprobotics.com
There are 3 sections to this support area:
DOWNLOADS: access to product manuals, support files and drivers
HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects
USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here
NEW REGISTRATIONS - please contact us if you wish to register on the forum
Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright
Digital waveguide sythesis
16 posts
• Page 1 of 2 • 1, 2
Digital waveguide sythesis
Here is a project I've been working on several months now and I might need a little help with it.
What is Digital waveguide synthesis?
It is a synthesis technique that digitally simulates wave propagation through instrument (in this case string). Sound in string is created by creating an excitation sound (by a pick, finger, bow, hammer,...) that propagates both directions through the string, bounces at string terminations and therefore travels back and forth (cycles around the string). as it travels and bounces it is damped and dispersed each time it passes the cycle. These damping and dispersion effects can be simulated by a filter with desired amplitude (to simulate the damping) and phase (to simulate dispersion) response.
Waves traveling both directions are identical and their interference is the actual vibration of the string we observe. This interference can be simulated by comb filters, however, because the string is linear system (basically also a feedback comb filter) it can be directly imprinted to the excitation. Also the impulse response of all reflection, dispersion and filtering is imprinted on it (the resonance of the body of instrument, reverb of room, response of microphone etc.).
How do I obtain the filter response and the excitation impulse?
This is the tricky part, that my schematic tries to do. First you enter the wave to analyze - recording of a string that is plucked - and a pitch of the sound. The analyzer compares the wave and a copy of the wave delayed by a period. By the least squares method that I posted earlier it estimates the filter. The string model is finished at this point. The excitation pulse can be recreated by sending the original wave trough inverse string model (feedforward instead of feedback topology).
What are the limitations?
Real world string vibrates in 3 dimensions (vertical, horizontal and lateral). These 3 separate waves are damped differently (for example because bridge is more rigid to horizontal movement than vertical). That means they decay differently too. To make it even more complicated, every one of these vibrations "bleeds" to the other dimensions too... that makes total of 6 filters in the schematic to analyze. Result is for example that string has fast decay at the start (vertical waves get damped quickly) and a long sustain afterwards (horizontal waves are damped less) Also the wave propagation is not perfectly linear (the vibrations get distorted) so even more black magic is happening...
My waveguide modeler
EDIT: 20.3.2014
My model uses simplified version of 2 dimensional string vibration. First model is fed with the excitation impulse and decays faster, at the same time it bleeds to second model which decays slower.
To use this string modeler, first load a wave file, which have to be a recording of a plucked string. I recommend using metal pick (for example coin) to capture the model, because it is richer in high frequencies - so the modeler has more info to work with. Now enter the exact pitch of the recording. Next elect filter order for both first and second model. Enter start times (in samples) and analysis lengths for both models. the first model corresponds to the start (attack) of the wave, so it should start from 0 by default. Second model corresponds to the late (decay) part of the wave - should be set around half second or second. Default analysis lengths (in the schematic named end point - sorry for the confusedness) are around 10000. Now click Analyze waveguide (click twice - first analysis attempt fails due to trigger errors in my schematic - I'll fix that one day...). On the screen you should see the excitation impulse wave (green) and amplitude (damping) and phase (dispersion) response of one of the models. You can switch between the model responses on the right.
Now your Model is fully ready and you can compare it with original wave by switching (upper right corner) between original and model and clicking replay.
EDIT: 22.3.2014
I've added save feature to both - excitator impulse which is basically a wav file. And also for the model - which is also stored as a wav file, however it is not actually a wave. First sample is an order of the filter, followed by the coefficients followed by order of second filter and corresponding coefficients.
I also created a simple waveguide synthesizer, that can load these excitators and models. sounds quite fine actually...
What is Digital waveguide synthesis?
It is a synthesis technique that digitally simulates wave propagation through instrument (in this case string). Sound in string is created by creating an excitation sound (by a pick, finger, bow, hammer,...) that propagates both directions through the string, bounces at string terminations and therefore travels back and forth (cycles around the string). as it travels and bounces it is damped and dispersed each time it passes the cycle. These damping and dispersion effects can be simulated by a filter with desired amplitude (to simulate the damping) and phase (to simulate dispersion) response.
Waves traveling both directions are identical and their interference is the actual vibration of the string we observe. This interference can be simulated by comb filters, however, because the string is linear system (basically also a feedback comb filter) it can be directly imprinted to the excitation. Also the impulse response of all reflection, dispersion and filtering is imprinted on it (the resonance of the body of instrument, reverb of room, response of microphone etc.).
How do I obtain the filter response and the excitation impulse?
This is the tricky part, that my schematic tries to do. First you enter the wave to analyze - recording of a string that is plucked - and a pitch of the sound. The analyzer compares the wave and a copy of the wave delayed by a period. By the least squares method that I posted earlier it estimates the filter. The string model is finished at this point. The excitation pulse can be recreated by sending the original wave trough inverse string model (feedforward instead of feedback topology).
What are the limitations?
Real world string vibrates in 3 dimensions (vertical, horizontal and lateral). These 3 separate waves are damped differently (for example because bridge is more rigid to horizontal movement than vertical). That means they decay differently too. To make it even more complicated, every one of these vibrations "bleeds" to the other dimensions too... that makes total of 6 filters in the schematic to analyze. Result is for example that string has fast decay at the start (vertical waves get damped quickly) and a long sustain afterwards (horizontal waves are damped less) Also the wave propagation is not perfectly linear (the vibrations get distorted) so even more black magic is happening...
My waveguide modeler
EDIT: 20.3.2014
My model uses simplified version of 2 dimensional string vibration. First model is fed with the excitation impulse and decays faster, at the same time it bleeds to second model which decays slower.
To use this string modeler, first load a wave file, which have to be a recording of a plucked string. I recommend using metal pick (for example coin) to capture the model, because it is richer in high frequencies - so the modeler has more info to work with. Now enter the exact pitch of the recording. Next elect filter order for both first and second model. Enter start times (in samples) and analysis lengths for both models. the first model corresponds to the start (attack) of the wave, so it should start from 0 by default. Second model corresponds to the late (decay) part of the wave - should be set around half second or second. Default analysis lengths (in the schematic named end point - sorry for the confusedness) are around 10000. Now click Analyze waveguide (click twice - first analysis attempt fails due to trigger errors in my schematic - I'll fix that one day...). On the screen you should see the excitation impulse wave (green) and amplitude (damping) and phase (dispersion) response of one of the models. You can switch between the model responses on the right.
Now your Model is fully ready and you can compare it with original wave by switching (upper right corner) between original and model and clicking replay.
EDIT: 22.3.2014
I've added save feature to both - excitator impulse which is basically a wav file. And also for the model - which is also stored as a wav file, however it is not actually a wave. First sample is an order of the filter, followed by the coefficients followed by order of second filter and corresponding coefficients.
I also created a simple waveguide synthesizer, that can load these excitators and models. sounds quite fine actually...
- Attachments
-
- waveguide synthetizer.fsm
- (19.07 KiB) Downloaded 1395 times
-
- waveguide_estimator.fsm
- (800.1 KiB) Downloaded 1381 times
Last edited by KG_is_back on Sat Mar 22, 2014 9:24 pm, edited 2 times in total.
- KG_is_back
- Posts: 1196
- Joined: Tue Oct 22, 2013 5:43 pm
- Location: Slovakia
Re: Digital waveguide sythesis
Interesting, KG! I tried it on an acoustic guitar, and the synthesized sound did resemble the original, however with a too short decay. Will study your schematics in more detail. Good stuff there!
-
martinvicanek - Posts: 1328
- Joined: Sat Jun 22, 2013 8:28 pm
Re: Digital waveguide sythesis
martinvicanek wrote:Interesting, KG! I tried it on an acoustic guitar, and the synthesized sound did resemble the original, however with a too short decay. Will study your schematics in more detail. Good stuff there!
That decay problem is caused by the fact that string oscillates horizontally and vertically. Vertical vibrations (to and back from the body) are damped faster cos' bridge is more loose to this kind of movement. Horizontal waves (side to side relative to the body) decay longer cos' bridge is more rigid to this kind of movement. Also these two movements constantly 'leak' into each other. I'm trying to figure out a way to separate them.
The result should be 3 filters:
Hvv will leak vertical back to vertical (this one is currently implemented as the only one)
Hhh will leak horizontal to horizontal (in a model of real string this one will attenuate less then the vertical)
Hhv (and Hvh) will leak between them (actually those are two filters with identical responses leaking in opposite directions)
One way to separate them would be to directly measure the two movements separately (for example with laser pickups or highspeed cameras) - then the calculations of filter responses would be relatively simple.
However I'm looking for a way to deduce them from the provided wave sample. We already know that vertical movement is more prominent in the transient and horizontal in the decay. I was thinking of capturing filter response at the beginning middle and end of the wave. The one at the start is closer to Hvv the one at the end to the Hhh the middle one is somewhere in between. And from these three responses somehow (I will need a help of a mathematician for that) deduce the Hvv, Hhh and Hhv for the model.
- KG_is_back
- Posts: 1196
- Joined: Tue Oct 22, 2013 5:43 pm
- Location: Slovakia
Re: Digital waveguide sythesis
Cant check fsm but saw the paper you did on it. Nifty!
But to further border on intuitive concepts, the only ones allowed in the back of my brain.
If the striking of the string would be perfectly symmetrical, you get the symmetrical pattern.
but two factors I can think of are a: clipping I.e necesity to expend excess energy in a lateral manner.
and b is gotta be the counter vertical strike of the string.
Also you would lose some energy hitting the back board in some cases, maybe you can measure some "odd harmonics?" or other tell tales the string hit the board. My guess is the motion of the string would never amplify in this scenario.
And both would have a negative effect on the duration of the resonance.
But the simplest technical input would be to use crossfaders, and allow to leak some into the other.
But to further border on intuitive concepts, the only ones allowed in the back of my brain.
If the striking of the string would be perfectly symmetrical, you get the symmetrical pattern.
but two factors I can think of are a: clipping I.e necesity to expend excess energy in a lateral manner.
and b is gotta be the counter vertical strike of the string.
Also you would lose some energy hitting the back board in some cases, maybe you can measure some "odd harmonics?" or other tell tales the string hit the board. My guess is the motion of the string would never amplify in this scenario.
And both would have a negative effect on the duration of the resonance.
But the simplest technical input would be to use crossfaders, and allow to leak some into the other.
192k @ 8ms
-
MegaHurtz - Posts: 105
- Joined: Mon Aug 11, 2008 6:29 pm
- Location: Eindhoven/Nederland
Re: Digital waveguide sythesis
MegaHurtz wrote:Cant check fsm but saw the paper you did on it. Nifty!
But to further border on intuitive concepts, the only ones allowed in the back of my brain.
If the striking of the string would be perfectly symmetrical, you get the symmetrical pattern.
but two factors I can think of are a: clipping I.e necesity to expend excess energy in a lateral manner.
and b is gotta be the counter vertical strike of the string.
Also you would lose some energy hitting the back board in some cases, maybe you can measure some "odd harmonics?" or other tell tales the string hit the board. My guess is the motion of the string would never amplify in this scenario.
And both would have a negative effect on the duration of the resonance.
But the simplest technical input would be to use crossfaders, and allow to leak some into the other.
Nonlinearity is simple to add to the model - the feedback filter that is estimated by least squares method can support also htan(in) htan(out) in*in or any other waveshaped version of input as parameter. Currently the separation of vertical and horizontal waves is more crucial for the design.
- KG_is_back
- Posts: 1196
- Joined: Tue Oct 22, 2013 5:43 pm
- Location: Slovakia
Re: Digital waveguide sythesis
No I mean estimate how the string starts to determine the trajectory.
And if it is going to have the capacity to expend that energy harmonically.
And if it is going to have the capacity to expend that energy harmonically.
192k @ 8ms
-
MegaHurtz - Posts: 105
- Joined: Mon Aug 11, 2008 6:29 pm
- Location: Eindhoven/Nederland
Re: Digital waveguide sythesis
The excitator contains the initial position of the string - you can see it is usually S-shaped, because it hold information for both directions of wave-propagation. first half of the S is the part for right to left motion and second half is the part for left to right motion (which becomes right to left and switches polarity once it bounces from the bridge) - that's why digital waveguide model contains only one direction of string propagation - both directions are identical.
In two dimensional model the excitator will probably need to have two tracks - one to be inserted into vertical and one to horizontal movement.
To simulate all elements of wave propagation in the string is super-hard... because the model would become extremely complicated and all parameters would become way too hard to measure. For example it is very hard to separate initial impulse from effect of body resonance and room reverb. In electric guitars also nonlinearity of pickups comes to question (which happens post-waveguide but at the same time it affects the waveguide) and things become very messy.
My goal is to create program that anyone could use to create his own waveguide models very simply without need of having Stenford laboratory at disposal.
BTW I started to remake the program (and continue in the project) in C++ (basically learning C++ from the scratch) cos' on many places the program needs higher-than-single precision which FS doesn't offer. Learning ruby might partially solve the problem but why not to learn C++ when I'm pushed to learn some language. I will probably use FS to implement the waveguide models in VSTi. I'm thinking of an virtual instrument in which you add your DWG models captured via this software and create your own waveguide-based instruments in similar way to a sampler.
In two dimensional model the excitator will probably need to have two tracks - one to be inserted into vertical and one to horizontal movement.
To simulate all elements of wave propagation in the string is super-hard... because the model would become extremely complicated and all parameters would become way too hard to measure. For example it is very hard to separate initial impulse from effect of body resonance and room reverb. In electric guitars also nonlinearity of pickups comes to question (which happens post-waveguide but at the same time it affects the waveguide) and things become very messy.
My goal is to create program that anyone could use to create his own waveguide models very simply without need of having Stenford laboratory at disposal.
BTW I started to remake the program (and continue in the project) in C++ (basically learning C++ from the scratch) cos' on many places the program needs higher-than-single precision which FS doesn't offer. Learning ruby might partially solve the problem but why not to learn C++ when I'm pushed to learn some language. I will probably use FS to implement the waveguide models in VSTi. I'm thinking of an virtual instrument in which you add your DWG models captured via this software and create your own waveguide-based instruments in similar way to a sampler.
- KG_is_back
- Posts: 1196
- Joined: Tue Oct 22, 2013 5:43 pm
- Location: Slovakia
Re: Digital waveguide sythesis
KG_is_back wrote:The excitator contains the initial position of the string - you can see it is usually S-shaped, because it hold information for both directions of wave-propagation. first half of the S is the part for right to left motion and second half is the part for left to right motion (which becomes right to left and switches polarity once it bounces from the bridge) - that's why digital waveguide model contains only one direction of string propagation - both directions are identical.
So it's even possible to estimate the 3d model on it, seeing the energy you expect to reflect on the negative part of the impulse response might differ from the actual energy that arrived. That's kinda cool
KG_is_back wrote:In two dimensional model the excitator will probably need to have two tracks - one to be inserted into vertical and one to horizontal movement.
The way we learned it is that it simply reflects every time. So for a good 2d estimation you may get away with two measurements and one model. Giving you distance and resistance.
KG_is_back wrote: For example it is very hard to separate initial impulse from effect of body resonance and room reverb. In electric guitars also nonlinearity of pickups comes to question (which happens post-waveguide but at the same time it affects the waveguide) and things become very messy.
True. Think deconvolving a reverb would be impossible. a pickup would be more along the lines of a liniar model.
Getting out of range at a certain point, representing resistance.
KG_is_back wrote: My goal is to create program that anyone could use to create his own waveguide models very simply without need of having Stenford laboratory at disposal. BTW I started to remake the program (and continue in the project) in C++ (basically learning C++ from the scratch) cos' on many places the program needs higher-than-single precision which FS doesn't offer. Learning ruby might partially solve the problem but why not to learn C++ when I'm pushed to learn some language. I will probably use FS to implement the waveguide models in VSTi. I'm thinking of an virtual instrument in which you add your DWG models captured via this software and create your own waveguide-based instruments in similar way to a sampler.
Im settled on 69k for all my stuff, it only just reaches the precision to do the sort of VA designs. But nothing beats learning C for it. I kinda wish I can afford it, seeing im working to get my soft karma in order The x64 assembler has hughe varables as well. But also may be more interesting to use inside C++ since it's graphically quite demanding to learn. I personally get a bit bored and start reverting to older patterns. And you know what they say when it's for school it's ok to crack it
192k @ 8ms
-
MegaHurtz - Posts: 105
- Joined: Mon Aug 11, 2008 6:29 pm
- Location: Eindhoven/Nederland
Re: Digital waveguide sythesis
I came up with something.... Instead of modeling vertical and horizontal movement and cross-bleed between them We can measure response on the start as one model and response on the end as second model and bleed only the first one to the second (instead of both directions). The model will start as the first one and slowly morphs into the second one and stays that way...
- KG_is_back
- Posts: 1196
- Joined: Tue Oct 22, 2013 5:43 pm
- Location: Slovakia
Re: Digital waveguide sythesis
Isnt a differentiator very close to what you get out of least squares?
ie:
out=in-late
late=in
ie:
out=in-late
late=in
192k @ 8ms
-
MegaHurtz - Posts: 105
- Joined: Mon Aug 11, 2008 6:29 pm
- Location: Eindhoven/Nederland
16 posts
• Page 1 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 39 guests