# How do I distort thee, let me count the ways ...

Posted: 3/27/2009 12:49:22 PM

From: Escondido, CA

Joined: 2/6/2008

This is a continuation of the thread "building a thereming" from where Fred left off.

Regarding Fred's comments about only lower harmonics getting through the filter, regardless of where the corner freq. was set:

This looks like it is all leading right back to the supposition that you need to do the waveshaping prior to the mixer to control timbre. Thus the need to distort the waveshape of one of your oscillators slightly.

The local oscillator is the logical choice. Being at a fixed frequency, the spread of harmonics added by the local oscillator will be consistent. They will combine with the pitch oscillator's harmonics differently at different pitches, since no attempt is made to alter them to match the spread at the pitch oscillator's frequency.

What does that mean? Well years ago someone asked me to build something they could sing into that would generator harmony parts. Great idea! I thought ... but I had no clue how to do all the DSP to correct the harmonics to sound right for the harmony part. Now you can go buy something off the shelf to do this.

So the same principle holds. We are not adjusting the spread of harmonics to match the pitch oscillator's frequency, so the timbre will be different for higher frequencies vs lower frequencies. For example: If you distort the local oscillator's waveform so it looks a bit like a rounded-off sawtooth wave and combine it with a near-perfect pitch oscillator at higher frequency it will still sound more female voice like. Whereas at lower pitches it will have a rich "warm" sound to it.

Don
Posted: 3/27/2009 5:56:53 PM

From: Colmar, France

Joined: 12/31/2007

Don, I'm afraid you are not matching the reality with your above statement.

