Locate Your Video With Plane Sounds

Use Doppler audio and public flight tracks to locate your own recording.

Introduction

30 Second Summary

A passing plane leaves more than a fading hum. Its shifting pitch holds clues about the place where someone heard it.

In this project, you will estimate where your own flyover recording was made using the Doppler effect and public ADS-B flight data. Your final map compares the strongest location guesses with the spot where you stood.

What You'll Build

Your finished map.html displays the strongest location patches beside the real spot where you recorded the plane.

By the end of this project, you'll have:

  • A timestamped flight log that records nearby aircraft every 15 seconds during your own flyover recording.
  • A zoomed spectrogram where the faint falling hum becomes visible. Your traced points are saved in curve.csv.
  • A scored location map with likely heat patches beside your real recording spot. The terminal reports how far the best guess is from where you stood.
  • Secret Mission: Record a second plane from the same spot to reduce the single-plane mirror ambiguity.

Are there any prerequisites?

You need a Mac running macOS 13.0+ or a Windows PC running Windows 10 1809+. You also need a recording phone plus a Claude Pro, Max, Ultra, Team, Enterprise, or Console account for Claude Code.

Before We Start

Before any analysis begins, commit to using only an audio or video recording you make yourself in a place where recording is allowed. You will compare the result only with your own known recording location.

Set Up Your Tools

A verified local workspace gives Claude Code everything it needs to build each script in this project.

Python runs the flight logger and analysis scripts. FFmpeg extracts audio from your recording.

A virtual environment keeps this project's packages separate from other Python projects on your computer.

In this step, get ready to:
  • Make Python 3.14, FFmpeg, and Claude Code available from your terminal.
  • Create an activated virtual environment containing the five required Python packages.
  • Sign in to Claude Code and verify all six dependency versions.
Install Python 3.14, FFmpeg, and Claude Code

These three tools form the local toolchain for the project. Installing them first prevents missing-command errors when you create the workspace.

macOS

  • Download the Python 3.14 macOS installer.
  • Select the installer for Python 3.14 from the downloads page.
  • Install Python 3.14 with the downloaded package.
  • Run the downloaded package.
  • Complete the standard installation.
  • Press Cmd+Space to open Spotlight.
  • Type Terminal.
  • Press Return to open Terminal.
  • Install FFmpeg by running this command:
brew install ffmpeg

What does this command do?

The brew command asks Homebrew to download FFmpeg and make it available from Terminal.

You should see Homebrew finish installing FFmpeg.

  • Install Claude Code by running this command:
curl -fsSL https://claude.ai/install.sh | bash

What does this command do?

This command downloads the official Claude Code installation script. Bash runs the script to install the command-line tool.

You should see the Claude Code installer finish.

  • Open a new Terminal window before checking the installations.
  • Press Cmd+N in Terminal to open the new window.

Windows

  • Download the Python install manager.
  • Select the Python install manager from the Windows downloads page.
  • Install the Python install manager with the downloaded installer.
  • Run the downloaded installer.
  • Complete the standard installation.
  • Press the Windows key to open the Start menu.
  • Type PowerShell.
  • Press Enter to open PowerShell.
  • Install Python 3.14 by running this command:
py install 3.14

What does this command do?

The Python install manager downloads the Python 3.14 runtime for Windows.

You should see Python 3.14 finish installing.

  • Install FFmpeg by running this command:
winget install Gyan.FFmpeg

What does this command do?

WinGet finds the Gyan FFmpeg package. It installs the FFmpeg commands on Windows.

You should see WinGet finish installing FFmpeg.

  • Install Claude Code by running this command:
irm https://claude.ai/install.ps1 | iex

What does this command do?

This command downloads the official Claude Code PowerShell installation script. PowerShell runs the script to install the command-line tool.

You should see the Claude Code installer finish.

  • Open a new PowerShell window before checking the installations.
  • Close the current PowerShell window.
  • Press the Windows key to open the Start menu.
  • Type PowerShell.
  • Press Enter to open a new PowerShell window.

Python is version-pinned because the package versions in this project require a compatible runtime. Check that your new terminal uses Python 3.14.

macOS

  • Check the installed Python version by running this command:
python3 --version

What does this command do?

The command asks the active Python 3 executable to print its version.

Windows

  • Check the installed Python 3.14 version by running this command:
py -3.14 --version

What does this command do?

The Python launcher selects the installed 3.14 runtime and prints its version.

You should see a version beginning with 3.14.

✔️ I see Python 3.14

Your Python runtime is ready for the pinned packages in this project.

ⓧ I see an older Python version

  • Return to your platform tab above.
  • Repeat the Python 3.14 installation.
  • Open a new terminal window.
  • Rerun the version check for your platform.

