Shop OBEX P1 Docs P2 Docs Learn Events
Who has experience with harmonics — Parallax Forums

Who has experience with harmonics

I have a 100hz sine wave that I am adding harmonics to with a tube/saturation plugin. I want to experiment with how different the harmonics look vs the fundamental to see what the simulation is doing to add/create harmonics that weren't there. I haven't tried to look at the output on a scope as it makes sense the scope can only show all voltages combined so it would not be possible to analyze a specific harmonic to see its shape compared to the original. For example how different will a 2nd harmonic (octave) look.

The first obvious though is to try to get a tight filter on the 2nd harmonic and try to view it on a real scope. Then test various waves ie sine saw square triangle. Maybe someone knows a better more accurate way to isolate a frequency and view its shape. The spectrum analyzer only allows so much. Even a square wave looks look a sine. The second image is an example of how what I want to see isolated on a scope.

Comments

  • That is not what one typically means when one speaks of a "scope." That's a spectrum analyzer. Scopes show the voltage change over time, while a spectrum analyzer tells all the frequencies present in the signal. Those aren't sine waves, they are overlapping peaks of energy centered on particular frequencies. They have that shape as a combination of imperfections in the sound source and the spectrum analyzer itself. Traditional spectrum analyzers work by sweeping the center frequency of a sharp filter across the frequencies, but the filter is never perfectly sharp and its response will contribute to the shape of the peaks. Some processes such as MP3 recorders take a small sample and do a digital Fast Fourier Transform instead of sweeping a filter.
  • Thanks, I agree its not a scope as what I'm looking for is a way to view each frequency on a scope though. The original sound is from a sine wave generator and is a perfect sine wave 100hz and the goal is to find a way to view each harmonic being added. It is easy to connect my real scope and see a perfect sine wave if I generate just a sine wave and don't add harmonics.
  • Most informative from a learning standpoint could be a second sine wave generator with a potentiometer connected between the two outputs. The pot allows you to vary the amplitude ratio from all one to all the other. Set the frequency of one to twice the frequency of the other, or whatever Hz ratio Phase makes a difference, and if the frequencies are only slightly different, you can visualize the effect as phase gradually drifts.

    Also, try an x-y lissajous display of 100Hz against a harmonic.

    By the same token, take the 100Hz signal after the saturation plugin, and play it against a second sine wave generator that is locked to a harmonic of 100Hz. At some amplitude and phase, the second signal will cancel out the harmonic component in the distorted signal.
  • If you could magically separate a single harmonic from a complex signal -- which you can't -- it would be a pure sine wave, because that's how they are defined. The principle of Fourier analysis, which is what a spectrum analyzer approximates, is that any real world signal can be represented as a sum of pure sine waves. In many real world complex signals those component sine waves cluster around multiples of a base frequency, and those are harmonics, but because real world signals are not perfect there are usually other frequencies hanging around, some grouped near the harmonics and some representing other entirely different sources of energy.

    There are basically two ways to visualize a signal. Time domain represents voltage changing over time, which is where you see the actual sine waves if a signal is pure enough and a mishmash if it has a lot of component frequencies. Frequency domain is a graph of the frequencies comprising the signal, such as you get from a spectrum analyzer. In the real world neither graph represents a signal perfectly because of measurement resolution.

    You can reconstruct a signal by taking the frequency domain graph and connecting up a bunch of oscillators set to the component frequencies and amplitudes and adding them up, and you could "take out" a frequency by not hooking up that oscillator. In fact this is exactly what you are doing when you play back a MP3 music file, which represents sound as the sum of all the frequencies it contains during each short time slice. But you cannot take out a single pure exact frequency, because each element of the frequency domain graph represents a small range of frequencies. You would need infinitely fine voltage and time resolution to isolate a single pure tone.

    In practice as long as we have good but not necessarily perfect resolution we cannot tell the difference between an original sound and a reconstructed sound made of pure tones representing the center frequencies of the elements of the frequency domain graph, which is why MP3 compression works.
  • ercoerco Posts: 20,257
    Either of these two.

    Edit: Oh. Harmonics. Never mind. :)

  • Harmonics in electronics are fascinating. On a string that vibrates, it's easy to understand the divisions of length and see and hear the harmonics. In electronics, if you generate a square wave it is not clear why there are harmonics added out of nowhere. As an effect, plugins attempt to replicate tube and transformers and clipping. In analyzing the result of a plugin my putting in 100hz sine and seeing the resulting added even and/or odd harmonics, the harmonic addition IS the desired sound. You can try many different plugins and find one that more pleasing. More or less of certain harmonics. My question is how are they adding the series of harmonics to the pure sine wave inside of software when the original sine wave is still in tact, not clipped. It seems like simple multiplication of the entire signal, as all the signal gets the same harmonics added. Maybe they multiply x2, x3 x4 x5 x6 etc and add the result back in at a lower volume.
  • I always assumed that a square wave on a prop was just a square wave with some transients on the transitions. I set a pin to toggle and looked at it with with FFT.
  • T Chap wrote: »
    In electronics, if you generate a square wave it is not clear why there are harmonics added out of nowhere.

    Where I think you are misunderstanding this is that harmonics aren't "added" except in very theoretical situations; the waveform is created by some process like toggling a switch or overdriving the vacuum tube, which causes the voltage to change, and harmonics are just there. Fourier's theorem doesn't say you must add sine waves to create a signal, although it says you can do that; the true significance is that any signal can be described as a sum of sine waves, and Fourier analysis just reveals which sine waves you would need to add together if you wanted to replicate the signal that way (which is, incidentally, exactly how mp3 music compression works). All this can be used to design filters and other circuits that affect a signal by having the same effect as enhancing or removing ranges of those sine waves. It doesn't mean that at any point all those component sine waves are actually broken out as individual signals that can be inspected separately.
  • Thanks for the info. Here is a video using 100hz tone and series of pitch shifters to achieve separate control of each harmonic. There is a second video that compares the pitch shifted separate "harmonics" to a saturation plugin.




Sign In or Register to comment.