惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Hugging Face - Blog
Hugging Face - Blog
腾讯CDC
阮一峰的网络日志
阮一峰的网络日志
博客园_首页
Last Week in AI
Last Week in AI
月光博客
月光博客
D
DataBreaches.Net
WordPress大学
WordPress大学
雷峰网
雷峰网
酷 壳 – CoolShell
酷 壳 – CoolShell
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 叶小钗
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
U
Unit 42
Recent Announcements
Recent Announcements
宝玉的分享
宝玉的分享
MyScale Blog
MyScale Blog
C
Check Point Blog
F
Fortinet All Blogs
B
Blog
小众软件
小众软件
Vercel News
Vercel News
罗磊的独立博客
有赞技术团队
有赞技术团队

Show HN

GitHub - astefanutti/shaderbang: Shebang for Shaders Show HN: Generate Claude Code Workflows using Spec Driven Development approach Show HN: AI agents for UK GDAD PCF roles and their skills The Two Pillars: Mixer Mode and Meta-Software in the Reorganization of Software Work After AI GitHub - JaiCode08/teleport-env What 1,000+ Harness Experiments Taught Me About Self-Improving Agents Show HN: Liiists, a Markdown-first, iOS and CLI list app SwiperTab – Get this Extension for 🦊 Firefox (en-US) GitHub - kouhxp/fftext: Summarize, explain, fact-check, or translate any text, URL, or file. No GPU. No cloud. One command GitHub - sweetpad-dev/sweetpad: Develop Swift/iOS projects using VSCode GitHub - dogmaticdev/IRON: IRON a.k.a. Intermediate Representation Object Notation is a Interpreter/Database that is used to create Programming Languages. GitHub - sjhalani7/vaen: Package your AI coding harness into a portable .agent file, and share it across repos, teams, & the community without ever having to copy-paste instructions, skills, MCP config, or secrets. Show HN: Gandalf the Grader Show HN: Citadeld – replay any CI failure locally from a single file GitHub - tdortman/cuSBF: High-Performance GPU Super Bloom Filter coral-ai/claude-code-token-xray at main · Coral-Bricks-AI/coral-ai GitHub - ulyssestenn/funes: Funes is a Git-based framework for LLM-managed knowledge work: an AI Librarian ingests raw sources, builds an interlinked Markdown knowledge base, and uses it to produce cited reports, analyses, and other outputs. GitHub - ThatXliner/gah: Git Add Hunk, built for agents to use GitHub - harmont-dev/harmont-cli: Command-line client for the Harmont CI platform GitHub - brooksmcmillin/mcp-authflow: OAuth 2.0 Authorization Server framework for MCP servers GitHub - javaid-codes/audit-supply-chain-agents GitHub - amorey/gochan: A small library of common channel architectures for Go, inspired by Rust GitHub - arifozgun/OpenGem: Free, Open-Source AI API Gateway with Gemini, OpenAI & Anthropic Compatibility in 1 file GitHub - Pranesh950/BioPetals: 🌸 Run BIOxAI models at home, BitTorrent-style. Fine-tuning and inference up to 10x faster than offloading GitHub - cnguyen14/bounty-doctor: Diagnose a GitHub bounty issue before you waste hours: detects honeypot scam repos, AI-bot attempt swarms, and stale contests. Show HN: CoreMCP – MCP Server for On-Prem DBs Show HN: KittyHTML – Render HTML/CSS as an inline image in your terminal GitHub - bingud/filemat: Web-based file manager Show HN: TruthLens – Free multi-signal deepfake image detector GitHub - apexlocal-jz/claude-usage-tray: Windows system-tray app showing your Claude Code rate-limit usage at a glance. Zero deps, ~300 lines of PowerShell. Cross-IDE (works regardless of VS Code, Cursor, plain terminal).
blog - raspberry-pi-listener
amlucas · 2026-06-23 · via Show HN

Rhythms of a street

June 23, 2026

I bought a Raspberry Pi, a tiny computer that people have used for fun little robotic projects, house automation, game emulators or weather stations. This isn't my first experience with this kind of device: in 2024 I used a toolkit from AMD as part of a robot that moves particles with fluids.

As a computational scientist, I usually see computers as tools for simulation and data analysis. What attracted me here was a different use: turning a computer into an instrument that continuously observes the physical world. I also bought a USB microphone for a few dollars, and wrote a short program to record the noise intensity in my bedroom for about two weeks. Let's see if we find anything interesting.

The root-mean-square sound intensity over 10s and 1h intervals against time, in arbitrary units.

The root-mean-square sound intensity over 10s and 1h intervals against time, in arbitrary units.

The signal is very noisy, partly because of the low-quality microphone, but mostly because the street under my window is a noisy place. Nevertheless, a simple moving average reveals some expected patterns. There are clear peaks in the morning and evenings, corresponding to rush hours, when the traffic is the heaviest. It is also easy to distinguish the nighttime, when it is a lot quieter. The large peak in the night of May 21st corresponds to my AC unit fighting the particular high heat of that day.

