# Harmonics of a vibrating string.

This topic is 4924 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Here are a couple of links to the 1D wave equation and it's solution.

1) Basic equation
2) It started out so simple...

-Josh

##### Share on other sites
Quote:
Original post by Grain
Quote:
 Original post by Eelcoon second thought, a good approximation would probably be:position in range [0,1]amp = maxamp * sin(position*Pi*i)/(i!)but thats mostly guessing im affraid.

Ok I tested it out and this is definitely not the solution. I get an exponential peak in my wave form at the place where I apply the impulse, While I logically should get a peak there, its no way it should be that big.

how exactly did you implement it? considering the /i!, exponential peaks are not to be expected.

Quote:
 Also on further consideration of the problem, Its not just the amplitudes I want but the phases as well.

the phases should all start out the same, and propagate at a speed defined by the properties of your string and which harmonic it is. (obviously, a twice as high harmonic has a twice as fast phase change, since it has a twice as high pitch)

##### Share on other sites
If you want to simulate a vibrating string then you definitely should look at this site:
Digital Waveguide Synthesis.

In case you're only intrested in finding out the harmonics then this might be useful to you: Harmonics.

##### Share on other sites
Quote:
 Original post by Grain@jonnyfish & timw: Thanks, I'll look in to wave equations and Fourier series and report back here.

It might seem a little advanced if you've never taken a differential equations class, but as long as you've done a bit of integral calculus it's not too bad. I would be happy to go into the details if you need me to.

##### Share on other sites
I think I'm going to go with Fourier series, It seams easier than the other approaches. Although still very complicated.

In researching Fourier series I found some java applets that allow you to draw a wave form with you mouse and then it will approximate it with N terms of the Fourier series. It appears this is the technique I need.

The questions is how do i get from a to b. from a plucked string, (which in theroy should be a triangle, who’s points are the two end points of the string and the plucked point) to the Fourier approximation of that shape.

And I have taken integral calculus, although it’s been a couple years since I've had to use any of it, so you help would be appreciated.

##### Share on other sites
Quote:
 Original post by GrainThe questions is how do i get from a to b. from a plucked string, (which in theroy should be a triangle, who’s points are the two end points of the string and the plucked point) to the Fourier approximation of that shape.And I have taken integral calculus, although it’s been a couple years since I've had to use any of it, so you help would be appreciated.

Hi Grain,

Here is a brief tutorial on how to calculate the Fourier coefficients. If you can integrate the integrals for an and bn in general (i.e. for any value of 'n') then it is easy to determine as many terms in the series as you want. For a function like a triangle this should be straightforward but feel free to ask if you're having trouble [smile]

-Josh

##### Share on other sites
Grain: You do realize that taking Fourier transform of the displacement of the plucked string at time t=0 does not give you really realistic results. You should take fourier transform of the time serie (i.e. sound) produced by the vibrating string. And I really think you should look into waveguides, here is a simple example (with sound samples): Physical Modelling (waveguides). And here's a google search that gives you more than enough information:Google

The previous link to waveguides (Julius Smiths homepage) gives you the theory behind waveguides. Waveguides are numerical aproximations of the 1d wave equation (there exists N-dimensional waveguides also).

##### Share on other sites
Quote:
Original post by jjd
Quote:
 Original post by GrainThe questions is how do i get from a to b. from a plucked string, (which in theroy should be a triangle, who’s points are the two end points of the string and the plucked point) to the Fourier approximation of that shape.And I have taken integral calculus, although it’s been a couple years since I've had to use any of it, so you help would be appreciated.

Hi Grain,

Here is a brief tutorial on how to calculate the Fourier coefficients. If you can integrate the integrals for an and bn in general (i.e. for any value of 'n') then it is easy to determine as many terms in the series as you want. For a function like a triangle this should be straightforward but feel free to ask if you're having trouble [smile]

-Josh

and for an impulse shaped pluck, it should yield (mistakes from me aside) the solution i initially posted.

##### Share on other sites
Quote:
 Original post by WinogradGrain: You do realize that taking Fourier transform of the displacement of the plucked string at time t=0 does not give you really realistic results. You should take fourier transform of the time serie (i.e. sound) produced by the vibrating string. And I really think you should look into waveguides, here is a simple example (with sound samples): Physical Modelling (waveguides). And here's a google search that gives you more than enough information:GoogleThe previous link to waveguides (Julius Smiths homepage) gives you the theory behind waveguides. Waveguides are numerical aproximations of the 1d wave equation (there exists N-dimensional waveguides also).
Well that does seem alot simpler, however does it allow me to remove certain frequencies from a string once its vibrating? If for example you pinch the string in the dead center. It should completely eliminate the fundamental and any harmonic with an anti-node there but leave all the others. It seems like it wouldn’t be possible with waveguides(unless I'm mistaken on how its supposed to work). With the Fourier series it would be a simple matter of just zeroing out those harmonics.

##### Share on other sites
From a another perspective a wave guide is just an IIR filter. If you press your finger on the middle of a string you effectively alter the wave impedance at the point you're touching. This modifies the IIR filter so that the fundamental and some of the harmonics will quickly fade away as would happen with a real string.

Depending on your implementation the change of wave impedance at certain point can be as simple as changing just a value of a variable or as complex as restructuring the delay line. In theory between every unit-delay pair in delay line pair there is a scattering junction. This scattering junction has one parameter which corresponds to the wave impedance at that discrete point. For more about scattering junctions read this.

You may also easily incorporate external exitation like in here. And here's an example of rigidly terminated string with virtual pickup.

Hope this gets you started.. you can determine the harmonic from the time serie read from the virtual pickup (through DFT).

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 10
• 13
• 17
• 13
• 13
• ### Forum Statistics

• Total Topics
634460
• Total Posts
3017583
×