---
title: Problem set 2
heading: "Problem set 2: logarithms, decibels and frequency"
eyebrow: A1 · Problem set 2
type: problems
---

::: hook
These problems use lessons 7 to 12: percent and ppm, logarithms, log scales, decibels, reading log charts, and time, frequency and wavelength. Each takes a few steps with your own numbers. Do the arithmetic on paper or with a calculator, and before you enter each answer, estimate it in your head to check its size.
:::

::: pool
pick: 10

::: check
kind: parts
given: p = 5 | 10 | 20 | 50; D = 5 | 10 | 30

## A real-time clock runs from a 32.768 kHz crystal specified at ±{p} ppm.

::: part
answer: 32768*p*1e-6
unit: Hz

### How many hertz can its frequency be off?

::: misses
- [32.768*p*1e-6] Put the frequency in hertz: 32.768 kHz is 32 768 Hz.
- [32768*p*1e-2] ppm is a millionth, not a hundredth.
- [any] Multiply 32 768 Hz by $\given{p} \times 10^{-6}$.
:::
:::

::: part
answer: p*1e-6*2592000
unit: s

### In the worst case, how far can the clock drift in 30 days?

::: misses
- [p*1e-6*30] Put the 30 days in seconds: $30 \times 86\,400$ s.
- [any] Multiply the time in seconds by the fractional error.
:::
:::

::: part
answer: D/2592000*1e6
tolerance: 1%

### What accuracy, in ppm, would keep the drift under {D} s in 30 days?

::: misses
- [D/2592000] That's the fraction. Multiply by a million for ppm.
- [D/30*1e6] Divide by the month in seconds, not in days.
- [any] Divide {D} s by the seconds in 30 days, then express it in millionths.
:::
:::
:::

::: check
kind: parts
given: R = 0.1 | 1 | 10; tc = 50 | 100 | 200; dT = 30 | 45 | 60

## A current-sense resistor of {R} Ω has a temperature coefficient of {tc} ppm/°C. It's calibrated at 25 °C and runs {dT} °C hotter. The meter computes $I = V/R$ using the calibrated value.

::: part
answer: R*tc*1e-6*dT
unit: Ω

### By how many ohms has it changed?

::: misses
- [R*tc*1e-6] That's one degree's worth. Multiply by {dT}.
- [any] Resistance times coefficient times temperature rise.
:::
:::

::: part
answer: tc*1e-6*dT*100
tolerance: 1%

### By what percent has it changed?

::: misses
- [tc*dT] That's in ppm. Divide by 10 000 for percent.
- [any] The coefficient times the rise is the fractional change.
:::
:::

::: part
answer: 100*(1 - 1/(1 + tc*1e-6*dT))
tolerance: 1%

### The real current is unchanged, but the resistor now drops more voltage. By what percent too high does the meter read?

::: misses
- [any] The voltage across it rose by the same factor as $R$, $1 + \given{tc} \times 10^{-6} \times \given{dT}$. Find the reading's relative error.
:::
:::

::: right
Right. The reading is high by the same factor the resistance grew, which is why precision current sensing uses resistors with tempcos of 50 ppm/°C or better.
:::
:::

::: check
kind: parts
given: vin = 1 | 2 | 5 | 10; G1 = 20 | 26 | 34; L = 3 | 6; G2 = 6 | 10 | 14

## A microphone puts out {vin} mV. It goes through a preamp with {G1} dB of voltage gain, a filter that loses {L} dB, and a driver with {G2} dB of gain.

::: part
answer: G1 - L + G2
tolerance: 0.1

### What is the total gain in dB?

::: misses
- [G1 + L + G2] The filter loses {L} dB, so subtract it.
- [any] Add the gains and subtract the loss.
:::
:::

::: part
answer: 10^((G1 - L + G2)/20)
tolerance: 1%

### By what factor does the chain multiply the voltage?

::: misses
- [10^((G1 - L + G2)/10)] That's the power factor. For voltage, divide the dB by 20.
- [any] A voltage factor is $10^{\text{dB}/20}$.
:::
:::

::: part
answer: vin*1e-3*10^((G1 - L + G2)/20)
unit: V

### What voltage comes out?

::: misses
- [vin*1e-3*10^((G1 - L + G2)/10)] Use 20 for voltage: $10^{\text{dB}/20}$.
- [vin*1e-3*(G1 - L + G2)] Turn the dB into a factor before multiplying.
- [any] Multiply the input by the voltage factor.
:::
:::
:::

::: check
kind: parts
given: P = 0.1 | 0.5 | 2 | 5 | 25; L = 2 | 3 | 6 | 10

## A transmitter puts out {P} W into a cable that loses {L} dB.

::: part
answer: 10*log10(P/1e-3)
tolerance: 0.1

