oscilloscopes and signal generators are
handy tools in our labs
unfortunately they are not cheap what if
you had such devices already and did not
know
stay tuned and i will tell you about it
gritsy youtubers here is the guy with
the swiss accent with a new episode and
fresh ideas around sensors and
microcontrollers
remember if you subscribe you will
always sit in the first row
all newer pcs have loudspeakers and a
microphone
so they can create sound as well as
record it
and usually indecent quality
like oscilloscopes and signal generators
we only need a connection and software
to create the desired waveforms and
visualize the measured voltages
fortunately such software is available
and the best
we can use it free of charge
so our setup looks like that we have a
pc with a sound card
sound cards consist of digital to analog
converters to create analog signals from
a digital source
as well as analog to digital converters
to create digital signals from analog
voltages
and because we want to have at least
stereo signals
they usually have two of them
so
what can we do with this setup
what are its limitations
what are the advantages
and how can we extend it to remove some
of the limitations
let's start with typical scenarios
we want to know how good a filter or an
amplifier works and measure the
frequency response
or we need a sine wave to test a device
on our bench
or a square wave or white noise
or we have a signal and want to know its
waveform and its frequency
or we have a loudspeaker and want to
know its quality and check its frequency
response
for all these applications we have to
connect the in and outputs of the sound
card to our devices on the bench
i created these two cables with jacks on
one side and screwed terminals on the
other i used 6.3 millimeter jacks
because my external sound card uses this
standard
but you might use the typical 3.5
millimeter chucks
the cables have to have at least two
wires plus a shield
connect both wires if you want to use
both channels
but before we start i want to tell you
about some limitations
because sound cards are made for low
power applications they only produce
small voltages and measure small
voltages
this is why i inserted this 20k
potentiometer as a voltage divider
like that i can measure higher voltages
without destroying the input
keep in mind that we misuse our sound
cards so we have to assume that they are
not well protected against over voltage
make sure you stay below 1 volt or so
if you do not want to risk your pc's
sound card it's probably a good idea to
purchase an external one
simple sound cards are not very
expensive
and now we come to the software i found
two different packages arta and rew or
room eq wizard
both are made for acoustic measurements
and both are very powerful in this
matter however because i am a complete
noob in the acoustic domain they have
way more possibilities than i can use
so it's up to you to experiment if you
want to get good at that topic
both have commonalities they have a
generator and a recorder
most measurements in the acoustic
domains are made using both
the generator creates a signal which is
injected into the device under test or
dut at the output of the dut the
recorder visualizes the signal
a typical test is the sweep test where
the signal frequency is changed from a
low to a high frequency
and the recorder shows the amplitude of
the signal
we know this from our antenna and our f
filter measurements
and this is what i will do now
we create a simple low pass filter for 1
kilohertz and included between the
signal generator and the recorder
but wait we forgot something
we need a base to compare as with our
vnas in video number 359 we first have
to calibrate our setup
using rew this is quickly done we
connect the output directly to the input
and go to preferences and sound card
here we can choose our sound card
choose the java driver or if your sound
card supports asio drivers you can try
those we only use one channel for the
calibration which we have to select as
output and input
next we must check the levels and adjust
the input and output levels
please always read the instructions in
the help section they are excellent
the levels can be adjusted with the
sound settings in windows
in windows 10 you find them in sound
settings
because i use this external sound card i
have to adjust them using the dials on
my focusrite
now we can start calibration
just hit next a few times and you will
get such a curve
the x-axis is the frequency from 2 to
the maximum frequency in a logarithmic
form
this means that the distance between 10
and 100 hertz is the same as between 1
kilohertz and 10 kilohertz
and for the y-axis i choose db volts
because our ears somehow follow the
decibel scale
from 20 to 10 kilohertz the measurement
is relatively flat and a little lower
towards the ends
we see that the curve only goes to 24
kilohertz with a sample rate of 48
kilohertz
and we see another difference this curve
is with the java driver and this is with
the asio driver
it seems that the java driver has its
problems with higher frequencies
at a sampling rate of 190 kilohertz the
curve with the java driver stops at a
little above 22 kilohertz the asio
driver seems to support up to 96
kilohertz
and my sound card also seems to support
such high frequencies
anyway the calibration file now can be
stored
create such a file for every sample rate
you want to use later
now we can create our first measurement
stick with the level you choose before
and do an spl measurement
skip this pop-up if it appears
we can recheck levels to be sure and
then hit start the same procedure as
during calibration happens but the
resulting curve is very different
now it is flat because rew compensated
the curve we measured before
now we are ready and can insert a duty
to see its effect
for our test i will use a low-pass
filter for a cut-off frequency of 1
kilohertz consisting of an r and a c
our online calculator shows that a 10
kilo ohm 16 nano farad combination
should do the trick
we insert this combo between the out and
the input select the measuring range and
hit start
after selecting db volt again we see
that the curve is very different by the
way we can change the scale with a plus
and minus sign and adjust its level with
a rider
an rc low pass filter has a loss
calibrated we had a level of roughly
minus 10 db and now we start at minus 13
db
and as expected or hoped we see a drop
around one kilohertz
cool
and we see that it continues with the
expected minus 20 db per decade
so the higher the frequency the more the
filter blocks it with a simple exchange
of the r and the c we create a high pass
filter that blocks the low frequencies
and let the higher frequencies pass
the cutoff frequency stays the same but
it has less loss
let's compensate for the loss of the low
pass and create an active filter this
can be done using an op amp
the most basic one should do it the
lm741 but because we work with bipolar
signals we have to feed it with plus
minus volts
fortunately i got this mini power
station which creates not only 3.3 and 5
volts but also plus minus 12 volt a
perfect solution
by the way if you are interested in this
device you can check valids kickstarter
this amplifier compensates for the loss
of the rc filter but we also see that
the curve does not look nice after about
100 hertz
good to know without our sound card
instrument i probably would not have
detected this flaw
so what to do in this situation
as always we try capacitors on the power
rails and really after adding these two
capacitors we get the correct curve
so our first measurements were a success
we can do more of course for example we
can open a generator window and generate
a 100hz tone and we can open an
oscilloscope window that shows the
output of the amplifier
if we change the frequency to one
kilohertz the output is already smaller
at five kilohertz it is very small as
expected
now we have an independent signal
generator and an oscilloscope
by the way do not forget to hit the
record button otherwise you scratch your
head while there is no signal
we can also generate a 100 hertz square
wave signal and get a decent square wave
at the output of the active filter if i
change to one kilohertz the signal looks
more than a sawtooth curve do you know
why
let's use another tool the spectrum
analyzer it analyzes all frequencies of
a particular signal
here is what we see with the one
kilohertz square wave at the input it
contains lots of harmonics spaced by one
kilohertz
every second harmonic has a much lower
value
the harmonic at 20k is 25 db lower than
the 1 kilohertz harmonic after the
filter as expected the one kilohertz
component is a little lower but the
harmonic at 20 kilohertz is now 50 db
lower
so we can see how we can create a sine
from a square wave
just create a filter for the harmonics
of course we would need a better filter
as just a simple rc combination to
remove all harmonics
and we saw an advantage of a sound card
compared with an oscilloscope its
dynamic range is much bigger because it
uses 18 to 20 bit adcs
most oscilloscopes only use 8 to 10 bits
therefore we can measure much smaller
values without changing the range
this was just an introduction to show
you the possibilities of your ordinary
pc sound card
there are much more possibilities for
example you can attach a microphone
instead of your probe to catch signals
now you can use a loudspeaker as a dut
and measure its frequency response
or you can build such an arter box to
characterize your loudspeakers and
optimize them
a lot of cool stuff for guys who want to
experiment with audio
and if you replace the lm741 op-amp with
such a power op-amp you can create
powerful signals to drive your
loudspeaker or even a motor
can this setup replace an oscilloscope
and the signal generator
no for sure not because it has some
disadvantages
the first flaw is that you have to pay
attention to voltages because sound
cards are made for small voltages
i used a voltage divider to protect the
input
the second flaw is that you need an
amplifier if you need bigger signals
the third flaw is that the measurements
are not absolute you can try to
calibrate the output signal using a true
rms multimeter but i would not trust
that the pc and sound card do not insert
some errors the fourth flaw is that it
only works with ac
it does not show dc components in your
signals so it cannot easily be used to
drive or measure digital devices and the
fifth flaw is that its frequency range
is limited
you for sure get up to around 20
kilohertz and if you are lucky 296
kilohertz higher frequencies are not
possible is this important
yes because as we saw square waves for
example contain a lot of harmonics if
you try to create and measure a 20
kilohertz square wave you get a perfect
sign because the generated signal does
not contain harmonics and the scope
cannot measure them this is why your 100
megahertz oscilloscope in reality only
can be used up to about 30 megahertz
because you at least want to catch three
harmonics
still it is fun to play with audio
signals free of charge
and if you are seriously into audio
these programs are better than using a
signal generator and an oscilloscope
because they already contain a lot of
pre-made signals and calculations
much easier than doing all the hard
stuff manually
summarized we found an easy way to use a
general purpose pc with its sound card
to create a versatile signal generator
an oscilloscope and a spectrum analyzer
for audio signals
the only things we need are two cables
and software
we found two free of charge software
packages and used rew for our tests
we also saw that our setup has many
limitations the most important are its
limited voltage and frequency range
for pure audio applications this setup
is probably better than using a signal
generator and an oscilloscope because it
has a lot of built-in audio knowledge
it can be extended by adding a
microphone an amplifier and an artabox
with those extensions you get an
excellent tool to make loudspeakers or
check your setup
or you have a loudspeaker and find out
its frequency response we played with a
simple rc filter and discovered how easy
it is to remove unwanted frequencies
and we used an op-amp to create an
active filter
this was all for today as always you
find all the relevant links in the
description
i hope this video was useful or at least
interesting for you if true please
consider supporting the channel to
secure its future existence thank you
bye