ⓧ Command not found

  • Return to your platform tab above.
  • Repeat the Python installation from the official download page.
  • Open a new terminal window after the installer finishes.
  • Rerun the version check for your platform.

Seeing a tool installation error?

  • If macOS reports command not found: brew, Homebrew is missing.
  • If Windows reports that ffmpeg is not recognized, close PowerShell and open a new window after WinGet finishes.

Still stuck? Help me troubleshoot my Python, FFmpeg, or Claude Code installation.

Create the project environment

The project folder keeps your recordings and scripts together. Its virtual environment holds only the package versions required for this workflow.

macOS

  • Create the plane-sounds folder and move into it by running these commands:
mkdir -p ~/plane-sounds
cd ~/plane-sounds

What do these commands do?

  • The first command creates plane-sounds in your home folder.
  • The second command moves Terminal into that folder.

Your terminal prompt should now point to ~/plane-sounds.

  • Create and activate the virtual environment by running these commands:
python3 -m venv .venv
source .venv/bin/activate

What do these commands do?

  • The first command creates an isolated Python environment in .venv.
  • The second command activates that environment for the current Terminal window.

You should see (.venv) at the start of the terminal prompt.

The package installation can take a few minutes while pip downloads the scientific libraries.

  • Install the required package versions by running this command:
python -m pip install numpy==2.5.5 "scipy>=1.18,<1.19" matplotlib==3.11.2 folium==1.0.0 requests==2.34.2

What does this command do?

The command installs all five project packages inside the active virtual environment. The SciPy range selects the latest available 1.18.x release.

You should see successful package installation messages while (.venv) remains visible in the prompt.

Windows

  • Press the Windows key to open the Start menu.
  • Type Command Prompt.
  • Press Enter to open Command Prompt.
  • Create the plane-sounds folder and move into it by running these commands:
mkdir "%USERPROFILE%\plane-sounds"
cd /d "%USERPROFILE%\plane-sounds"

What do these commands do?

  • The first command creates plane-sounds inside your Windows user folder.
  • The second command moves Command Prompt into that folder.

Your Command Prompt should now point to %USERPROFILE%\plane-sounds.

  • Create and activate the virtual environment by running these commands:
py -m venv .venv
.venv\Scripts\activate

What do these commands do?

  • The first command creates an isolated Python environment in .venv.
  • The second command activates that environment for the current Command Prompt window.

You should see (.venv) at the start of the command prompt.

The package installation can take a few minutes while pip downloads the scientific libraries.

  • Install the required package versions by running this command:
python -m pip install numpy==2.5.5 "scipy>=1.18,<1.19" matplotlib==3.11.2 folium==1.0.0 requests==2.34.2

What does this command do?

The command installs all five project packages inside the active virtual environment. The SciPy range selects the latest available 1.18.x release.

You should see successful package installation messages while (.venv) remains visible in the prompt.

What are these packages for?

  • NumPy handles arrays of audio samples and numerical results.
  • SciPy creates the short-time Fourier transform used for the spectrogram.
  • Matplotlib draws the spectrogram and captures your curve clicks.
  • Folium builds the final interactive map.
  • Requests retrieves public aircraft data from the adsb.lol API.

Package installation not completing?

  • Confirm that (.venv) appears at the start of your prompt.
  • Repeat the activation command from your platform tab if the environment name is missing.
  • Confirm that your Python version check begins with 3.14.

Still stuck? Help me diagnose my virtual environment or package installation.

Verify the workspace with Claude Code

The final check tests the complete workspace from inside the activated environment. Claude Code reads the installed versions without changing anything.

Before you run the first check, do you expect the terminal to recognize the new Claude Code command?

  • Check the Claude Code installation by running this command:
claude --version

What does this command do?

The command asks Claude Code to print its installed version. A version number confirms that your terminal can find the program.

You should see a Claude Code version number.

This sign-in connects Claude Code to your existing account. You remain inside the local plane-sounds workspace.

  • Start Claude Code by running this command:
claude

What does this command do?

The command starts Claude Code in the current plane-sounds folder. It can now inspect the active environment when you ask it to.

  • Complete the Claude Code sign-in prompts.

You should return to an interactive Claude Code prompt after signing in.

Before you ask for the environment report, which six labels do you expect Claude Code to print?

  • Verify the active environment by pasting this exact prompt into Claude Code:
Check that this folder's active virtual environment can import numpy, scipy, matplotlib, folium, and requests, and that ffmpeg is on PATH. Do not install or change anything. Print exactly these six labels, one per line, followed by the detected version: numpy, scipy, matplotlib, folium, requests, ffmpeg.

What does this prompt do?

The prompt checks each import from the active virtual environment. It also confirms that FFmpeg is available on your system path.

The instruction prevents Claude Code from installing or changing anything during the check.

