12

This is what I did

I read somewhere that the soundcard can handle about 3 volts , so I figured 2.5 V wouldn't hurt

I expected a nice square wave on my soundcard oscilloscope software but I'm getting this

enter image description here

What is happening ?

Nick Alexeev
  • 37,739
  • 17
  • 97
  • 230
Vrisk
  • 374
  • 1
  • 3
  • 17

1 Answers1

25

AC Coupling.

Sound cards have a capacitor in series with the input which acts as a high pass filter, removing frequencies lower than around 20Hz.

You appear to be feeding in a signal of only 2Hz which is basically going to get filtered into nothing more than an impulse response at each transition as you are seeing. The reason you see the impulse is that a step change in the signal voltage has a large bandwidth requirement - having many higher order harmonics which will not be filtered out.

Tom Carpenter
  • 63,168
  • 3
  • 139
  • 196
  • 3
    Ah ! I see , Thanks , it works perfectly now that I have increased the frequency . – Vrisk Jun 19 '16 at 18:09
  • Wait , but why is it detecting a negative signal ? – Vrisk Jun 19 '16 at 18:12
  • 5
    @AnirudhGanesh AC Coupling. You signal that goes from 0-5V is essentially a +/-2.5V signal with a 2.5V DC offset. What frequency is DC? :) – Tom Carpenter Jun 19 '16 at 18:13
  • 1
    .... 0 ? wouldn't that mean the DC part will be filtered out completely and nothing else would happen ?? – Vrisk Jun 19 '16 at 18:24
  • 4
    @AnirudhGanesh correct, the DC part goes away. So you are left with just the +/-2.5V square wave, hence you see negative. – Tom Carpenter Jun 19 '16 at 18:25
  • So , the +2.5 goes away and when it's flat , only the -2.5 is left and then the -2.5 gets filtered away ? something like that ? – Vrisk Jun 19 '16 at 18:29
  • 2
    Not quite - the capacitor-resistor combo means that *changes* that are fast enough get passed through, but levels decay rapidly to 0V *on the soundcard side of the capacitor*. So the rising edge of the square wave turns into an upward spike. Then it decays. Then the falling edge turns into a downward spike. – pjc50 Jun 19 '16 at 19:09
  • @TomCarpenter You forget the voltage divider. He's only getting a +/- 1.25 volt signal to the sound card. That's probably why he thinks that 2.5 volts is "cut off" or something. – pipe Jun 19 '16 at 22:09
  • Ignore the DC, what's left of his square wave? There's a quick "pop" positive, then nothing for awhile, then a quick "pop" negative, then nothing for awhile, and then it repeats. So that's what you see. – David Schwartz Jun 20 '16 at 09:46
  • And *this* is why using a sound card as an oscilloscope is crazy. Seriously -- you can buy a USB scope on ebay for < $30 these days, and they can handle both DC and substantially higher frequencies than a sound card can. – Jules Jun 20 '16 at 15:34