Bandslimited synthesis - get number of harmonics
Moderators: MattKingUSA, khz
-
- Established Member
- Posts: 681
- Joined: Sat Nov 01, 2014 8:15 pm
- Location: The Internet
- Been thanked: 1 time
Bandslimited synthesis - get number of harmonics
The question is here: https://stackoverflow.com/questions/468 ... -harmonics
- sadko4u
- Established Member
- Posts: 989
- Joined: Mon Sep 28, 2015 9:03 pm
- Has thanked: 2 times
- Been thanked: 361 times
Re: Bandslimited synthesis - get number of harmonics
It wouldn't be so funny if it wasn't really so sad.
The answer is in your code copy-paste.
Obviously, the highest harmonic number is numharmonics.
The answer is in your code copy-paste.
Obviously, the highest harmonic number is numharmonics.
LSP (Linux Studio Plugins) Developer and Maintainer.
-
- Established Member
- Posts: 681
- Joined: Sat Nov 01, 2014 8:15 pm
- Location: The Internet
- Been thanked: 1 time
Re: Bandslimited synthesis - get number of harmonics
It is so funny that you can't even read:
I wrote this code myself. I just don't know if numharmonics is correct.Here's what I've come up with intuition
Re: Bandslimited synthesis - get number of harmonics
freq*n gives you the frequency of the nth harmonic. as long as its below nyquist (samplerate/2) then you are fine. So your equation for nharmonics is correct. I didn't really look at the rest of it.
_ssj71
music: https://soundcloud.com/ssj71
My plugins are Infamous! http://ssj71.github.io/infamousPlugins
I just want to get back to making music!
music: https://soundcloud.com/ssj71
My plugins are Infamous! http://ssj71.github.io/infamousPlugins
I just want to get back to making music!
Re: Bandslimited synthesis - get number of harmonics
I just had a look at it quickly. Hope I am not too tired to figure out maths...
Pulse Wave:
It does look like the pulse wave is a sum of tones whose frequency grows as nf, where f is the fundamental and n = 1,2,3,....
So, if we call N the maximum allowed number of harmonics: Nf < fs / 2 <=> N < fs / 2f = harmonics order limit.
Where fs is the sample rate.
Triangle Wave:
This time the harmonic's frequencies goes like (2n + 1)f, hence:
(2N + 1)f < fs / 2 <=> N < (fs / 2f - 1) / 2 = harmonics order limit.
Sawtooth Wave:
As the Pulse Wave.
Pulse Wave:
It does look like the pulse wave is a sum of tones whose frequency grows as nf, where f is the fundamental and n = 1,2,3,....
So, if we call N the maximum allowed number of harmonics: Nf < fs / 2 <=> N < fs / 2f = harmonics order limit.
Where fs is the sample rate.
Triangle Wave:
This time the harmonic's frequencies goes like (2n + 1)f, hence:
(2N + 1)f < fs / 2 <=> N < (fs / 2f - 1) / 2 = harmonics order limit.
Sawtooth Wave:
As the Pulse Wave.