[sdiy] Fourier Analysis Question

Richie Burnett rburnett at richieburnett.co.uk
Sat Dec 18 14:46:32 CET 2010

```Hi Tom,

You have picked a very challanging instrument to model with FFT, and
synthesis or short wavetables!  Most modern synths use multi-samples with
one wave for every three or four semi-tones.  They also use relatively long
samples with carefully chosen loop points for the reason that someone else
already mentioned:  The slight detuning of the strings for each note means
that the periodicity of the resulting overall waveform is very long.  If you
could remove all of the strings except one from each note (I wouldn't
recommend it!)  then you could sample a much simpler tone with more
localised periodicity and store this in a shorter wavetable.  Then you could
duplicate this three times during playback with slight detuning to model the
detuning of the multiple strings.  This should get close but won't model the
non-linear effects and the coupling of energy between the three strings
because they all resonate at similar frequencies.

> In part, I want to separate out the parts of the piano waveform I *can*
> analyse with FFT and model with wavetable synthesis (e.g. all the harmonic
> bit) and see what and how much is left over. If I can see and hear the
> enharmonic part alone, it might give me clues as to how to model that
> element of sounds.

One way to seperate out the inharmonic partials from the harmonic partials
is to comb filter the sound with a delay equal to the fundamental period.
This comb filtering essentially filters out all of the tones with
frequencies that are multiples of the fundamental frequency, leaving only
the inharmonic clunk of a piano, twang of a guitar, or chiff of wind for a
blown instrument.  I think this is basically what Roland did for LA
synthesis, breaking the sound up into short un-pitched "Attack" waves and
short pitched "sustain" waves that can be easily looped.  (Another way to do
the same thing is to FFT the sound, zero the bins containing harmonically
related energy, then IFFT to get back to the time domain.)

Of course this comb filtering is only partially effective for a piano for a
couple of reasons.  Firstly you have multiple strings so it doesn't have a
single fundamental frequency, and secondly the higher order modes of the
vibrating string are unlikely to fall exactly on the harmonic frequencies as
we would like for reasons the physicists can probably explain best!  Higher
modes for a constrained vibrating string tend to go progressively flat or
sharp, I forget which.

Modelling a piano is very difficult because it is a very rich constantly
evolving tone, and the timbre changes completely from the bottom octaves
through to the top octaves.  Whilst it is interesting to analyse sounds with
FFT, wavelets etc, you could probably devote a lifetime's work to getting a
decent piano model and then worrying about implementation details like
word-length effects etc, when you actually have the real thing sitting
downstairs!?!? ;-)

This discussion on Music DSP might give you some interesting ideas, and
shine some light on the magnitude of the problem too:

http://music.columbia.edu/pipermail/music-dsp/2010-December/069442.html

I hope this helps,

Happy holidays all,  Have a good one :-)

-Richie Burnett,

```