This is only a preview of the October 2025 issue of Practical Electronics. You can view 0 of the 80 pages in the full issue. Articles in this series:
Articles in this series:
Articles in this series:
Articles in this series:
Items relevant to "Compact HiFi headphone Amplifier Part 2":
Articles in this series:
Articles in this series:
Articles in this series:
Items relevant to "3D Printer Filament Drying Chamber, Part 1":
Articles in this series:
|
Circuit Surgery
Regular clinic by Ian Bell
Measuring the frequency response of a circuit
or device using with a PC sound card, part 1
52
Frequency response concepts
This expression, Y(f) = H(f)X(f), implies
Input
amplitude
linearity. That is, at a given frequency,
the value of H is fixed – it varies with f,
but not with other things such as time
or any other characteristic of the input
signal, such as its amplitude.
H not changing with X (ie, only with
f) means that for a particular frequency
(f1, say) we could write X=Hf1Y and a
graph of X (input) against Y (output) at
that frequency would be a straight line
(hence ‘linear’).
Linearity in combination with H not
varying with time means we have what
is called a linear time-invariant (LTI)
system. A lot of theory behind electronics design is based on the assumption
that circuits like amplifiers and filters
are LTI systems.
Given that we are interested in characterising a circuit’s behaviour with
frequency, it makes sense to analyse or
measure circuits by applying signals
containing a single frequency. We can
repeat this for as many frequencies as we
need to build a picture of the frequency
response. This is not the only way to
obtain a frequency response, but it is the
most straightforward to think about it.
Sinusoidal waveforms are the only
waveforms that contain just a single frequency – other wave shapes have content
at multiple frequencies. This is the basis
of Fourier theory, which states that any
waveform can be decomposed into purely
sinusoidal components.
So, we can obtain a frequency response
(in theory, simulation and practical
Negative output phase
shift (lagging)
Positive output phase
shift (leading)
Output
amplitude
Amplitude
processing (DSP), which has covered the various parts of a generic DSP
system and the basics of their theory
of operation. In the most recent few
articles, we described the implementation of a basic digital filter using a
microcontroller.
In the last issue, we showed oscilloscope traces for a couple of input and
output signals to confirm a low-pass filter
example did attenuate higher frequencies. However, what we really want to
do to evaluate a filter is to plot its measured frequency response.
This month, we will start to look at
frequency response measurement in general, not just for the DSP example. The
frequency response of a circuit is the
variation of its behaviour with frequency.
If the input is X and the output is Y, we
could write Y(f) = H(f)X(f), where H is
the transfer function – the relationship
between the input and output signals.
We write Y(f), H(f) and X(f) to show
that the signals (which could be voltage
or current) and the transfer function vary
with frequency (f). The term “frequency
response” often refers to graphs showing how the transfer function H(f) varies
with frequency.
Frequency response graphs often require a lot of data points, so it can be
time-consuming and tedious to measure and calculate each point manually.
Professional labs use test gear that can
automate the measurement; many midto-high-end oscilloscopes now have this
capability, but it is less common in older
and lower-cost models.
Alternatively, a separate signal generator and oscilloscope can be coordinated
by software to automate measurements
(eg, using the SCPI protocol).
Not all readers will have even a basic
oscilloscope, which could be used for
manual measurements. It is possible to
use a digital multimeter (DMM) to measure the gain response, but only if the
meter can measure AC voltage over the
required frequency range; basic models
typically have limited capabilities in
this respect. An audio millivoltmeter is a
more appropriate instrument for this task.
You would also need a signal generator
to create the sinewave input. Many digital oscilloscopes these days come with
built-in arbitrary waveform generators.
If you do not have suitable test gear,
there is a good alternative – use the
“sound card” of a PC or laptop to generate the input signal and analyse the
response. Fortunately, free software is
available that provides this facility.
These programs are mainly aimed at
acoustic measurements (room acoustics,
loudspeakers etc), not directly testing
electronic circuits, but they can be used
for this purpose. We will look at how
to do this.
By the way, we refer to the audio input/
output circuitry as a “sound card” because
it used to be the case that computers
had no such circuitry, so you needed
an add-on card (circuit board) to provide these functions. These days, almost
all computers have analog audio input/
output circuitry integrated onto their
main boards, but the name has stuck.
Before getting into the specifics of this
process, we shall look at the basics of
frequency response measurement, both
the theory and some general practical
considerations.
Amplitude
L
ast month, we reached the
end of our series on digital signal
Time
Time
Fig.1: possible amplitude and phase shifts of some sample sinewaves.
Practical Electronics | October | 2025
Fig.3: the LTspice circuit used to obtain
the Bode plot in Fig.2.
Fig.2: an example Bode plot produced by LTspice for the Fig.3 circuit. The upper plot is
gain magnitude (frequency response), with the corresponding phase shift below in red.
measurements) by applying a range of
sinusoidal signals at the input and observing the output.
If we feed a sinusoidal signal to a
linear circuit, the output will also be a
sinusoid at the same frequency – this
must be so because a linear input-output relationship will not change the
shape of the waveform. For something
other than a sinewave, a different linear
input-output relationship may apply at
different frequencies.
This means that the component sine
waves that build the waveform may not
have the same amplitude or phase relationships relative to one another at the
output. The waveshape will change if
this happens, but the frequencies present will still be the same as in the input.
This does not mean that it is impossible to measure frequency responses
with inputs other than sinusoidal signals, but it makes things more complex,
as we have to find the responses at individual frequencies from the combined
response. This can be done using analysis based on the fast Fourier transform
(FFT), which takes a waveform in time
and finds its frequency content (or another type of Fourier transform).
For a linear circuit with a sinusoidal input, the output waveform may be
shifted in time, and may have a different
amplitude (see Fig.1). When considering
frequency responses, we usually represent the time shift as a phase shift, ie,
the shift as a proportion of the cycle time
(1/f) of the waveform at the frequency of
interest (f) expressed in degrees (the full
cycle time is 360°).
For example, at 1kHz, a shift of 0.25ms
relative to the input is a quarter of the
cycle time of 1ms, so it’s a phase shift
of 90° (360° ÷ 4).
The basic manual approach to measuring a frequency response is to display
the input and output waveforms on a
dual-channel oscilloscope, and measure the amplitudes and phase shift, as
shown in Fig.1.
The gain of the circuit is calculated
by dividing the output amplitude by the
input amplitude. The phase shift is obtained by measuring the time difference
Fig.4: the response of an RC circuit when a sinusoidal input signal switches on abruptly.
Practical Electronics | October | 2025
between equivalent points on the two
waveforms and converting this to the phase
value.
Whatever method is used to produce the
data, the most common way of presenting frequency response data (simulated
or measured) for electronic circuits is the
Bode plot: graphs of gain in decibels and
phase shift in degrees against a common
logarithmic frequency axis (see Fig.2).
The gain in decibels is 20log10(Vout ÷ Vin)
for voltage signals.
For completeness, the Bode plot in
Fig.2 is for the RLC circuit in Fig.3, but
the point of Fig.2 is to show the typical
presentation of a Bode plot, not to discuss details of the circuit.
The Bode plot is named after Hendrik
Wade Bode (1905-1982). His work on this,
dating to the 1930s, related to obtaining
straight-line asymptotic approximations of the gain and phase responses
of systems to assist in calculating their
stability. Today, the term is widely used
to apply to fully detailed frequency response curves, not just the straight-line
approximations.
Phase and steady state
A phase shift may be positive or negative,
with a negative phase shift implying the
output waveform changes after the input
(sometimes called phase lag). A positive
shift is the opposite – the output changes
occur before the input (phase lead).
A positive phase shift may seem impossible – it appears to indicate the circuit
is predicting the future input to produce
the output. If this actually happened, we
would have a non-causal circuit, which
cannot be physically implemented for
real-time operation. However, a simple
high-pass filter using a single capacitor
and resistor has a positive phase shift.
The solution to this potential dilemma
is that frequency response is defined for
a steady state, that is, under conditions
where the input has been applied for a
long time (ideally for all time) and the
circuit has settled into a stable input and
output waveform. Under these conditions,
the output can have any positive offset
in phase without the system needing to
be clairvoyant.
If we apply a sudden input change (a
step, or just switching on a sinusoid),
the system will not be in a steady state
53
directly after the change. For example,
Fig.4 shows a sinusoid applied to an
RC high-pass filter just after switch-on.
During the first half-cycle, the output
(red trace) does not lead the input, but
the circuit settles to a state where the
output has a positive phase shift, similar
to the plot on the right of Fig.1.
A steady-state sinusoid is a requirement for there to be a single frequency
at the input. In theory, steady state requires infinite time to achieve, but in
practice, most circuits will reach a point
that is close enough in a relatively short
time. However, the time required for it to
stabilise may still need to be taken into
account when making measurements.
The theoretical need for a steady state
for a perfect sinusoidal input and output
does not mean that we have to try to
achieve this to make a frequency response measurement. It only applies to
the case where we directly measure the
amplitudes and phase shifts at individual frequencies (as in Fig.1).
As indicated above, with appropriate
mathematical processing of the signals,
other input waveforms can be used. We
will discuss this in more detail later.
Complex numbers
A key thing that Fig.1 shows is that
there are two changes occurring from
input to output – the phase shift and
the amplitude change. If we write
Vout = GVin for an amplifier at the frequency of interest, we can say that if G = 10
and the input is 1V, the output will be
10V. However, this does not tell us anything about the phase shift that is also
part of the transfer function.
This means that in Y(f) = H(f)X(f), we
cannot simply say H(f) = G. The terms in
Y(f) = H(f)X(f) have to encompass both
the amplitude and the phase. Ordinary
numbers have only one value, so we need
something more.
We can represent the phase and amplitude of a sinusoidal signal with amplitude
A and phase Ф directly by writing it as
A∠Ф, which is called the polar form. This
is depicted in Fig.5 as a line of length A
at an angle of Ф to the axis.
The signal’s value is represented by
the point at the tip of the arrow, which
can also be expressed in terms of its Cartesian coordinates (x and y on a graph),
also as shown in Fig.5. From basic trigonometry, x = Acos(Ф) and y = Asin(Ф).
We could just use x and y as two ordinary numbers, but that is not an effective
approach for mathematical manipulation.
The way forward is to use complex numbers, such that the value of the signal in
Fig.5 is x + jy, where j is √-1 (for some
reason, mathematicians like to use i for
this but engineers use j because they
use the variable i to represent current).
54
Imaginary
y
jy
Non-linear function
y = f(x)
j = √(–1)
A
Linear
approximation
Operating
point
Φ
x
x
Real
Fig.5: the relationship between phasors
and complex numbers.
Fig.6: the linearisation of a transfer
function at an operating point.
Ch1
Out
Signal
generator
In
Device
under test Out
Oscilloscope
(or DMM)
Ch2
Fig.7: typical lab test equipment for
measuring frequency responses.
This is called the rectangular form of
the number. In x + jy, the x is referred
to as the real part and jy as the imaginary part (the square root of minus one
does not exist as an ordinary number).
Complex number representations of
sinusoidal signals are referred to as
phasors.
Using complex numbers, two values can
be manipulated together in calculations
and algebraic manipulations without
them interfering with each other (mathematicians call this orthogonality). The
use of complex numbers is fundamental to the theory of frequency-dependent
impedance and the transfer functions of
components and circuits.
You often see transfer functions denoted as H(jω) and H(s), where ω is the
angular frequency in radians (ω = 2πf ),
and s is the complex frequency variable
used in Laplace-transform-based circuit
analysis.
The fact that the transfer function is
based on complex numbers means that
when we refer to just the amplitude
part of the gain, we should call it “gain
magnitude” or just “magnitude”. Bode
plots are often labelled this way, but not
always. Using the Pythagorean theorem,
the magnitude of the signal in Fig.5 is A
= √x2 + y2. Also, Ф = tan-1(y ÷ x).
Circuit analysis based on complex
numbers uses advanced mathematics
that not everyone will want to study.
However, even if it is not for you, it is
worth being aware of the basic ideas and
notation as you will come across it in IC
datasheets, other technical documents,
software menus or help documentation.
For example, LTspice can display AC
analysis results in terms of real and
imaginary parts.
Fortunately, you do not need a deep
knowledge of advanced mathematics to
measure or simulate frequency responses and interpret the results presented as
Bode plots. Often, the gain plot will be
the main interest – for example, to decide
if the gain of an amplifier is flat enough
over the frequency range of interest, or
if the cut-off performance of a filter is
good enough for the application.
However, phase is important too, as
it influences signal integrity, distortion
and system stability.
An aside on LTspice
An aside for those interested in the
finer details of LTspice: you may have
noticed the fact that the gain magnitude
and phase plots in Fig.2 are in separate
plot planes. The default for an AC analysis is to plot both on the same plane,
with the phase axis on the right and the
phase graph having a dotted line in the
same colour as the gain.
When you add the data points, as in
Fig.2, the phase line can look quite messy.
I do not know of a way of changing the
default phase plot to use a solid line, a
different colour, or the left-side axis. The
traditional form of the Bode plot is to
use separate graphs for gain magnitude
and phase, but for software tools such
as LTspice, it makes better use of screen
space to display both together.
Plotting the gain in separate panes
in LTspice is simple if you just plot
the output twice and switch off one
Practical Electronics | October | 2025
Using a suitable DMM or audio millivoltmeter will require you to switch the
connection between input and output
(unless you have two), and will only give
you gain magnitude values.
For automated measurements, the
signal generator may be built into the oscilloscope, or separate instruments could
be controlled by a PC or linked by some
proprietary system. For radio-frequency
work, a vector network analyser (VNA)
may be used rather than an oscilloscope,
and may also measure other parameters,
such as input impedance and reflection
coefficient.
In this article, we are focusing on lower
(primarily audio) frequencies.
Signals for measurement
Fig.8: examples of sinusoidal signal distortion. The axis units are arbitrary.
of the plots in each plane off, by right-
clicking on the relevant axis. However,
the phase still has a dotted line, and the
axis on the right. The solution is to plot
ph(V(out))*1° instead (assuming the
output signal is named out).
This uses LTspice’s “waveform arithmetic”. To do this, you need to click in
the pane and “Add Traces”, then type in
the expression.
Just plotting ph(V(out)) will not
show negative phase values correctly,
because the trace plotter is interpreting
the data as a magnitude, which is what
would usually be done for gain in a Bode
plot as the default for an AC analysis.
This can be fixed by right-clicking the
axis and selecting Cartesian rather than
the default Bode representation (polar
form). This plots the real and imaginary
parts of the data (rectangular form).
The LTspice help on waveform arithmetic tells us that the ph(x) function
will “return a complex number with the
real part equal to the phase angle of the
argument and the imaginary part equal
to zero”. We can right-click and switch
off the imaginary axis (on the right) – as
just stated, all the data points are zero.
The numbers on the left axis are written with “r” (for real number), which is
not ideal. Including *1° in the waveform
expression fixes this.
Simulation and measurement
The theory of circuit frequency response is based on an assumption of
linearity, but real circuits are not perfectly linear, so we need to consider the
implications of this.
When mathematically analysing circuits such as transistor amplifiers, it is
common to use what are called smallsignal models to approximate non-linear
Practical Electronics | October | 2025
relationships (eg, y = f(x) in Fig.6) to
linear ones at an operating point (specific value of x). As long as the value of
x does not deviate much from the operating point (hence, “small” signal) the
linear approximation is good.
LTspice (and other SPICE simulators)
can simulate the frequency response of
circuits using AC analysis (as in Fig.2).
This works by calculating the operating
point and linearising the current-voltage
relationships of nonlinear devices such
as transistors. The linear models allow
very fast calculation of data points on
the frequency response without having
to simulate using input waveforms.
AC analysis in SPICE does not work
in all situations, such as sampling and
switched circuits. LTspice is also able to
perform a frequency response analysis
(FRA) simulation, which follows a process much closer to what might be used
for practical measurements.
It performs transient simulations with
sinusoidal waveforms over a range of
frequencies and calculates the frequency response from the resulting signals.
This is more complicated to set up than
AC analysis. We used this approach for
a sampling circuit in the DSP series (December 2024) and covered the basics of
LTspice FRA in the March and April
2024 issues.
The basic lab setup for frequency response measurements is shown in Fig.7.
This can be used for manual or automated
measurements. For manual measurements, set the frequency on the signal
generator and measure the signal amplitudes and time difference using the
oscilloscope. Calculate the gain and phase
shift as detailed above with reference
to Fig.1. Move on to the next frequency
and repeat.
Analysis and simulation based on small
signals is very useful, but for measuring
real circuits, we cannot just apply an arbitrarily small signal because we want
the measurement to apply to realistic
usage. Furthermore, if the signal levels
are too low, noise in the circuit and/or
test instruments will reduce the quality
of measurements.
For the circuits we are typically interested in for frequency response
measurement, such as amplifiers and
filters, good circuit design should provide
decent linearity over normal operating
signal levels. Typically, we want to apply
the largest signal that is within the circuit’s safe operating range, but which
avoids any significant distortion of the
output signal.
Common forms of distortion are
clipping, where the maximum signal
amplitude is exceeded, and slew-rate
limiting, where the circuit cannot change
its signal level fast enough to reproduce
the waveform shape correctly. These are
illustrated in Fig.8. Clipping results in
sinewaves with flattened peaks, while
slew rate limiting makes the waveform
more triangular.
Relatively severe cases of distortion
can be spotted on an oscilloscope display, but may not be easy to see at lower
levels. Some measurement systems will
be able to measure distortion directly as
well as plot frequency responses.
Many oscilloscopes can display signal
spectra, which can be used to help detect
distortion. A sinusoidal output should
have one peak at the input signal frequency. Other significant peaks, particularly
at multiples of the input frequency, indicate distortion. As a sinewave is clipped
more and more, it approaches a square
wave, which will have high odd (3f, 5f
etc) distortion products.
The maximum signal level at different frequencies may be different, and
can be determined by different characteristics of the device under test. For
55
manual measurements, we could change
the signal level for each measurement,
but automated measurements may use a
fixed level for all frequencies.
Clipping can occur due to either the
input or output level being too high.
Exceeding the maximum input level is
likely to be the limiting factor where
circuits attenuate the signal (large input
for small output); for example, filters
in the stop-band frequencies. Exceeding the maximum output level is more
likely for circuits that amplify in all or
part of the frequency range (amplifiers,
filters in the passband).
The maximum rate of change of a sinusoidal waveform occurs as it passes
through zero. Increasing either amplitude or frequency increases the
maximum rate of change, so slew-rate
limiting is more likely for relatively
large, high-frequency signals. This could
occur, for example, for amplifiers and
high-pass filters at high frequencies,
or low-pass filters close to or just past
cutoff.
Clipping problems can also occur
in the measurement instrument input,
which will invalidate the measurement. Ideally, you will get a warning
about over-range/overload or clipping
if this occurs.
The above discussion mainly applies
to active circuits (eg, using transistors
and op amps), but you may want to measure the frequency response of passive
circuits (containing a combination of
resistors, capacitors and inductors). In
general, typical test set-ups are unlikely
to exceed component ratings, but check
if this may be a possibility.
Also be aware that resonant passive
circuits (those containing LC-based filters) may produce voltages greater than
the input voltage.
Several types of input signal could be
used for frequency response measurement – examples are shown in Fig.9.
The most straightforward is a stepped
sinewave. As already discussed, this is
what is used for manual measurements,
but of course, it can be automated too.
Higher-resolution measurements (more
frequencies and more accurate response
data) will take longer. Time is required
for the output to stabilise (approximate
steady state) each time the frequency
changes.
Alternatives to stepped sines include
swept sinusoids (also called chirps),
where the frequency varies continuously, or wideband random noise (eg,
white noise). These input waveforms
contain frequency content at all frequencies of interest, so the output frequency
content can be analysed to obtain the
frequency response.
This is done by processing the
56
Fig.9: signals that can be used for measuring a frequency response.
Fig.10: the same frequency response plotted with 10 points per decade (upper) and
500 points per decade (lower).
waveforms for the whole sweep, or an
appropriate duration of noise, using
calculations based on the fast Fourier
transform (FFT). Logarithmically swept
sine measurements tend to be much
faster than stepped sine, but the measurements may be worse, particularly at
higher frequencies due a lower signalto-noise ratio (SNR).
In theory, an impulse can be used as
the input waveform to obtain the frequency response. Again, an FFT is used
to obtain the frequency response. An
ideal (analog) impulse is not feasible,
but a short high-amplitude pulse will
approximate it.
There are practical difficulties – the
pulse has to be very short, and therefore
causes a small output signal, and hence
poor SNR unless it has a very high amplitude, which may not be feasible, or
could cause non-linear behaviour. For
digital filters, impulses may be usable
if a single non-zero input sample can be
reliably created.
We discussed impulses in the DSP
Practical Electronics | October | 2025
Fig.11: a linear plot of the same response shown at the bottom of Fig.10.
Fig.12: LTspice phase plots of the same network. The upper plot wraps the phase at
±180°, while the lower doesn’t.
series, particularly in the August 2024
and April 2025 issues.
Data points and plots
Bode plots usually use a logarithmic
frequency axis. This means that frequencies a decade apart (factor of ten) are
equally spaced on the axis. For example,
there is the same distance from 100Hz to
1kHz on the axis as there is from 1kHz
to 10kHz (as in Fig.2).
The number of data points to use is
often specified in terms of points per
decade, or sometimes points per octave
(an octave is a doubling of frequency).
Fig.2 has 10 points per decade, shown
by the dots on the graph. LTspice’s
plotting software has interpolated
the points between these to draw a
smooth curve.
When making manual measurements,
how do you choose which frequencies to
measure at if you want equally spaced
values on a logarithmic plot? Each measurement frequency (f) is a fixed scaling
factor (s) larger than the previous one,
ie, fn+1= sfn, when n is the measurement
number in order of increasing frequency.
Practical Electronics | October | 2025
For p points per decade, if we multiply
s by itself p times, we get 10; that is,
p
sp= 10, so s = √10.
For example, if we wanted four points
4
per decade, we have s = √10 = 1.7783.
Our frequencies in each decade are the
start frequency multiplied by 1, 1.7783,
1.77832 and 1.77833. For example, starting
at 100Hz, we would have 100Hz, 178Hz,
316Hz and 562Hz. Multiplying the final
value by 1.7783 gives us 1000Hz – the
start of the next decade.
We can calculate all the frequencies to
measure by starting at the lowest frequency we need and multiplying by s until
we get to the maximum frequency to use.
Similarly, for p points per octave, the
p
scaling is s = √2. The number of octaves
per decade (N) is 2N = 10 (N doublings
is equal to ten). So, N = log(10) ÷ log(2)
= 1 ÷ log(2) ≈ 3.322.
Insufficient data points can lead to
misleading plots. Fig.10 shows the gain
response for the circuit in Fig.3 with R1
changed to 0.1Ω. This low resistance results in a very sharp peak, which requires
a lot of data points to plot accurately. The
upper plot uses 10 points per decade,
which is insufficient. The lower plot
uses 500 points per decade.
For manual measurements, it can be
useful to do an initial run with relatively few data points and then only make
closely spaced measurements where the
response changes rapidly. For steppedsine automated measurements, using a
lot of data points may take a long time,
but at least you can do something else
while you wait.
For measurements based on FFTs,
the number of data points will depend
on the number of waveform samples
(in time) and the FFT algorithm. Usually, the number of data points in the
frequency response plot will match
the number of waveform samples, and
will be evenly rather than logarithmically spaced.
Typically, the number of points will
be a power of two and be a large number
(eg, 16384, 32768 or 65536), so likely to
be sufficient for accurate plotting.
Fig.11 shows the same data as the
lower plot in Fig.10 plotted using linear
rather than decibel gain. We are not
really able to see the fact that the circuit is a low-pass filter because the peak
dominates the plot. This is a relatively
extreme case, but illustrates the usefulness of decibel plots or logarithmic axes
in showing details at different scales.
Linear axes are more appropriate for
plotting smaller ranges.
The symmetry of the sinewave means
that just by looking at two waveforms on
an oscilloscope, it is impossible to distinguish between phase shifts of +180°
and -180° (they both invert the waveform). Similarly, shifts above 180° in
one direction look the same as smaller shifts in the opposite direction (eg,
+270° and -90°).
Simulations and more advanced measurements may be able to correctly obtain
phase values beyond ±180°, but it is still
common to plot values in the ±180° range
(called phase wrapping).
Simulation and measurement may give
you the option to plot phase wrapped
to ±180° or unwrapped to the full value;
for example, see the LTspice plots in
Fig.12, which is for an RLC circuit formed
from two copies of the filter in Fig.3. Circuits with relatively large delays may
have very large phase shifts at high frequencies, and wrapped plots can show
a large number of jumps between ±180°.
Sound card based measurements
There are many PC programs, including some free ones, designed for audio
applications such as room acoustics measurement, characterising loudspeakers
and other audio devices/systems. These
use the PC’s sound inputs and outputs
to make measurements.
57
One of their main capabilities is to
make measurements to help optimise
the acoustics of a room or studio and
find the best locations for speakers and
listening. This requires a calibrated microphone or sound pressure level (SPL)
meter, which may be analog or USBconnected in a setup like in Fig.13.
These programs may provide standalone signal generator and oscilloscope
tools, and of course, they can measure
and plot frequency responses, as this is
a key task in room audio characterisation. They may also be able to measure
other parameters, such as signal distortion and component impedance.
Fig.14 shows a simple setup that
could be used to test an electronic circuit. This is similar to the arrangement
in Fig.7, where the sound card’s right
(stereo) channel is used as the signal
generator output, and the two input
channels are used to measure the input
and output signals.
Other arrangements may be used; for
example, the left I/O channels may be
connected together (loopback, as in
Fig.13) to facilitate timing measurements. Direct measurement of the input
signal may not be needed if the sound
card is calibrated first using a direct
connection (R out to R in) without the
device under test (DUT) present.
Compared with using lab test gear,
sound-card-based measurements have
limitations. The input and output voltage ranges are limited and may vary
significantly, depending on the sound
card, particularly between built-in
standard sound cards and the external
‘professional audio’ USB devices often
used by musicians.
The frequency range is limited to the
audio spectrum (20Hz to 20kHz), although some sound cards with higher
(“HD” or “studio”) sampling rates (eg,
192kHz) may facilitate higher frequency
measurements. Sound cards are designed for audio signals only, and are
usually AC coupled, so DC measurements are not usually possible.
Sound cards are not designed as
measurement instruments, so are
not calibrated. The software usually
provides calibration procedures to overcome this. One potential advantage is
that they may have greater signal level
resolution (eg, 16 or 24 bits) than is
typical in oscilloscopes (8 to 12 bits).
The much lower sampling frequencies used by sound cards, compared
with what is expected of an oscilloscope, makes this possible.
Measurements may require two inputs
(using stereo, as shown in Figs.13 & 14),
which should not be a problem on many
PCs, but laptops commonly only have
a single channel microphone input,
58
Audio system
PC
Sound
card
out
Main
R
speaker
output L
R Aux/
L Line in
Line R
L
Optional
loopback
connection
Line L
in
R
Microphone/
SPL meter
Speakers
Alternatively, connect
the SPL meter via USB
USB
Fig.13: a typical setup for acoustic frequency response measurement using a sound
card. The audio system can be directly measured by attenuating the speaker output
signals to levels that are suitable for feeding into the sound card line-in terminals. Only
try that if you really know what you are doing!
Fig.14: a simple
setup for testing
an electronic
device using a
sound card.
PC
Sound
card
Line R
out L
In
Device under test
Line L
in
R
PC
Sound
card
Out
In
Line R
out L
Out
Loopback
connection
In
Line L
in
Device under test
R
Out
USB
In
USB
Fig.15: signal conditioning to
match the sound card with
the DUT signals.
Input signal
conditioning
Output signal
Out conditioning
Possible USB connection – eg, for MCU dev board
often combined with a stereo output
via a TRRS (tip-ring-ring-sleeve) headset socket. An external (eg, USB) audio
interface can also be used.
The arrangement in Fig.14 may work
in some cases, but often, the signal
levels and drive capabilities for the
DUT and sound card I/O may not be
compatible. This will require signal
conditioning circuits on either or both
the input and output of the device
(see Fig.15).
Coming up
We will continue to discuss measuring
frequency responses with a computer
sound card in the second article in this
PE
series, published next month.
Practical Electronics | October | 2025
|