### What is the transmitter's output in dBm?

::: misses
- [10*log10(P)] That's dBW, relative to 1 W. dBm is relative to 1 mW.
- [20*log10(P/1e-3)] Power uses 10 log, not 20 log.
- [any] dBm is $10\log_{10}(P / 1\ \text{mW})$.
:::
:::

::: part
answer: P*10^(-L/10)
unit: W

### What power reaches the far end?

::: misses
- [P*10^(-L/20)] Power uses $10^{-\text{dB}/10}$.
- [P - L] Decibels are a ratio. Turn the loss into a factor first.
- [any] Multiply by $10^{-\given{L}/10}$.
:::
:::
:::

::: check
kind: parts
given: fc = 100 | 200 | 500 | 1000; m = 4 | 8 | 16 | 32; s = 6 | 12 | 18; let f = fc*m

## A filter's response falls {s} dB per octave above its corner at {fc} Hz.

::: part
answer: ln(f/fc)/ln(2)
tolerance: 1%

### How many octaves is {f} Hz above the corner?

::: misses
- [f/fc] That's the ratio. Count the doublings: $\log_2$ of it.
- [log10(f/fc)] That's in decades.
- [any] $\log_2(\given{f}/\given{fc})$.
:::
:::

::: part
answer: s*ln(f/fc)/ln(2)
tolerance: 1%

### How many dB down is the response at {f} Hz, using the straight-line slope?

::: misses
- [s*log10(f/fc)] Count octaves, not decades.
- [any] Slope per octave times the number of octaves.
:::
:::

::: part
answer: s/log10(2)
tolerance: 1%

### What is the slope in dB per decade?

::: misses
- [s*log10(2)] A decade is more than three octaves, so the slope per decade is bigger.
- [s*10/2] A decade is $\log_2 10$ = 3.32 octaves, not 5.
- [any] Multiply by the octaves in a decade, 3.32.
:::
:::
:::

::: check
kind: parts
given: P1 = -40 | -50 | -60; d1 = 10 | 20 | 50; k = 3 | 5 | 20; let d2 = d1*k

## In free space, received power falls as $1/d^2$. At {d1} m from a transmitter a receiver measures {P1} dBm.

::: part
answer: 20
tolerance: 0.1

### How many dB does the signal drop when the distance goes up ten times?

::: misses
- [10] Power goes as $1/d^2$, so ten times the distance is a hundredth of the power.
- [100] That's the factor. Turn it into decibels.
- [any] Find the power ratio, then take 10 log of it.
:::
:::

::: part
answer: P1 - 20*log10(k)
tolerance: 0.1

### What does it measure at {d2} m, in dBm?

::: misses
- [P1 - 10*log10(k)] The power ratio is $k^2$, so the drop is $20\log_{10}$ of the distance ratio.
- [P1 + 20*log10(k)] Farther means weaker. Subtract.
- [any] Subtract $20\log_{10}(\given{d2}/\given{d1})$ dB.
:::
:::
:::

::: check
kind: parts
given: f = 100..2400 step 100; vf = 0.5 | 0.6 | 0.7

## A quarter-wave antenna is cut for {f} MHz.

::: part
answer: 3e8/(f*1e6)
unit: m

### What is the wavelength in air?

::: misses
- [3e8/f] Put the frequency in hertz.
- [any] $\lambda = c/f$.
:::
:::

::: part
answer: 3e8/(f*1e6)/4
unit: m

### How long is the antenna?

::: misses
- [3e8/(f*1e6)] That's a full wavelength. A quarter-wave antenna is a quarter of it.
- [3e8/(f*1e6)/2] That's a half-wave antenna.
- [any] A quarter of the wavelength.
:::
:::

::: part
answer: vf*3e8/(f*1e6)/4
unit: m

### The same antenna is printed on a board where the wave travels at {vf} of the speed of light. How long is it now?

::: misses
- [3e8/(f*1e6)/4/vf] Slower waves have shorter wavelengths: multiply by {vf}.
- [any] Multiply the length in air by {vf}.
:::
:::
:::

::: check
kind: parts
given: L = 5 | 10 | 20 | 30; f = 50 | 100 | 250 | 500

## A clock of {f} MHz runs along a {L} cm trace, where signals travel at half the speed of light.

::: part
answer: L*1e-2/1.5e8
unit: s

### How long does an edge take to cross the trace?

::: misses
- [L*1e-2/3e8] That's the speed in air. Use half of it.
- [L/1.5e8] Put the length in meters.
- [any] $t = d/v$ with $v = 1.5 \times 10^8$ m/s.
:::
:::

::: part
answer: L*1e-2/1.5e8*f*1e6*100
tolerance: 1%

### What percent of a clock period is that?