We can observe this daily repetition when we look at the autocorrelation of the signal:

There is again a clear peak around 24 hours, although the correlation is relatively weak. (By the way, computing an autocorrelation is very similar to a convolution, which can be done efficiently using FFTs.) The autocorrelation still looks noisy. Let's zoom in:

Surprisingly, among all the apparent noise, we see very clear oscillations. Their period is around 85 seconds. This was actually the time scale I was hoping to find: the traffic light cycle around the block. I measured it on my walk home and the agreement is surprisingly good.

This was the first experiment with my Raspberry Pi. I had no specific questions other than: how noisy is my street when I am not paying attention? Despite the relatively cheap microphone, I found surprisingly rich dynamics at multiple time scales. Right now my Raspberry Pi isn't listening anymore, but I might make it watch soon...

The figures were produced with the following scripts:

Show code
#!/usr/bin/env python

import argparse
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
from matplotlib.lines import Line2D
import numpy as np
import pandas as pd

def main():
    parser = argparse.ArgumentParser()
    parser.add_argument('audio_csv', type=str, help='rms data')
    parser.add_argument('--save', type=str, default=None)
    args = parser.parse_args()

    tz = "America/New_York"

    df = pd.read_csv(args.audio_csv)

    rms_scale = df["rms_mean"].mean()
    df["rms_mean"] /= rms_scale
    df["rms_max"] /= rms_scale
    df["peak_max"] /= rms_scale

    df["time"] = pd.to_datetime(df["interval_start_utc"], utc=True, format='ISO8601').dt.tz_convert(tz)
    df = df.sort_values("time")
    df = df.set_index("time")

    df["rms_30m"] = df["rms_mean"].rolling("30min", center=True).mean()
    df["rms_1h"] = df["rms_mean"].rolling("1h", center=True).mean()

    fig, ax = plt.subplots()

    ax.plot(df.index, df["rms_mean"], '.', ms=0.1, c='C0', label='10s window')
    ax.plot(df.index, df["rms_1h"], '-', lw=1, c='C1', label='1h window')

    ax.xaxis.set_major_locator(mdates.AutoDateLocator())
    ax.xaxis.set_major_formatter(
        mdates.DateFormatter("%b %d")
    )
    plt.setp(
        ax.get_xticklabels(),
        rotation=45,
        ha="right",
    )
    ax.set_ylabel("RMS energy")
    ax.set_ylim(0.0, 5)

    legend_elements = [
        Line2D(
            [0], [0],
            marker='.',
            linestyle='None',
            color='C0',
            markersize=6,
            label='10s window'
        ),
        Line2D(
            [0], [0],
            color='C1',
            lw=1,
            label='1h window'
        ),
    ]

    ax.legend(handles=legend_elements)

    plt.tight_layout()
    if args.save:
        plt.savefig(args.save)
    else:
        plt.show()


if __name__ == '__main__':
    main()
Show code
#!/usr/bin/env python

import argparse
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd


def main():
    parser = argparse.ArgumentParser()
    parser.add_argument("audio_csv", type=str, help="rms data")
    parser.add_argument("--max-lag-hours", type=float, default=24.0)
    parser.add_argument("--minutes", action="store_true", help="show x axis in minutes instead of hours")
    parser.add_argument("--save", type=str, default=None)
    args = parser.parse_args()

    df = pd.read_csv(args.audio_csv)

    df["time"] = pd.to_datetime(df["interval_start_utc"], utc=True, format="ISO8601")
    df = df.sort_values("time").set_index("time")

    x = df["rms_mean"] / df["rms_mean"].mean()

    dt = "10s"
    x = x.resample(dt).mean().interpolate()

    dt_seconds = pd.to_timedelta(dt).total_seconds()
    max_lag_samples = int(args.max_lag_hours * 3600 / dt_seconds)

    y = x.to_numpy()
    y -= y.mean()

    # FFT-based autocorrelation — O(n log n), avoids O(n^2) loop
    n = len(y)
    yf = np.fft.rfft(y, n=2 * n)
    acf = np.fft.irfft(yf * np.conj(yf))[:n].real
    acf /= acf[0]

    acf = acf[:max_lag_samples + 1]
    lags_hours = np.arange(len(acf)) * dt_seconds / 3600

    if args.minutes:
        lags = lags_hours * 60
        max_lag = args.max_lag_hours * 60
        xlabel = "Lag (minutes)"
    else:
        lags = lags_hours
        max_lag = args.max_lag_hours
        xlabel = "Lag (hours)"

    fig, ax = plt.subplots(figsize=(8, 4))

    ax.plot(lags, acf, "-", lw=0.8, c="C0")
    ax.axhline(0, color="k", lw=0.5, ls="--")

    ax.set_xlabel(xlabel)
    ax.set_ylabel("Autocorrelation")
    ax.set_xlim(0, max_lag)

    plt.tight_layout()
    if args.save:
        plt.savefig(args.save)
    else:
        plt.show()


if __name__ == "__main__":
    main()