Skip to content
Learn Netverks

Lesson

Step 26/36 72% through track

fft-basics

FFT basics

Last reviewed May 28, 2026 Content v20260528
Track mode
server_script
Means
Server runner
Reading
~1 min
Level
intermediate

This lesson

This lesson teaches FFT basics: SciPy scientific routines on NumPy arrays—statistics, optimization, linear algebra, and numerical methods.

Frequency-domain thinking unlocks audio, vibration, and seasonality analysis.

You will apply FFT basics in contexts like: Audio processing, sensor diagnostics, and seasonal decomposition.

Read the narrative, run NumPy + SciPy snippets in the playground (install scipy and numpy with pip if needed), inspect outputs and convergence, and complete MCQs.

When you can explain the previous lesson's ideas in your own words.

Fast Fourier Transform decomposes signals into frequencies. scipy.fft (and numpy.fft) power spectral analysis; scipy.signal adds windows and filtering.

Concept

  • Time-domain samples → frequency-domain amplitudes
  • fft.fft(x) — complex spectrum
  • fft.fftfreq(n, d=dt) — frequency bins for sample spacing d
  • Magnitude np.abs(spectrum) for power plots

Pure tone detection

import numpy as np
from scipy import fft

rate = 100
t = np.arange(0, 1, 1/rate)
x = np.sin(2 * np.pi * 5 * t)
spectrum = fft.fft(x)
freqs = fft.fftfreq(len(t), 1/rate)
idx = np.argmax(np.abs(spectrum[:len(t)//2]))
print('peak freq ~', abs(freqs[idx]), 'Hz')

Important interview questions and answers

  1. Q: Nyquist frequency?
    A: Half the sample rate—frequencies above alias and corrupt analysis.
  2. Q: Why windowing?
    A: Reduces spectral leakage when signal does not fit an integer number of periods.

Self-check

  1. What does FFT convert between?
  2. What is the Nyquist limit for sample rate 1000 Hz?

Tip: Remember Nyquist: sample rate must exceed twice your highest frequency of interest.

Interview prep

FFT purpose?

Time to frequency domain—find periodic components.

Nyquist?

Max reliable frequency is half sample rate.

Interview tip Lesson completion confidence

Can you explain this lesson in 30 seconds without reading notes?

Not saved yet.

Playground

Runs on the configured server runner (dev: npm run runner with LEARNING_RUNNER_ENABLED=true). Output appears below the editor.

Check yourself

Multiple choice — immediate feedback.

Discussion

Past discussion is visible to everyone. Only logged-in users can post comments and replies.

Starter discussion topics

  • rfft vs fft?
  • Sampling rate?

Sign up or log in to post comments and sync lesson progress across devices.

No discussion yet. Be the first to ask a question.

Jump