You should see six labelled lines. The package versions should show NumPy 2.5.5, SciPy 1.18.x, Matplotlib 3.11.2, Folium 1.0.0, and Requests 2.34.2.

You should also see an FFmpeg version after the final ffmpeg label.

Missing a version line?

  • Confirm that (.venv) was visible before you started Claude Code.
  • Exit Claude Code if you activated the environment after starting it.
  • Start Claude Code again from the activated plane-sounds environment.

Still stuck? Help me understand which workspace dependency is missing.

Your full local toolchain is now working. Claude Code can access every dependency needed for the flight logger, audio analysis, and map scripts.

Your workspace is ready. Next, you will record your own flyover while logging the aircraft above you.

Record a Flyover and Log Nearby Planes

Your local toolchain is ready. Now you can use Claude Code to connect an own-recorded flyover with the aircraft positions captured above you.

The location model needs a trustworthy clock link between your own recording and aircraft positions captured at that moment.

In this step, get ready to:
  • Store your known recording coordinates in recording_location.txt.
  • Create log_flights.py so it records aircraft snapshots no faster than every 15 seconds.
  • Capture your own flyover recording and confirm that flights.jsonl plus the unedited media file exist locally.
Save the known answer and set the ethical boundary

Your known location lets you measure how close the final guess gets. The recording must come from a setting where you have permission to capture it.

  • Limit the recording to yourself or your own space.
  • Use a public place only where recording is allowed.
  • Exclude social media clips or footage made by someone else.

You will use OpenStreetMap to capture the known coordinates before recording. These values give the final map a real location to check against.

  • Open OpenStreetMap to find the permitted spot where you will stand.
  • Use the map search to find your recording area.
  • Right-click the precise spot where you will stand.
  • Select Show address from the menu.

You should see the spot's latitude and longitude in the side panel.

  • Record the displayed latitude as your recording latitude.
  • Record the displayed longitude as your recording longitude.
  • Switch back to your active Claude Code session in the plane-sounds folder.
  • Create recording_location.txt by pasting this exact prompt into Claude Code:
Ask me for the latitude and longitude of the place where I will make my own recording. Then create recording_location.txt with exactly two lines named real_latitude and real_longitude, using the values I give you. Do not write a script.

What does this prompt do?

Claude Code asks for your two known coordinates. It stores them in a small text file without creating another script.

Keeping the known answer in recording_location.txt lets later scripts check the estimate without relying on memory.

  • Enter your recording latitude when Claude Code asks for the latitude.
  • Enter your recording longitude when Claude Code asks for the longitude.

You should see Claude Code create recording_location.txt with lines beginning real_latitude= and real_longitude=.

Ask Claude Code to write the keyless flight logger

Aircraft broadcast position data through ADS-B. The adsb.lol API provides nearby public aircraft snapshots without an API key.

The logger uses JSON Lines so each session or aircraft observation occupies its own row. A fixed 15-second polling interval preserves the timeline without exceeding the requested rate.

  • Create log_flights.py by pasting this exact prompt into Claude Code:
Write log_flights.py. Read real_latitude and real_longitude from recording_location.txt. Ask me to press Enter at the moment I start my own recording. Save a session row to flights.jsonl with recording_started_utc, latitude, longitude, and poll_seconds set to 15. Then, every 15 seconds and never faster, make a keyless GET request to https://api.adsb.lol/v2/point/{lat}/{lon}/15. For every aircraft with a position, append one JSON row containing kind, observed_utc, hex, flight, type, lat, lon, alt_baro_ft, alt_baro_m, gs_knots, gs_m_s, and track. Convert feet to metres with 0.3048 and knots to metres per second with 0.514444. Use the API's dst value in nautical miles to print aircraft within 10 km as exactly WITHIN 10 KM | {hex} | {distance_km:.1f} km | {gs_m_s:.1f} m/s. Let me press Enter again to stop. If the API returns 429, print exactly 429: adsb.lol keyless daily quota reached. Stop and try another day. On a normal stop, print exactly Saved flights.jsonl. Do not use an API key or any flight-data provider other than adsb.lol.

What does this prompt do?

  • The script reads your known coordinates from recording_location.txt.
  • The first press of Enter records the UTC start time for your phone recording.
  • The endpoint searches within 15 nautical miles of your coordinates.
  • The printed WITHIN 10 KM lines highlight the closest aircraft.
  • The conversion fields make altitude and speed available in metric units for later analysis.

You should see Claude Code create log_flights.py in the plane-sounds folder.

Run the logger while you make the recording

The first press of Enter creates the shared start moment between the flight log and your phone recording. Keeping the original file unedited preserves that timing link.

Before you run the logger, predict whether the script shows a start prompt or an aircraft line first.

