Signal-processing project
Введено
7:22
Цифровая обработка сигналов
Digital signal processing rebuilds the continuous theory for samples, where arithmetic is exact: N samples in, N numbers out, and every promise can be…
Озвучивание на английском · переключаемые субтитры на английском и китайском языках
В этом уроке
| English | Значение |
|---|---|
| threshold/ˈθreʃəʊld/ | The level a detector compares each value with: above it counts as "signal present". |
| measured performance/ˈmeʒəd pəˈfɔːməns/ | измеренные характеристики |
| processing gain/ˈprəʊsesɪŋ ɡeɪn/ | обработка сигнала |
| false alarm/fɒls əˈlɑːm/ | A detection caused by noise alone, with no real signal present. |
Specify, build, measure
- The course ends the way real work begins: with a specification, an implementation and a measurement.
- An honest report records the gap between the three, failures included.
A verified pipeline
- The project is a tone detector: anti-alias filter, then window, then FFT, then threshold.
- Check each stage on its own before adding the next. A defect found in one stage costs an hour; found in the whole system, a week.

Put the tone detector's stages in order.
Сложность 3/5 · 200 монет + небольшой бонус за первое завершение сегодня
Filter before sampling, window before transforming, then decide on the spectrum.
Write the specification first
- The detector must give 1 Hz bins, answer in under 1 s, and detect a tone at $-10$ dB SNR.
- Every line gets a measured performance 实测性能 figure in the report, pass or fail.
A specification line the design fails should be left out of the report.
Сложность 1/5 · 100 монет + небольшой бонус за первое завершение сегодня
Every line gets its measured value, failures included. Silent goals hide exactly what a reader needs to know.
Worked example: two specification lines conflict
- 1 Hz bins at $f_{s} = 1$ kHz need $N \ge 1000$, which is already 1.0 s of data, against a latency limit under 1 s.
- $N = 1024$ gives 0.977 Hz bins but a 1.024 s record, which fails. $N = 1000$ needs exactly 1.0 s, so it passes only if the limit allows 1.0 s. The report records this trade-off.
0.5 Hz bins at f_s = 2 kHz need at least how many samples?
Сложность 2/5 · 140 монет + небольшой бонус за первое завершение сегодня
$N = f_{s}/\Delta f = 2000/0.5 = 4000$, which is 2 s of data.
How long a record, in s, does that design need?
Сложность 2/5 · 140 монет + небольшой бонус за первое завершение сегодня
4000 samples at 2 kHz is 2 s. Resolution always costs measurement time: $T = 1/\Delta f$.
Processing gain
- A tone's energy collects in one bin, while white noise spreads over all $N/2$ bins.
- So the FFT raises the SNR in the tone's bin by the processing gain 处理增益 $10\log_{10}(N/2)$ dB.
What processing gain does a 4096-point FFT give, in dB? Give the nearest whole number.
Сложность 2/5 · 140 монет + небольшой бонус за первое завершение сегодня
$10\log_{10}(4096/2) = 10\log_{10}2048 = 33.1$ dB.
Worked example: can −10 dB be detected?
- At $N = 1024$ the processing gain is $10\log_{10}512 = 27$ dB.
- An input SNR of $-10$ dB becomes about $+17$ dB in the tone's bin. The window costs a few dB, and detection still has margin.
A 256-point FFT gives 21 dB of processing gain. Can it find a tone at −25 dB input SNR?
Сложность 1/5 · 100 монет + небольшой бонус за первое завершение сегодня
−25 + 21 = −4 dB in the bin, below the noise. A longer FFT, 4096 points or more, would be needed.
Worked example: setting the threshold
- The last block decides "tone or no tone" by comparing each bin's power with a threshold 判决门限. Too low and noise alone crosses it (a false alarm 虚警); too high and a real tone is missed.
- In a bin holding only white noise, the power is random with mean $\sigma^2$, and the chance that it exceeds $T$ is $e^{-T/\sigma^2}$.
- Specification: at most one false alarm per 100 frames, with 512 bins per frame.
- Per bin: $100 \times 512 = 51\,200$ chances, so $e^{-T/\sigma^2} = 1/51\,200$ and $T/\sigma^2 = \ln 51\,200 = 10.8$, which is $10\log_{10}10.8 = 10.3$ dB above the mean noise.
- The tone: it sits about $+17$ dB above the noise in its bin (the step above), so it clears the threshold by about 6.7 dB, minus the few dB the window costs. Detection still has margin.
A detector checks 1000 noise-only bin values and may give one false alarm among them. Threshold $T/\sigma^2$ (two decimals)?
Сложность 2/5 · 140 монет + небольшой бонус за первое завершение сегодня
$e^{-T/\sigma^2} = 1/1000$, so $T/\sigma^2 = \ln 1000 = 6.91$, about 8.4 dB above the mean noise.
The threshold is raised by 3 dB. What happens?
Сложность 1/5 · 100 монет + небольшой бонус за первое завершение сегодня
A higher bar is crossed less often by noise and by weak tones alike. The threshold trades one error for the other; only more processing gain (a longer $N$) improves both.
A model report table
- How the finished table should look (the measured figures are an example):
| Specification | Measured | Verdict |
|---|---|---|
| bins of 1 Hz or finer | 1.000 Hz ($N = 1000$) | pass |
| latency under 1 s | 1.000 s of data + 0.1 ms FFT | fail by 0.1 ms: limit must allow 1.0 s |
| detect a tone at $-10$ dB SNR | 1000 of 1000 trials | pass |
| at most 1 false alarm per 100 frames | 3 in 10 000 frames | pass |
- Every row has a number and a verdict, and the failure is stated plainly, with what would fix it. That is what makes a report trustworthy.
Four common slips
- Testing only the easy case. Measure the hard ones too, and report failures.
- Tuning to the test tone. A detector fitted to one test proves nothing about others.
- Skipping stage checks. Integration hides faults that a stage test would show.
- Choosing the threshold by eye. Set it from the false-alarm rate you can accept, then measure both false alarms and misses.
Match each habit to the problem it prevents.
Сложность 2/5 · 140 монет + небольшой бонус за первое завершение сегодня
Verification is the difference between a demo and a product.
Recap
- Specify first; check each stage alone; measure the whole.
- Processing gain $10\log_{10}(N/2)$ decides whether a weak tone can be found:
| $N$ | 256 | 1024 | 4096 |
|---|---|---|---|
| Gain (dB) | 21 | 27 | 33 |
- Threshold from the false-alarm rate: $T/\sigma^2 = \ln(\text{chances per false alarm})$, 10.3 dB for one in 51 200.
- Every specification line gets a measured number and a verdict.
Что пошло не так? Это увидит только команда сайта.