Analog-to-digital converter Updated 2025-07-16
Many/most microcontroller boards have analog-to-digital converters built into them, it is very convenient. E.g. it is the case for the Raspberry Pi Pico.
Discrete Fourier transform Updated 2025-07-16
Input: a sequence of complex numbers .
Output: another sequence of complex numbers such that:
Intuitively, this means that we are braking up the complex signal into sinusoidal frequencies:
  • : is kind of magic and ends up being a constant added to the signal because
  • : sinusoidal that completes one cycle over the signal. The larger the , the larger the resolution of that sinusoidal. But it completes one cycle regardless.
  • : sinusoidal that completes two cycles over the signal
  • ...
  • : sinusoidal that completes cycles over the signal
and is the amplitude of each sine.
We use Zero-based numbering in our definitions because it just makes every formula simpler.
Motivation: similar to the Fourier transform:
In particular, the discrete Fourier transform is used in signal processing after a analog-to-digital converter. Digital signal processing historically likely grew more and more over analog processing as digital processors got faster and faster as it gives more flexibility in algorithm design.
Sample software implementations:
Figure 1.
DFT of with 25 points
. This is a simple example of a discrete Fourier transform for a real input signal. It illustrates how the DFT takes N complex numbers as input, and produces N complex numbers as output. It also illustrates how the discrete Fourier transform of a real signal is symmetric around the center point.
rpi-pico-w/upython/adc.py Created 2025-07-27 Updated 2025-08-08
The program continuously prints to the USB the value of the ADC on GPIO 26 once every 0.2 seconds.
The onboard LED is blinked as a heartbeat.
The hello world is with a potentiometer: extremes on GND and VCC pins of the Pi, and middle output on pin GIO26, then as you turn the knob, the uart value goes from about 0 to about 64k.
The 0 side is quite noisy and varies between 0 and 300 for some reason.
In Ciro's ASCII art circuit diagram notation:
RPI_PICO_W__gnd__gpio26Adc__3.3V@36
            |    |          |
            |    |          |
            |  +-+          |
            |  |            |
            |  |  +---------+ 
            |  |  |
         P__1__2__3