macOS

  • Start the logger from the activated terminal in ~/plane-sounds by running this command:
python3 log_flights.py

What does this command do?

Python starts the logger from log_flights.py using the packages available in your active virtual environment.

Windows

  • Start the logger from the activated Command Prompt in %USERPROFILE%\plane-sounds by running this command:
py log_flights.py

What does this command do?

The Python launcher starts log_flights.py using the packages available in your active virtual environment.

You should see the logger ask you to press Enter when your recording starts.

Expect this capture to take 3 to 5 minutes while you wait for a nearby aircraft.

  • Start an unedited audio or video recording on your phone.
  • Use your phone's video or voice-memo app to begin the recording.
  • Press Enter in the terminal at the same moment.
  • Stay still during the recording.
  • Keep silent during the recording.
  • Keep the unedited recording running for 3 to 5 minutes.
  • Wait until the terminal prints at least one WITHIN 10 KM line.

You should see the logger poll repeatedly. A nearby result includes the aircraft hex value plus its distance and speed.

  • Press Enter again to stop the logger.

You should see Saved flights.jsonl after a normal stop.

  • Stop the recording on your phone.
  • Use the recording control in your phone app to finish the file.
  • Copy the unedited phone recording into the plane-sounds folder.
  • Transfer the recording with AirDrop, a USB cable, or an email to yourself.
  • Place the transferred file inside ~/plane-sounds on macOS or %USERPROFILE%\plane-sounds on Windows.

That captures the crucial evidence. Your local folder now pairs an own-recorded flyover with aircraft observations from the same period.

No nearby aircraft or seeing 429?

  • If you see 429: adsb.lol keyless daily quota reached. Stop and try another day. follow the message and keep the polling interval at 15 seconds.
  • If no aircraft reaches 10 km, try again at another time or from a permitted place closer to a flight path.
  • Remember that an aircraft you hear can be absent from public flight data.

Still stuck? Help me troubleshoot my flyover capture and adsb.lol flight log.

Before you ask Claude Code to inspect the folder, predict whether it can identify the recording without opening it.

  • Verify the local recording and flight log by pasting this exact prompt into Claude Code:
Inspect only the filenames in this folder. Tell me the exact filename and extension of the newest video or audio recording, and confirm that flights.jsonl exists. Do not open, play, upload, rename, or modify the recording.

What does this prompt do?

Claude Code checks file names without reading or playing your recording. This confirms the two capture artifacts while keeping the media local and unchanged.

You should see the exact recording filename and extension. You should also see confirmation that flights.jsonl exists.

Your recording now has a matching flight timeline. Next, you will turn its audio into a spectrogram and reveal the falling aircraft curve.

Create and Trace the Spectrogram

Your own recording now sits beside the matching flight log. Next, you will turn its audio into a visible curve.

A full-range spectrogram gives you a baseline for choosing settings that expose the faint aircraft hum.

In this step, get ready to:
  • Create a full-range baseline spectrogram that reveals the limits of the initial settings.
  • Produce a zoomed 50 to 600 Hz spectrogram where a faint falling aircraft curve is visible.
  • Trace 15 to 30 points along the curve into curve.csv in time order.
Build the full-range baseline

A spectrogram plots the strength of each frequency over time. A passing aircraft can draw a bending line because the Doppler effect changes the pitch you hear as the aircraft approaches and departs.

  • Paste this exact prompt into Claude Code in the activated plane-sounds session:
Find the own recording file in this folder. Use ffmpeg to extract its audio as mono clip.wav at 8000 Hz. Then write spectrogram.py using scipy.signal.ShortTimeFFT with a 256-sample Hann window, a hop of 128 samples, and the whole 0 to 4000 Hz range. Save the picture as spectrogram.png and print exactly Saved spectrogram.png: 0-4000 Hz. Run the script now.

What does this prompt build?

  • FFmpeg extracts one audio channel from your recording at 8000 Hz and saves it as clip.wav.
  • The ShortTimeFFT analysis divides that audio into overlapping windows so each moment has a frequency profile.
  • The first spectrogram.png displays the complete 0 to 4000 Hz range as a baseline.

You should see clip.wav and spectrogram.py appear in the folder. The terminal should print Saved spectrogram.png: 0-4000 Hz.

Your recording now has a visual frequency map. Before you open it, do you think the faint aircraft curve will stand out across the complete frequency range?

  • Open spectrogram.png from the plane-sounds folder.
  • Use your computer's file browser to return to the plane-sounds folder.
  • Select spectrogram.png to view it.

The aircraft curve should be difficult or impossible to distinguish at this scale. That weak view is the intended baseline.

Why does the curve disappear?

The 0 to 4000 Hz view compresses the low aircraft frequencies into a narrow strip. Short 256-sample windows also provide limited frequency detail.