Let a1...an be the harmonic coeficients of the fixed osc signal and b1...bn those of the variable osc. After the mixer you'll find the scalar product r1...rn = a1xb1...anxbn.
This shows that the waveform will be independent of the pitch (that's just the advantage of pre-mixer wave shaping!). And you see that the waveform of both which is poorer in harmonics will be predominant for the output waveform, independent of its source, variable or fixed osc.
Posted: 3/28/2009 6:24:50 AM

From: Eastleigh, Hampshire, U.K. ................................... Fred Mundell. ................................... Electronics Engineer. (Primarily Analogue) .. CV Synths 1974-1980 .. Theremin developer 2007 to present .. soon to be Developing / Trading as WaveCrafter.com . ...................................

Joined: 12/7/2007

Thierry is absolutely correct here..

In order to do any pre-mixer wave shaping, all the harmonics required in the output (audio) waveform must be available in BOTH waveforms being fed into the (heterodyning) mixer.. The quantity (amplitude) of any particular harmonic appearing in the output (audio) waveform will never exceed the LOWEST level of that particular harmonic which is available from either input waveform.

Possibly the simplest way to modify output waveform harmonics is to have one oscillator (say the reference oscillator) having a waveform with high harmonic content, and then changing the other "pitch" oscillator waveform's waveshape..

For example - If the reference waveshape is a ramp, it will contain both odd and even harmonics - the amplitude of each harmonic = 1/harmonic number.. so the fundamental (1/1) will have reletive amplitude of 1, 2nd harmonic will have reletive amplitude of 1/2 (0.5).. 3rd have 1/3 (0.333) etc...

Now, with this waveform being fed to one input of the mixer, changes in the waveshape (harmonic content) of the other oscillator will always have an effect on the output waveform - so one can change the output waveform quite simply by changing the waveform of a single oscillator.... HOWEVER.. One is still limited to the harmonic spectrum available in a ramp waveform.. One could not produce a square wave on the output even if the waveshape of the 'pitch' oscillator was a square wave.. What one would get would be an output waveform containing odd harmonics only, but where the amplitude of these harmonics followed those of the ramp waveform (this is a really pleasing waveform to my ears, but it is not a square wave.. if you want a square wave, you cannot get it).. This is why I have been playing with a switchable reference waveshape - ramp, square and triangle.. it also allows rapid changing of output tone, as one can quickly eliminate even harmonics by switching to a square reference.

I think it should be possible to create a 'reference' waveform which would cater for all possible waveshapes - I have not tried this, or even simulated it - but if one had a waveform with a series of all harmonics at equal amplitude, this should work..?.. BUT... There could be huge problems.. the peak amplitudes of such a wave shape could be huge, even if one was able to generate it.

[b]edit>>[/b][i] I have just run some simulations mixing 1V sine generators for 16 harmonics - the output waveform is quite complex - resembling a "pulse" waveform (in fact, the 'pulse' is more like a single cycle HF sine.. with other components between the pulses...) [/i]
see WAVEFORM (http://www.therasynth.com/assets/images/harmonics1.GIF) [i]
The pulse amplitude will be a problem, as it goes from +Ve to -Ve supply (+/-12V).. One would need a mixer which could cope with these amplitudes, or attenuate both this and the other waveform suitably, with the consequential degradation of signal quality.. Also, great care would be needed in producing and coupling this HF pulse waveform, as it could radiate like hell)[/i]

Fred Mundell
Fundamental Designs Ltd.
Electronics Consultant.
<- See Profile Image for Email.
Designer of Theremins and other alternative electronic music controllers and instruments.
Posted: 3/28/2009 7:12:27 AM

From: Eastleigh, Hampshire, U.K. ................................... Fred Mundell. ................................... Electronics Engineer. (Primarily Analogue) .. CV Synths 1974-1980 .. Theremin developer 2007 to present .. soon to be Developing / Trading as WaveCrafter.com . ...................................

Joined: 12/7/2007

Let me count the ways...

[i]"This looks like it is all leading right back to the supposition that you need to do the waveshaping prior to the mixer to control timbre. Thus the need to distort the waveshape of one of your oscillators slightly.[/i] -Don.

I do not agree with the "you need to do the waveshaping prior to the mixer to control timbre"..
Post-mixer waveshaping does work, and is the method used in the vast majority of Theremins as the PRIMARY method of tone control.. There is 'pre-mixer' waveshaping related to oscillator interaction (skewing) in most Theremins, but apart from this, the only circuit I have seen where pre-mixer harmonic shaping is deliberately employed is the Moog 201.

ALMOST everything which can be done pre-mixer to the waveshape, can be done post-mixer.. The only problem is that to do fully controlled post-mixer waveshaping requires some means of compensating for the variable frequency of the mixer output waveform - and this involves deriving a control signal related to this frequency - usually this is a voltage obtained from a pitch->voltage converter. An accurate, thermally stable pitch->voltage converter is rarely included in standard Theremin circuitry due to difficulty / expense.

When one has a voltage from P->V one can manipulate the waveform from the mixer at will - for example - you can square it and use it to trigger an ramp circuit, where the ramping rate is controlled by the pitch voltage, so its amplitude is invariant.. You can take this ramp to a voltage controlled filter and perform subtractive synthesis.. You can do everything one can do with an analogue synthesiser.. almost.. You can even use the pitch voltage to drive VCO's to generate new waveforms.

It is my belief that the best sounding Theremins (E-Pro and Tvox) use the voltage control method for waveshaping and Filtering.

If one does not have a control voltage, one is limited to fixed frequency waveshaping and filtering - this is the main method used on Theremins - and can be quite good, but tonal charactaristics will never track the audio frequency.

Pre-Mixer waveshaping is, I believe, a largely unexplored area - it has some huge advantages and possibilities, which include means of precise harmonic control which exceeds what most musical instruments can manage.. Additive synthesis is possible due to the ease with which individual HF harmonics can be isolated, and the fact that the oscillator frequencies can be regarded as fixed frequency (a 10kHz change in a ~200kHz frequency is only 5%) makes the idea of having a controlled mixing of individual harmonics to produce the desired tone, a possibility.
Posted: 3/28/2009 5:09:34 PM

From: Colmar, France

Joined: 12/31/2007

Fred, just a little hint:

If you multiply a ramp signal with a square signal, you will obtain a triangle wave. It will perhaps not look as a triangle because of phase deviation, but the harmonic coefficients will be the same.

Multiplying whatever signal with a ramp signal gives the same effect as a 6db/octave low pass filter.

Best regards from the country of Descartes ;-)
Posted: 3/28/2009 5:38:00 PM

From: Eastleigh, Hampshire, U.K. ................................... Fred Mundell. ................................... Electronics Engineer. (Primarily Analogue) .. CV Synths 1974-1980 .. Theremin developer 2007 to present .. soon to be Developing / Trading as WaveCrafter.com . ...................................

Joined: 12/7/2007

[i]"If you multiply a ramp signal with a square signal, you will obtain a triangle wave. It will perhaps not look as a triangle because of phase deviation, but the harmonic coefficients will be the same.Multiplying whatever signal with a ramp signal gives the same effect as a 6db/octave low pass filter."[/i]

Thank you, Thierry!.. When it comes to the language of mathematics, I am almost pre-verbal! This means that almost every maths problem I encounter I must solve painstakingly from basics, without access to the tricks!
I presume that the "Multiplying whatever signal with a ramp signal gives the same effect as a 6db/octave low pass filter" works because one multiplicand (the ramp) has harmonics which reduce at 6db/octave... Makes perfect sense! - Only wish I had known/thought about this a long time ago.. This single 'trick' proves the concepts I spent hours determining with complex harmonic tables etc..