::: misses
- [L*1e-2/1.5e8/(f*1e6)*100] Divide the delay by the period, $1/f$, which is the same as multiplying by $f$.
- [any] Delay divided by the period, times 100.
:::
:::

::: part
answer: L*1e-2/(1.5e8/(f*1e6))
tolerance: 1%

### How many wavelengths long is the trace?

::: misses
- [L*1e-2/(3e8/(f*1e6))] Use the wavelength on the board, at half the speed of light.
- [any] Divide the length by $\lambda = v/f$.
:::
:::
:::

::: check
kind: parts
given: Po = 50 | 100 | 240; e1 = 80 | 85 | 88; e2 = 92 | 94 | 96

## A {Po} W power supply's efficiency improves from {e1}% to {e2}%, delivering the same output.

::: part
answer: Po*(100/e1 - 1)
unit: W

### How much power did it waste before?

::: misses
- [Po*(1 - e1/100)] That takes the loss as a share of the output. Efficiency is output over input, so find the input first: $P_o / \eta$.
- [Po*100/e1] That's the input. Subtract the output.
- [any] Input is $P_o/\eta$, and the loss is input minus output.
:::
:::

::: part
answer: Po*(100/e2 - 1)
unit: W

### How much does it waste after?

::: misses
- [Po*(1 - e2/100)] Find the input first: $P_o / \eta$.
- [any] Input minus output, at the new efficiency.
:::
:::

::: part
answer: 100*(1 - (100/e2 - 1)/(100/e1 - 1))
tolerance: 1%

### By what percent did the waste fall?

::: misses
- [e2 - e1] That's the change in efficiency, in percentage points.
- [any] Relative change of the loss: 1 minus the new loss over the old.
:::
:::
:::

::: check
kind: parts
given: p = 0.02 | 0.2 | 2 | 20; d = 6 | 10 | 20 | 40

## Sound pressure level is $L = 20\log_{10}(p / 20\ \mu\text{Pa})$ dB, where $p$ is the pressure of the sound wave.

::: part
answer: 20*log10(p/20e-6)
tolerance: 0.1

### What level is a sound of {p} Pa?

::: misses
- [10*log10(p/20e-6)] Sound pressure, like voltage, uses 20 log.
- [20*log10(p/20)] The reference is 20 µPa, $20 \times 10^{-6}$ Pa.
- [any] Divide by 20 µPa, take $\log_{10}$, multiply by 20.
:::
:::

::: part
answer: 10^(d/20)
tolerance: 1%

### How many times higher is the pressure of a sound {d} dB louder?

::: misses
- [10^(d/10)] For pressure, use $10^{\text{dB}/20}$.
- [any] Undo the 20 log: $10^{d/20}$.
:::
:::
:::

::: check
kind: parts
given: r = 3 | 5 | 8; m = 12 | 24

## A battery loses {r}% of its remaining charge each month while it sits on a shelf.

::: part
answer: 100*(1 - r/100)^m
tolerance: 1%

### What percent is left after {m} months?

::: misses
- [100 - r*m] Each month takes {r}% of what's left, not of the original, so the losses shrink. Multiply the factors.
- [any] Multiply by $1 - \given{r}/100$ once for each month.
:::
:::

::: part
answer: ln(0.5)/ln(1 - r/100)
tolerance: 1%

### After how many months is it at half?

::: misses
- [50/r] That assumes it loses {r}% of the original each month. It loses a share of what's left, so it takes longer.
- [any] Solve $(1 - \given{r}/100)^m = 0.5$ with logarithms: $m = \ln 0.5 / \ln(1 - \given{r}/100)$.
:::
:::
:::

::: check
kind: parts
given: N = 8 | 10 | 12 | 14 | 16; S = 60 | 70 | 80 | 90

## An ideal $N$-bit ADC digitizing a full-scale sine wave has a signal-to-noise ratio of $6.02N + 1.76$ dB.

::: part
answer: 6.02*N + 1.76
tolerance: 0.1

### What is the SNR with {N} bits?

::: misses
- [6.02*N] Add the 1.76 dB.
- [any] Put $N$ = {N} into $6.02N + 1.76$.
:::
:::

::: part
answer: 10^((6.02*N + 1.76)/10)
tolerance: 1%

### What power ratio is that?

::: misses
- [10^((6.02*N + 1.76)/20)] That's the voltage ratio. For power, divide by 10.
- [any] Undo $10\log_{10}$: $10^{\text{dB}/10}$.
:::
:::

::: part
answer: ceil((S - 1.76)/6.02)
tolerance: 0.5

### How many bits would you need for an SNR of at least {S} dB?

::: misses
- [floor((S - 1.76)/6.02)] One short: that gives a little less than {S} dB. Round up.
- [any] Solve $6.02N + 1.76 \ge \given{S}$ and round up.
:::
:::
:::
:::
