-1
\$\begingroup\$

In a fun experiment I used an Applicos ATX7006A 18 bit AWG to generate a 1 kHz sine wave and used an Analog Devices AD7671 16 bit ADC to digitize the waveform, then coherently captured the digital data and got a nice sine wave out of it. Then I used the Applicos to offset the sine wave by -1 volt forcing it to clip on the lower peak and got this wave and this spectrum.

Clipped sine wave

Spectrum of clipped sine wave

So why did I get these humps? It's coherently sampled, so it can't be from windowing. Any ideas?

\$\endgroup\$
4
  • \$\begingroup\$ Can you post an imageof the spectrum for the reconstructed sine wave with out the clipping? \$\endgroup\$
    – user319836
    Commented Jun 14, 2023 at 19:02
  • \$\begingroup\$ You should see these peaks (at a lower magnitude) also without clipping the wave due to the nonlinearities of DAC and ADC. \$\endgroup\$
    – tobalt
    Commented Jun 14, 2023 at 19:14
  • \$\begingroup\$ I didn't ask about WHY there are harmonics, I asked WHY the HARMONIC SIGNATURE looks that specific way. I clipped the sine wave at 243.8473539°. How do I know that to 10 digits? It's all explained here: youtu.be/0sR-35blTGQ \$\endgroup\$ Commented Jun 15, 2023 at 23:33
  • \$\begingroup\$ – RussellH - Here is the link to the video that shows what you are looking for, no distortion, it's covered at 2:10. youtu.be/CHfeMGQC6WI \$\endgroup\$ Commented Jun 16, 2023 at 18:44

3 Answers 3

9
\$\begingroup\$

You added offset, signal clipped and now the clipped signal has these harmonics.

To put it in another way, since it's not a sine wave any more, as it has flat portions at the bottom, it can't be represented with a single spectral peak, like the original sine wave.

\$\endgroup\$
0
3
\$\begingroup\$

A clipped sine is a sine that has been multiplied with a rectangle wave, with some constants added:

clip = 0.8
sine = np.sin(wt)
rectangle = sine < clip
clipped = (sine-clip)*rectangle + clip

Visualization:

enter image description here

Multiplication in the time domain corresponds to correlation in the frequency domain. So to get the clipped spectrum we take the correlation of :

  • the rectangle wave spectrum
  • and the spectrum of the sine + DC offset which contains only two peaks.

This means the final spectrum is the weighted sum of two instances of the spectrum of the rectangle wave, with one shifted in frequency.

If the rectangular wave is actually square, with a duty cycle of 50%, it will have smooth harmonic decay without humps. This is the case where the sine is clipped precisely in the center.

But if the rectangular wave is not square, its duty cycle is not 50% because the sine is clipped somewhere else, then its spectrum will have a series of humps, so the result has humps.

Now why does the spectrum of a rectangle wave have humps?

I'll spare the math, but basically a rectangle wave is the product of two square waves having signal values {0,1} with some phase shift applied on each:

enter image description here

If you multiply the top and middle squares you get the rectangle wave on the bottom... So in the spectrum domain it's the correlation of the spectra of these two square waves, which are identical except for phase shift. The phase shift means harmonics add constructively or destructively depending on the harmonic number, so you get a spectrum with humps that looks like an interference pattern.

\$\endgroup\$
0
2
\$\begingroup\$

Distortion (clipping) produces harmonics but, let's get things into context here; the lowest frequency harmonic is about 35 dB lower than the fundamental and that's about 2% in real numbers magnitude. Anything 60 dB lower is at the 0.1% level or less. Anything 40 dB or lower is no more than the 1% level.

\$\endgroup\$
5
  • 1
    \$\begingroup\$ @Frog a ratio "X" of voltage produces a certain value of dB and, the equivalent power ratio has the same dB value so, what are you talking about please? As far as I can tell what you say is gobbledy gook but, I might be missing the point. Additionally the screen shots represent voltages so, what's the power rant about? \$\endgroup\$
    – Andy aka
    Commented Jun 14, 2023 at 20:23
  • \$\begingroup\$ In other words, a 6 dB reduction in voltage produces a 6 dB reduction in power hence it doesn't matter whether the dB value represents power or voltage because, it means the same to both. Of course, a 6 dB reduction in voltage halves the real quantity of voltage and quarters the real quantity of power but we're talking dB here and the screen isn't showing power but a signal which, we can presume not to be power. \$\endgroup\$
    – Andy aka
    Commented Jun 14, 2023 at 20:48
  • \$\begingroup\$ I refer to "Anything 40 dB or lower is no more than the 1% level" where in ratiometric terms -20dB is a factor of 0.01 or 1%. However, 1% of voltage equates to 10^-4 in terms of power, which is -40dB. So I disagree with your second comment; a ratio n in voltage results in a ratio n^2 in power. \$\endgroup\$
    – Frog
    Commented Jun 16, 2023 at 1:09
  • \$\begingroup\$ @Frog I'm unsure what it is that I said that you disagree with. You say my 2nd comment but, can you be specific please? \$\endgroup\$
    – Andy aka
    Commented Jun 23, 2023 at 15:40
  • \$\begingroup\$ it is rather starting to look as though I have been under a misapprehension all these years, understanding that dB can be a ratio of anything rather than specifically power, and so for example I might say that my greenhouse is operating at +10dB because I'm harvesting 10 times the baseline weight of tomatoes per day. This seems not to be widely supported though, and since terminology means what we agree it to mean, if I find myself in a minority of one then I'm wrong. I was trying to track down where I had got this idea from but without luck so far. I smell humble pie. \$\endgroup\$
    – Frog
    Commented Jun 24, 2023 at 6:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.