1

I'm working on a digital audio synthesiser and I'm facing out an issue about the amplitude level.

I'have a sinusoid signal which have a max amplitude of $-1 / +1$ and a square signal which have a max amplitude of $-1 / +1$ too.

My problem is about the output level. With the same settings on my audio device, the square signal is about $3$ times higher (in the speakers) than the sinusoid or the triangle signal.

Did this phenomenon cames from the fact than the square doesn't smoothly switch from $-1$ to $1$ ?

[EDIT] Here is how I measured my outputs (don't pay attention to the LFO on amplitude):

The blue signal is the sinusoid one. The green signal is the triangle one. The pink signal is the square one.

As we can see, the two first signal max is around $-0.1 / +0.1$. For the square signal the max is around $-0.3 / +0.3$.

In decibel, it means the $2$ first signals are at $-10$dB and the square one is at $-5$dB.

These measures came from a built-in mic.

enter image description here

seVenVo1d
  • 3,112
  • 14
  • 32
  • 1
    How can the square wave have a maximum amplitude of $\pm 1$, but also be 3 times higher than the sinusoidal one? Is there a "spike" at the moment when the wave shifts from "low" to "high"? – Philip Dec 03 '20 at 13:43
  • 1
    How are you quantifying "about 3 times higher"? Just by ear? – J. Murray Dec 03 '20 at 13:45
  • Also, related to J. Murray's comment, how are you measuring this? Would you happen to have a waveform that you could post here? – Philip Dec 03 '20 at 14:43
  • @Philip and J. Murray, I just edited the question. – François Legrand Dec 03 '20 at 15:19
  • Hm, that looks like a pretty ugly square wave... Could you also indicate how it was created? My phone, for example, can't seem to create a square wave more than 20kHz, but that might just be the app. Have you tried this at lower frequencies? It looks to me, though I'm no expert, that the spike is some edge effect, I remember seeing something similar in a lab when we differentiated a sawtooth to get a square wave, the derivative at the point where it changes sign is badly defined... – Philip Dec 03 '20 at 16:12
  • The square is simply generated with the f(x) = sign(sin(2.pi.F.t)) function. Another point, this audio synthesis run on a phone. It might cames from the fact that the level transition is not smooth (not like a triangle or a sin waveform). For now I will just divide the amplitude by 3 for this signal. Thanks anyway! – François Legrand Dec 03 '20 at 16:19

0 Answers0