The next version focuses the image on the relevant band. It also uses longer windows to separate nearby frequencies.

Reveal the useful frequency band

Longer windows sharpen frequency detail across the recording. Limiting the plot to 50 to 600 Hz gives the aircraft hum enough space to become visible.

Before you replace the baseline, do you expect the narrower view to reveal a curved line or another featureless image?

  • Paste this exact prompt into Claude Code:
Change spectrogram.py to use a 16384-sample Hann window, a hop of 1024 samples, and mfft 16384. Plot only 50 to 600 Hz with a logarithmic colour scale. Keep the output filename spectrogram.png and print exactly Saved spectrogram.png: 50-600 Hz, 0.49 Hz bins. Run the script now.

What does this prompt change?

  • The 16384-sample window gives the analysis more audio per frequency measurement.
  • The 1024-sample hop moves that window through the recording in smaller time steps.
  • The logarithmic colour scale makes faint frequency components easier to compare with stronger background sounds.
  • The 50 to 600 Hz limit dedicates the image to the low-frequency band where the aircraft curve may appear.

You should see spectrogram.png get replaced. The terminal should print Saved spectrogram.png: 50-600 Hz, 0.49 Hz bins.

  • Reopen spectrogram.png from the plane-sounds folder.
  • Return to the file browser from earlier.
  • Select the updated spectrogram.png file.

You should see a faint line that bends from a higher frequency on the left to a lower frequency on the right. That falling bend is the aircraft signal you were looking for.

What are the extra curves?

Higher and fainter copies of the main curve can be harmonics. Follow one clear bending line during the trace so your points describe one consistent signal.

Trace the falling Doppler curve

An interactive Matplotlib window lets you turn the visible curve into measured time and frequency pairs. A CSV file preserves those clicks for the calculations in the next step.

  • Paste this exact prompt into Claude Code:
Write trace_curve.py. It must rebuild the same 50 to 600 Hz ShortTimeFFT view from clip.wav, open it in an interactive Matplotlib window, and let me left-click 15 to 30 points along the clearest falling curve. Pressing Enter must finish the trace. Sort the points by time, save them to curve.csv with the exact headers seconds and hz, and print Saved curve.csv with N points using the real point count. Run the script now and wait for my clicks.

What does this prompt build?

  • The new trace_curve.py script rebuilds the same 50 to 600 Hz view so your clicks align with the image you inspected.
  • Each click records one time value and one frequency value.
  • Sorting by time prepares the points for measuring how the pitch falls through the recording.
  • The seconds,hz headers give the next script stable column names to read.

You should see the zoomed spectrogram in an interactive window. Claude Code should wait while you trace the curve.

  • Left-click 15 to 30 points along the clearest falling curve.
  • Place the first point near the left end of one bending line.
  • Continue along the same line toward the right.
  • Keep each point near the centre of the visible curve.

Before you press Enter, how many data rows do you expect the script to save from your clicks?

  • Press Enter to finish the trace.

You should see Saved curve.csv with N points with your real point count in place of N.

  • Open curve.csv from the plane-sounds folder.
  • Return to the file browser from earlier.
  • Select curve.csv in the plane-sounds folder.

You should see seconds,hz as the headers. Below them, you should see 15 to 30 points ordered from the earliest time to the latest time.

Can't find a falling curve?

  • Ignore straight horizontal lines because they usually come from steady sounds such as fans or traffic.
  • Trace only the bending part of one curve so the points describe a consistent aircraft pass.
  • Make another own recording closer to a flight path if no bending line appears in the 50 to 600 Hz view.

Still unsure which line to trace? Help me identify the falling aircraft curve in my spectrogram.

Your aircraft hum is now a time-ordered set of measurements. Next, you will use that falling curve to estimate the plane's speed and closest distance.

Fit and Match the Aircraft

Your traced curve captures the Doppler effect as a sequence of time and frequency points. Those points can now reveal rough details about the aircraft that made the sound.

This step turns the curve's pitch drop into rough flight measurements so you can compare it with one logged aircraft.

In this step, get ready to:
  • Fit the traced curve. The terminal prints speed, closest distance, and closest-approach time.
  • Match closest approach to UTC. The terminal lists plausible aircraft within 10 km.
  • Rank the candidates. The script saves a six-character match or reports that none is plausible.
Fit speed and closest approach

The pitch at the start of the curve is higher because the aircraft is approaching. The pitch at the end is lower because the aircraft is moving away.

The size of that drop provides a rough speed estimate. The steepest falling section helps estimate when the aircraft was closest.

  • Submit this exact prompt in Claude Code from earlier:
