To implement square waves, I'm using a wavetable that literally jumps between -1.0 and 1.0.
I know this isn't how squares work in the physical world, and it certainly doesn't sound very good. I'm wondering how un-ideal the typical square wave is in an analog synth. I know you can approach a square by adding odd integer harmonics, but how many of them would you add? Should their amplitudes be different? Are there any other subtleties that distinguish actual square waves from their textbook definition?
Non-ideal square waves
Forum rules
READ: VSE Board-Wide Rules and Guidelines
READ: VSE Board-Wide Rules and Guidelines
- Weirdofromouterspace
- Active Member

- Posts: 351
- Joined: Wed Mar 26, 2014 10:30 pm
- Real name: Bodo
- Gear: MFOS SLMS+ & Ultimate, TTSH, DX7IID, DX21, Minibrute, Poly-800, microKORG, microSAMPLER, Volca Beats & Bass, JX-03, Tr-8, Kawai K1, Jasper
- Location: Germany
Re: Non-ideal square waves
The 'corners' may be rounded a little bit, or have 'spikes' (note the difference between the SoundLab Ultimate and the other two). The vertical parts pf the curve may in fact not be exactly vertical (see the third picture in particular!), and so on.
I have added three pictures that should give you an idea, all of which were taken on my SDIY workbench:
1) MFOS SoundLab Ultimate
2) TTSH, VCO 2

3) MFOS SoundLab Mini

Hope that helps a bit
I have added three pictures that should give you an idea, all of which were taken on my SDIY workbench:
1) MFOS SoundLab Ultimate
2) TTSH, VCO 2

3) MFOS SoundLab Mini

Hope that helps a bit
Don't forget to TURN ON THE SYNTHESIZER. Often this is the reason why you get no sound out of it. - ARP 2600 manual, 1971
-
commodorejohn
- Synth Explorer

- Posts: 1601
- Joined: Mon Aug 12, 2013 2:39 am
- Real name: John
- Gear: Roland JX-10/SH-09/MT-32/D-50, Yamaha DX7-II/V50/TX7/TG33/FB-01, Korg MS-20 Mini/ARP Odyssey/DW-8000/X5DR, Ensoniq SQ-80, Oberheim SEM
- Location: Sacramento, CA
- Contact:
Re: Non-ideal square waves
My cheapo solution for implementing non-ideal square waves (modeled loosely on what I've seen of traces from Moog oscillators) is as follows:
- If the comparator state has flipped (i.e. the ideal pulse wave goes from 1 to -1 or vice-versa,) set the new output value to the ideal.
- If the comparator state has not flipped, set the new output value to a fraction of the current output value, where the fraction is nearly 1 but not quite (this requires playing around with, I can't remember what I have it set to in my code.)
Computers: Amiga 1200, DEC VAXStation 4000/60, DEC MicroPDP-11/73
- Zamise
- Supporting Member!

- Posts: 2356
- Joined: Wed Oct 20, 2004 2:41 am
- Gear: Rollhand P00
- Band: Quantum-Source
- Location: DenverMetroUSA, Quantum-Source.com
- Contact:
Re: Non-ideal square waves
Not sure this applies to your questions, but I tried to do some sampled PWM a while back using sampled squares, and I noticed even the "perfect" digitally generated tone was not perfect, then looks pretty perfect imported tho, played back analog outs the end result could barely be seen as anything useful or recognizable really. Anyhow here are the screen grabs if it does anything for you or not. The original squares were generated in CoolEdit2000.


Last edited by Zamise on Tue Feb 19, 2019 11:01 pm, edited 1 time in total.
Re: Non-ideal square waves
What about the typical Roland square wave? And by others too. You can see how they are derived from the saw core oscillator. They aren´t flat, that´s the portion of the saw wave that passes through before the comparator goes into saturation. Note how both the positive and the negative portions point towards the zero crossing.


Herrare umanum est.
Re: Non-ideal square waves
Even if a square wave looks perfect on screen, there´s always the slew rate of the amplification and the speaker driver itself. The lower mass and inertia the better, but it always takes time to "travel" from one "state" to another, so we are never able to hear how an ideal square wave sounds. What we hear is distortion produced by non ideal playback devices. Anyway, all classic waveforms when viewed on screen, if they´re not the simple geometric figures then they´re just distortions of the ideal waves. So we can use distortion to make the wave sound subjectively nicer.
There is a very informative article by Nelson Pass on the subject of distortion. It´s important to distinguish between linear and non linear distortion.
There is a good example of non linear distorion applied to a sinewave. It generates even harmonics. The same principle apllied to a square wave would at least look interesting I think. By making the square non symmetrical where the positive portion is different from the negative, and not a mirror image of.
I´ll see if I can find that article.
There is a very informative article by Nelson Pass on the subject of distortion. It´s important to distinguish between linear and non linear distortion.
There is a good example of non linear distorion applied to a sinewave. It generates even harmonics. The same principle apllied to a square wave would at least look interesting I think. By making the square non symmetrical where the positive portion is different from the negative, and not a mirror image of.
I´ll see if I can find that article.
Herrare umanum est.
Re: Non-ideal square waves
Here it is. Don´t be put off by the word "audiophile". The man knows his stuff. 
https://www.passlabs.com/sites/default/ ... edback.pdf
https://www.passlabs.com/sites/default/ ... edback.pdf
Herrare umanum est.


