is it possible to generate pulse waves?

GoldWave general discussions and community help
Post Reply
raygrote
Posts: 14
Joined: Tue Aug 27, 2013 12:04 am

is it possible to generate pulse waves?

Post by raygrote » Sat Feb 17, 2018 7:42 pm

Hi all,
The expression evaluator in Gold Wave is a tool that goes way over my head. I was curious if it was possible to create a pulse wave with it (if you're unfamiliar a pulse wave is like a square but asymmetrical). I'd also like to somehow control the pulse width (or the proportion of high part to low part) of the wave. Pulse widths are commonly measured in percent, so 25 percent width would have 25 percent high and the rest low.

I discovered already that simply doing something like +1, -1,, -1, -1 to create a 25 percent pulse is not a good idea since the waveform is horribly off center. Gold Wave will even report a load of offset on such waveforms. Something I've found that works better is to take a saw wave, invert it, and mix it with another saw wave so that they're slightly misaligned. They will cancel out in an interesting way and create a pulse wave, the width of which is determined by the phase difference of the two saw waves. This seems to work better and sounds fine, and it has the easy advantage that you can do pulse width modulation if you detune one of the saw waves slightly. I managed to fool around and get that working with this expression: (2*f*t%2+-2*f*y*t%2)/2
F is the frequency of the main waveform and y is a multiplier for detuning the second saw wave to create pwm. Y values of between 1 and 1.01 seem to be best.

I'm guessing that the two saw waves approach would be the best way to do pulse waves in the expression evaluator, though I could well be wrong. So I was wondering what other people thought, and if it was possible to create a pulse wave with configurable width.

As an aside, I know this is a longshot but any tutorials for understanding the concepts one needs to know to actually figure these things out on my own? I doubt I'll ever get to a point where I can, since this kind of theory isn't something I find intuitive at all, but figured I'd ask anyway.
Thanks!

GoldWave Inc.
Site Admin
Posts: 3862
Joined: Wed Mar 10, 2004 6:43 pm
Location: St. John's, NL
Contact:

Re: is it possible to generate pulse waves?

Post by GoldWave Inc. » Fri Feb 23, 2018 10:01 am

For a simple pulse (0 to 1.0) with frequency f and width x percent, you can use the expression:

Code: Select all

((t*f)%1)<(x/100)
For a full range pulse (-1.0 to 1.0), use:

Code: Select all

(((t*f)%1)<(x/100))*2 - 1
Note that because pulse waves are asymmetrical, a large offset is normal. Usually pulse waves are not supposed to be centered.

Post Reply