And yes.. Descartes was, in my opinion, probably the greatest genius the world has produced.. "I think, therefore I am" is still the only absolute certainty!

Greetings from the land that produced Newton and Tony Bliar! ;)
Posted: 3/28/2009 5:53:54 PM

From: Colmar, France

Joined: 12/31/2007

Fred, thank you for "Tony Bliar".

As you know I can only communicate in your language with the help of two more open browser windows displaying online dictionaries. So I thought first that you made a typing error until I discovered the word-play several minutes later.

When someone tells me a joke in English I have to laugh three times:
i) When the joke has been told.
ii) When the joke has been explained.
iii) When I'll have understood (mostly some days later...)

Playing around with waveforms makes fun. Did you know that you may exactly double the frequency of a ramp signal just by subtracting a square wave of the same basic frequency and a half of its peak amplitude?
Posted: 3/28/2009 7:19:20 PM

From: Eastleigh, Hampshire, U.K. ................................... Fred Mundell. ................................... Electronics Engineer. (Primarily Analogue) .. CV Synths 1974-1980 .. Theremin developer 2007 to present .. soon to be Developing / Trading as WaveCrafter.com . ...................................

Joined: 12/7/2007

[i]"I have to laugh three times:
i) When the joke has been told.
ii) When the joke has been explained.
iii) When I'll have understood (mostly some days later...)"[/i] [b] 3 laughs for the price of one ! - Bargain! ;)[/b]

Sorry - I never imagined that "Bliar" was not generally accepted as a synonyn for our arrogant ex PM - the man who single handedly destroyed the Labour party, and any remaining honerable reputation Britain had.. One day we WILL get him to stand trial in the ICC.. (hopefully together with the present PM Brown-nose)

"Playing around with waveforms makes fun".. I agree! - Yes, I have done the ramp / square trick, and many others.. But I suspect that I go about it in a completely different way to what you would - I rarely use mathematics - mostly I can visualise results of mixing waveshapes.. a lot of this is from having built hundreds of VCO's and messing with squaring / integrating / mixing resulting waveforms on the 'breadboard'..

Adding + Subtracting are no problem - Multiplying, however, is not nearly as easy to visualise.
Posted: 3/28/2009 9:56:56 PM

From: Eastleigh, Hampshire, U.K. ................................... Fred Mundell. ................................... Electronics Engineer. (Primarily Analogue) .. CV Synths 1974-1980 .. Theremin developer 2007 to present .. soon to be Developing / Trading as WaveCrafter.com . ...................................

Joined: 12/7/2007

Thierry..
Your tip about multiplying a waveform with a ramp, to produce a 6db LPF, got me thinking that something was wrong with statements I had made earlier.
In the preceding thread I stated that mixing (multiplying) two identical waveshapes resulted in the output being the same as the source waveshape... This was WRONG! (mixing a ramp with a ramp would produce the waveform of a ramp via a 6db LPF - I have just tried this, and it is true! .. so my original statement is false)

The error I made was in not correctly multiplying the harmonic amplitudes - In fact, multiplying 2 identical waveshapes always produces an output waveform with less harmonics than the source waveform/s.

It now seems to me that the only way to 'reflect' a waveshape fed into the mixer (multiplier) in its output waveshape, is by having a waveform on the other input which had equal amplitude for all desired harmonics..
Am I correct on this? - Effectively each harmonic one wants on the output must be multiplied by a harmonic on the 'reference' waveform, and the amplitude of every harmonic in this 'reference' waveform must be the same.

In practice, I am not too worried about the above - the sounds I am getting from having selectable ramp,square and triangle reference waveforms are more than adequate, and pleasing.. but I am dissatisfied at not having achieved what I believed I had achieved.

Posted: 3/29/2009 4:15:01 AM

From: Colmar, France

Joined: 12/31/2007

It's a question of imagination. The problem of us "technicians" may be that we rarely meet this question. Our daily bread in RF mixing is either the case of two sine waves (which have no harmonics) or the XORing of two square waves (which is not a linear 4-quadrant multiplication). Out of that we have normally to do with mixer circuits which are far away from ideal multiplicators and thus adding more harmonics than expected.
The next is the phase question. We often meet frequency-depending phase shift which makes it difficult to identify the waveform visually. A ramp signal may mute into a "pregnant" sine-like wave without changing the harmonic content...
That's why I don't rely too much on visualisation.

Best regards from the country of Fourier!