Write fit_curve.py. Read curve.csv, sort it by seconds, estimate f_hi from the first fifth of the points and f_lo from the last fifth, smooth only enough to find the most negative local slope, and take that time as closest approach. Use c = 343 m/s, v = c * (f_hi - f_lo) / (f_hi + f_lo), f0 = (f_hi + f_lo) / 2, and d = f0 * v**2 / (c * abs(slope)). Put a plain-English comment beside each formula. Print exactly Curve speed: N m/s, Closest distance: N m, and Closest approach in clip: N s with computed values replacing N. Run it now. Do not print invented sample measurements.

What does this prompt do?

  • The first fifth of the points estimates the approaching pitch. The last fifth estimates the departing pitch.
  • The pitch difference produces a rough speed estimate using the moving-source Doppler model.
  • The steepest negative slope marks the estimated closest approach in the recording.
  • The slope also helps estimate the closest distance between you and the aircraft.

You should see Curve speed: N m/s, Closest distance: N m, and Closest approach in clip: N s with measured values replacing each N.

Your traced shape is now a set of measurements that can be checked against the flight log.

Seeing an implausible speed?

  • Check whether the fitted speed falls below 30 m/s or rises above 300 m/s. Either result usually means the traced points follow a steady hum or the wrong harmonic.
  • Ask Claude Code to run trace_curve.py again.
  • Click only the bending section of one falling curve.

Still stuck? Help me identify why fit_curve.py produces an implausible aircraft speed from curve.csv..

Match the curve time to the flight log

The closest-approach time currently describes a position inside clip.wav. The recording start stored in flights.jsonl converts that position into a UTC timestamp.

That timestamp connects the sound to the aircraft positions in the ADS-B log. Each nearby aircraft can then be compared using its logged speed and approximate slant distance.

  • Submit this exact prompt in Claude Code:
Extend fit_curve.py. Read the recording_started_utc session row from flights.jsonl and turn the closest-approach seconds into UTC. For each aircraft, use the logged row nearest that UTC moment. List only aircraft within 10 km of the real spot. Print each as CANDIDATE | {hex} | {gs_m_s:.1f} m/s | {slant_distance_m:.0f} m. Use alt_baro_m in the approximate slant distance and explain in a comment that barometric altitude is above sea level, so this beginner estimate ignores local ground elevation. Print Closest approach UTC: {timestamp}. Run it now.

What does this prompt do?

  • The script adds the closest-approach seconds to the recording start time.
  • It selects the logged row nearest that UTC moment for each aircraft.
  • It keeps aircraft logged within 10 km of the real recording spot.
  • Its slant-distance estimate uses barometric altitude above sea level. Local ground elevation remains outside this beginner estimate.

You should see Closest approach UTC: {timestamp} followed by zero or more candidate lines.

Each possible match uses the format CANDIDATE | {hex} | {gs_m_s:.1f} m/s | {slant_distance_m:.0f} m.

The recording clock and flight log now point to the same moment.

Rank the closest candidate

A plausible candidate should resemble both the curve-derived speed and the curve-derived distance. Ranking combines those relative differences without treating either measurement as exact.

Wind can affect the comparison. Turns, altitude datum differences, and tracing uncertainty can affect it too.

Before you run it, what do you expect the ranking to choose? Your prediction is ready to test.

  • Submit this exact prompt in Claude Code:
Extend fit_curve.py again. Rank the candidate aircraft by the combined relative difference between curve speed and logged gs_m_s, plus curve distance and approximate slant distance. If at least one candidate exists, write the best candidate's six-character hex value to matched_hex.txt and print Matched aircraft: {hex}. If none exists, do not invent one and print exactly No plausible logged aircraft match. Run it now.

What does this prompt do?

  • The ranking compares each candidate's logged speed with the curve speed.
  • It also compares the approximate slant distance with the curve distance.
  • A plausible best candidate is saved to matched_hex.txt as a six-character aircraft identifier.
  • An empty candidate list produces an honest no-match result.

If a plausible candidate exists, you should see Matched aircraft: {hex}. You should also see matched_hex.txt in the plane-sounds folder.

If no candidate is plausible, you should see No plausible logged aircraft match. The script does not create an invented match.

You have completed the match with uncertainty kept visible. That makes either result useful evidence.

Your aircraft sound now connects to a plausible real flight or an honest no-match result. Next, the matched track becomes the moving reference for scoring possible recording locations.

Score the Location Grid

You have a plausible aircraft candidate from the traced curve. Now you can test nearby positions against the aircraft's real movement and turn those comparisons into a map.

This step scores a 200 m location grid against the aircraft's full ADS-B track so changes in speed and direction become part of the location estimate.

The earlier curve fit reduced the flyover to a few measurements. This scorer uses emission time and radial velocity to model where the aircraft was when each sound left it.

