Page 1 of 2

Harmonic Creation

PostPosted: Mon Apr 18, 2016 8:49 am
by Rocko
Hi all,

I'm playing around with building a harmonic creator with 3 controls for the output:
1. Amount of fundamental (original tone)
2. Amount of ODD harmonics
3. Amount of EVEN harmonics

Though it is easy to create EVEN harmonics without the fundamental (and remove DC which is zero harmonic), I can't seem to figure out a way to create the odd harmonics without the fundamental. With any ODD harmonic creator I had found, the fundamental is part of the output, so I can't control it separately.

Is there a mathematical way to produce only ODD harmonics without the fundamental?
I've tried to subtract the input from output for that channel, but even that doesn't help. Something like:

Code: Select all
output = ODD_Function(input) - input

If not by a mathematical function which can create ODD without fundamental, are there any smart ways to 'scoop' out the fundamental and give it its own 'intensity knob' one which differs from the 'ODD' harmonics intensity knob?


Re: Harmonic Creation

PostPosted: Mon Apr 18, 2016 10:13 am
by tulamide
I might embarrass myself now, but:

Harmonics are integer multiples of the fundamental, including the fundamental (which is the first harmonic). Therefore, odd harmonics by definition will always contain the fundamental, right?

However, since they are multiples, why not just calculating them?
fundamental * 3 = 3rd harmonic
fundamental * 5 = 5th harmonic

Besides my stupid words, here's a website that answers pretty much everything related to audio, with lots of formulas:
Sengpiel was a 2x Grammy awarded sound engineer. He died a few years ago, but his son manages the site now (which means, no new content, but the site won't vanish from the net). And as you can see, he pretty much covered everything while he was alive.

For example, this is what it tells about harmonics:

Re: Harmonic Creation

PostPosted: Mon Apr 18, 2016 11:45 am
by Rocko
Thanks Tulamide... Reading through it.

IF I understand correctly your post, you are suggesting that there is no way to create 3rd,5th,7th harmonic without the fundamental, unless one re-syntesizes them (i.e. find the original frequency of fundamental, then multiply and feed a sine wave oscilator).
Is that correct?

since my mathematical knowledge is not high, my question is if there a way to create only ODD harmonics without fundamental, with a mathematical function (not res-synthesis). Somethign like 'tanh(x) or x^3 ,etc.'.

As far as I understand it. This is not possible. But any light shed on this issue would be appreciated...

Re: Harmonic Creation

PostPosted: Mon Apr 18, 2016 12:10 pm
by tulamide
Yes, if you know the fundamental frequency (which is the first and therefore an odd harmonic), it is as you said.

Another way would be to FFT the signal to get the already existing harmonics, then extracting whatever you need.

But in general, I don't understand how you want to create odd harmonics (3rd, 5th, 7th, etc.) without a fundamental frequency? That's impossible for both, odd and even harmonics. Or am I stupid and don't get the point?

Re: Harmonic Creation

PostPosted: Mon Apr 18, 2016 12:32 pm
by Rocko
Sorry.. I might have not exlained myself correctly. Of course there is a need for a fundamental frequency... ;-)
That is the input...
So let me explain again.

I'm trying to build a module with audio input and audio output (effect not instrument).
The input should be any pure sine wave tone (i.e. fundamental), not pre-known (i.e. music stream, let's consider it as pure tone for discussion).
The output can be one of these (user can choose):

A. Odd harmonics (3,5,7,9 for example), without the original fundamental
B. Even harmonics (2,4,6,8 for example), without the original fundamental
C. The original fundamental

Each output has its dedicated volume knob, so user can mix and match the harmonic type.
For 'B' - it is easy. I can use 'y=abs(x)' and receive all the even harmonics without the fundamental. I'll just need to filter out DC and prevent aliasing, as an example.
For 'C' - I just need to pass the fundamental from input to output...

But 'A' - I'm not sure if this is achievable (without re-synthesis or FFT, just mathematical function, equivalant to abs(x) or tanh(X), etc.).

My question -
Is there a similar function to recieve ODD only harmonics without the fundamental as output?

Hope this makes it clearer...

Re: Harmonic Creation

PostPosted: Mon Apr 18, 2016 1:21 pm
by Spogg
Fascinating Rocko!

y=abs(x) will give you full-wave rectification from a bipolar signal. So if your fundamental source is a sine wave you will get more harmonics that just the 2nd; it won't be pure. If you remove the DC from the resulting signal you will get asymmetry and if you then do y=abs(x) again you will get even further from pure harmonics.

I think the way forward would be to rapidly analyse the pitch of the incoming sine wave then use the frequency value to control individual sine oscillators (Martin's of course!) and bipolar ring modulators as doublers to create the harmonic series you want.

I've just done something like this in my forthcoming Quilcom 4EA+ synth but I didn't need to analyse for the fundamental because it's a synth, so it "knows" the base pitch required.



Re: Harmonic Creation

PostPosted: Mon Apr 18, 2016 6:56 pm
by BobF
Hi Rocko,

What are you trying to do differently than your old post from 2012, Creating (a single) harmonic?
Also can you not just use some wave form rich in harmonics, square, saw, or pulse and just filter out what you want. I guess it would have to be a tracking filter with a sharp band pass of some sort.

I have a drawing that I have not even started working on with Flowstone yet. I wanted to create a module to allow you to input a complex wave form and remove the fundamental and leave just the harmonics or anyone harmonic. Is this anything like you are trying to do?

Later then, BobF.....

Re: Harmonic Creation

PostPosted: Mon Apr 18, 2016 10:05 pm
by noisenerd
Would a Chebyshev waveshaper work? Something like this:

I was actually just trying to do something similar myself, but I think I've misunderstood something, because it doesn't seem to be working right. Here's what I've got so far if you wanna have a look:

Feel free to do with it as you please... but if you figure out what I've done wrong, please do share. :)

Re: Harmonic Creation

PostPosted: Mon Apr 18, 2016 10:22 pm
by martinvicanek
Chebyshev will work only if you feed it with a sine with a specific amplitude. That is of limited use IMHO.

Re: Harmonic Creation

PostPosted: Mon Apr 18, 2016 10:30 pm
by noisenerd
martinvicanek wrote:Chebyshev will work only if you feed it with a sine with a specific amplitude. That is of limited use IMHO.

Well, there's the problem then. Thanks for clearing that up!