In this step, get ready to:
  • Download the matched aircraft's stored track into track.json.
  • Score 200 m grid points within 10 km and save the ranked results in scores.csv.
  • Create map.html with likely-location patches and both comparison markers.
Download the matched aircraft track

The six-character hex in matched_hex.txt identifies one aircraft in the adsb.lol API. Its stored track provides the changing position and movement data that the grid scorer needs.

  • Confirm matched_hex.txt is present in the plane-sounds folder.
  • Ask Claude Code to create and run download_track.py by pasting this exact prompt:
Write download_track.py. Read the six-character aircraft hex from matched_hex.txt, make a keyless GET request to https://api.adsb.lol/1/trace/full/{hex}, save the returned JSON as track.json, and print exactly Saved track.json. If the endpoint returns 404, print exactly No stored track found for that aircraft. If it returns 429, print exactly 429: adsb.lol keyless daily quota reached. Stop and try another day. Run it now. Do not use any other flight-data provider.

What does this prompt do?

  • The script reads the matched hex so the request targets the aircraft selected from your own flight log.
  • The full-trace endpoint returns the stored position history as JSON.
  • The error handling preserves an honest result when a track is unavailable or the daily quota has been reached.

You should see Saved track.json in Claude Code. You should also see track.json in the project folder.

Your matched aircraft now has a complete movement history ready for scoring.

Can't download the track?

  • If matched_hex.txt is missing, the earlier fit did not find a plausible aircraft candidate. Recheck that result before continuing.
  • If you see No stored track found for that aircraft. the matched aircraft has no stored full trace available.
  • If you see 429: adsb.lol keyless daily quota reached. Stop and try another day. wait until another day before making another request.

Still stuck? Help me diagnose why download_track.py did not create track.json

Score the candidate locations

Each grid point represents one possible place where your phone could have recorded the flyover. The scorer predicts the curve from that position and measures how closely it matches the frequencies in curve.csv.

Your nearby town centre anchors the search area without handing the script your known recording spot. The script still uses recording_location.txt later to measure the final result.

  • Ask Claude Code to create and run locate.py by pasting this exact prompt:
Write locate.py. Read curve.csv, track.json, flights.jsonl, and recording_location.txt. Ask me for a nearby town-centre latitude and longitude, not my exact spot. Build points every 200 m inside a 10 km radius. For every grid point, every traced second, and time shifts from -10 to +10 seconds, solve for the moment the sound heard then left the aircraft by iterating emission_time = hearing_time - range_at_emission / 343. Interpolate the real track at that emission moment. Compute the aircraft's radial range rate toward or away from the grid point at the emission moment, not the hearing moment, and predict frequency with f_heard = f_source * 343 / (343 + range_rate). Try source pitches across the range of curve.csv, score the squared error, keep the best pitch and time shift for each grid point, save scores.csv, and print the five best points as TOP {rank} | LAT {lat:.6f} | LON {lon:.6f} | SCORE {score:.6f}. Convert all trace altitudes from feet to metres and trace ground speeds from knots to metres per second before using them. Do not print invented sample scores. Run it now.

What does this prompt do?

  • The grid places candidate recording spots every 200 m inside a 10 km radius.
  • The emission-time loop works backwards from hearing time to estimate where the aircraft was when the sound began travelling.
  • The radial range rate describes how quickly the aircraft moves toward or away from each candidate point.
  • The source-pitch and time-shift searches keep the combination with the lowest squared error for each point.
  • Enter your nearby town-centre latitude when locate.py asks for the latitude.
  • Enter your nearby town-centre longitude when locate.py asks for the longitude.

You should see five ranked TOP {rank} | LAT {lat:.6f} | LON {lon:.6f} | SCORE {score:.6f} lines in the terminal. You should also see scores.csv in the project folder.

You now have a ranked evidence layer that the final map can make visible.

Scoring stopped before scores.csv?

  • Check that curve.csv, track.json, flights.jsonl, and recording_location.txt are all in the plane-sounds folder.
  • Check that the town-centre values are valid decimal latitude and longitude coordinates.
  • Ask Claude Code to inspect the actual trace structure before changing any conversion or interpolation logic.

Need help? Help me find why locate.py stopped before creating scores.csv

Map the best-scoring locations

Ranked coordinates are difficult to compare as terminal text. Folium can place those scores over OpenStreetMap tiles so the shape of the result becomes visible.

Before you run the final prompt, do you think one aircraft can distinguish which side of its path held the microphone?

  • Ask Claude Code to extend and run locate.py by pasting this exact prompt:
Extend locate.py to create map.html with Folium and OpenStreetMap tiles. Add a heat map whose strongest weights are the lowest-error grid points, a marker named Best guess on the top point, and a marker named Where you stood using recording_location.txt. Compute the map distance between those two markers and print exactly Best guess is N m from where you stood with the computed whole-number distance replacing N. Print the full local file address for map.html, then run the script now.

What does this prompt do?

  • The heat map gives the strongest visual weights to the grid points with the lowest prediction errors.
  • The Best guess marker identifies the top-ranked candidate point.
  • The Where you stood marker provides the known answer for comparison.
  • The whole-metre separation gives you a concrete way to evaluate the result.

You should see map.html and a line in the form Best guess is N m from where you stood. You should also see a full local file address for the map.

  • Go to the printed full local file address in your browser.
  • Copy the full local file address printed by locate.py.
  • Paste the address into your browser's address bar.
  • Press Enter to load the map.

You should see two likely heat patches with Best guess and Where you stood markers. The terminal should still show their whole-metre separation.

Map missing or nearly uniform?

  • If the local address does not load, confirm that map.html exists in the plane-sounds folder.
  • If nearly the whole grid has the same score, recheck the recording start time before widening the time-shift search.
  • If both markers are missing, check that scores.csv and recording_location.txt contain readable values.

Still stuck? Help me diagnose why map.html is missing or shows a uniform heat map

Two similarly strong patches are the expected one-plane mirror ambiguity. Each patch can produce a similar falling curve from the opposite side of the aircraft's path.

Secret mission

Break the Mirror With a Second Plane

Capture a second plane from the same known spot without overwriting your first dataset. Then combine both independently matched tracks to test whether the likely location area becomes smaller or less ambiguous.

Clean Up Your Resources

Clean Up Your Resources

Keeping the plane-sounds folder adds no usage charges beyond your existing Claude plan. Choose whether to keep the files, pause your running tools, or delete the folder entirely.

Your Folder Holds Exact Location Data

The recording_location.txt file stores the exact coordinates where you stood. The map.html file plots that spot beside the combined location guess.

Your own recordings remain in the same folder. Together, these files can reveal where you made both recordings.

Resources you used:

  • Local project folder plane-sounds containing the .venv environment, Python scripts, own recordings, flight logs, spectrograms, traced curves, downloaded aircraft tracks, combined scores, exact recording coordinates, and map.html.

Keep everything running

No action needed. Choose this if you want to preserve the recordings, analysis files, and combined map for future experiments.

  • Keep the plane-sounds folder intact so you can reproduce the combined location result.
  • Keep recording_location.txt private because it contains your exact recording coordinates.
  • Leave log_flights.py stopped when you are not recording another flyover.

Pause - I'll come back to this later

Shut down your active tools while keeping every local file available for later.

  • Close your current Claude Code session.
  • Close Terminal on macOS or Command Prompt on Windows.
  • Leave the plane-sounds folder in your home folder.

Your virtual environment, recordings, flight data, and maps remain on your computer when you return.

Delete - I don't want to use this again

Deleting this folder is final on this computer. Your recordings and exact-location evidence disappear with the scripts that created them.

macOS

  • Close your Claude Code session so you return to the Terminal prompt.
  • Delete the plane-sounds folder from your home folder by running these commands:
cd ~
rm -rf plane-sounds
ls
What Do These Commands Do?
  • The first command moves the terminal to your home folder.
  • The second command permanently removes the complete local project folder.
  • The final command lists the folders that remain so you can verify the deletion.

You should no longer see plane-sounds in the folder listing.

Windows

  • Close your Claude Code session so you return to the Command Prompt.
  • Delete the plane-sounds folder from your Windows user folder by running these commands:
cd /d "%USERPROFILE%"
rmdir /s /q plane-sounds
dir
What Do These Commands Do?
  • The first command moves Command Prompt to your Windows user folder.
  • The second command permanently removes the complete local project folder.
  • The final command lists the folders that remain so you can verify the deletion.

You should no longer see plane-sounds in the folder listing.

Nice Work!

Nice Work!

You did it! Your two self-recorded flyovers now produce a combined acoustic geolocation map that checks its best guess against the spot where you stood.

You've learned how to:

  • Capture synchronized flight evidence by logging nearby aircraft through the adsb.lol API every 15 seconds during your own recording.
  • Reveal a faint aircraft hum by narrowing the spectrogram from 0 to 4000 Hz to 50 to 600 Hz. Trace the falling curve created by the Doppler effect into curve.csv. Match a plausible logged aircraft from the fitted curve.
  • Correct the Doppler prediction with the aircraft state at emission time. Score a 200 m location grid against each full aircraft track. Display the expected mirror ambiguity on an OpenStreetMap map containing a Best guess marker plus a Where you stood marker.
  • Secret Mission: Combine a second self-recorded flyover with an independently matched aircraft track to test whether the two-patch area becomes smaller. Evaluate the combined result without claiming a guaranteed single patch or fixed accuracy.

Ready to quiz yourself?