Frequency Comparison Tool

Compare two audio recordings side by side by their frequency content. Record or upload Sample A and Sample B, then see the overlay spectrum, match percentage (cosine similarity), and a detailed frequency difference breakdown — all processed locally in your browser. No data is ever uploaded.

Frequency Comparison Tool

🔒 Your audio never leaves your device — 100% local processing, zero uploads. Chrome Firefox Safari Edge
🎤 Microphone:
Sensitivity -55 dB
Sample A Not recorded
Duration: — | Bins: —
Sample B Not recorded
Duration: — | Bins: —
A Record A B Record B Enter Compare R Reset E Export CSV C Calibrate F Freeze

How to Use the Frequency Comparison Tool

  1. Select Your Microphone

    Choose your preferred audio input device from the 🎤 Microphone dropdown. You can use a headset mic, built-in mic, or select "Stereo Mix" to capture audio playing through your speakers.

  2. Record or Upload Sample A

    Click "Record A" to capture a 3-second audio snapshot, or use "Upload A" to load an audio file (WAV, MP3, OGG, etc.). The tool will compute the averaged FFT spectrum for Sample A automatically.

  3. Record or Upload Sample B

    Repeat the process for Sample B. This is the audio you want to compare against Sample A. You can record from the same or different source, or upload a different file.

  4. Click "Compare A vs B"

    Once both samples are captured, the Compare button activates. Click it to compute the cosine similarity match percentage, overlay both spectra, generate the difference spectrum, and identify the top 5 biggest frequency differences.

  5. Review Results & Export

    Examine the match percentage, the overlay spectrum (green vs cyan), the difference spectrum, and the frequency delta table. Use "Export CSV" to download the full comparison data for further analysis in spreadsheets.

Understanding Your Results

Match Percentage (Cosine Similarity)

The match percentage uses cosine similarity to measure how closely the two frequency spectra align in shape, regardless of overall volume. A score of 100% means the spectra are identical in shape; 0% means they share no common frequency content. Scores above 90% indicate very similar sounds, while scores below 50% indicate substantially different frequency profiles.

Overlay Spectrum

The overlay visualization plots both spectra on the same canvas — Sample A in green and Sample B in cyan. Where the lines overlap, the frequencies are similar. Where they diverge, you can immediately see which frequencies are stronger in one sample versus the other. The x-axis shows frequency (Hz) and the y-axis shows amplitude in dB.

Difference Spectrum

The difference spectrum shows the bin-by-bin subtraction of Sample A from Sample B. Cyan bars pointing up mean Sample B is louder at that frequency; green bars pointing down mean Sample A is louder. A flat line at zero indicates identical frequency content at that point.

Top 5 Frequency Differences

The delta table identifies the five frequency bins where the two samples differ the most. Each row shows the frequency in Hz, the level in each sample, and the absolute difference (delta) in dB. This quickly pinpoints the most significant spectral changes between A and B.

Summary Statistics

The Average Delta shows the mean difference across all frequency bins. The Max Delta shows the single largest difference. The RMS Difference (root-mean-square) gives an overall measure of spectral divergence — useful for comparing multiple A/B tests consistently.

Technical Background

FFT-Based Spectrum Analysis

Each audio sample is analyzed using the Fast Fourier Transform (FFT) with a window size of 8,192 samples. At a 48 kHz sample rate, this provides approximately 5.86 Hz resolution per bin, covering frequencies up to 24 kHz. The 3-second recording window allows multiple FFT frames to be averaged, reducing noise and producing a stable, representative spectrum.

Spectrum Averaging

Rather than using a single FFT snapshot, the tool computes FFT frames throughout the recording period and averages the magnitude values. This time-averaging approach smooths out transient variations and gives a more accurate picture of the sustained frequency content — particularly important for comparing musical instruments, environmental sounds, or audio equipment.

Cosine Similarity

The match percentage uses cosine similarity, a mathematical measure of the angle between two vectors in high-dimensional space. The two spectra (each with thousands of frequency bins) are treated as vectors, and the cosine of the angle between them is computed. This metric is amplitude-invariant — it measures shape similarity regardless of overall volume, making it ideal for comparing recordings made at different distances or gain settings.

Bin-by-Bin Difference

The difference spectrum subtracts the dB-scale amplitude of each frequency bin in Sample A from the corresponding bin in Sample B. Positive values indicate frequencies that are stronger in B; negative values indicate frequencies stronger in A. The top-5 table sorts these differences by absolute magnitude to highlight the most significant spectral changes.

Frequently Asked Questions

What does the match percentage mean?

The match percentage is based on cosine similarity between the two frequency spectra. A value of 100% means the spectral shapes are identical; 0% means they share no common frequency content. Values above 90% indicate very similar sounds (e.g., the same instrument playing the same note). Values between 50-90% suggest partial similarity (e.g., similar instruments or related sounds). Values below 50% indicate substantially different frequency profiles.

How long are the recordings?

Each recording captures a 3-second snapshot of audio. During this window, multiple FFT frames are computed and averaged to produce a stable, representative spectrum. This duration provides a good balance between capturing enough audio for accurate analysis and keeping the process quick and responsive. You can also upload pre-recorded audio files of any length.

Can I upload audio files instead of recording?

Yes! Click the "Upload A" or "Upload B" button to load audio files in any format your browser supports (typically WAV, MP3, OGG, FLAC, AAC, and WebM). The tool decodes the file using the Web Audio API and computes the averaged FFT spectrum from the entire file, just as it would from a microphone recording. This is perfect for comparing studio recordings, sound effects, or archived audio.

What are the green and cyan colors in the overlay?

Green represents Sample A and cyan represents Sample B. In the overlay spectrum, both are plotted on the same axes so you can visually see where they align and where they differ. In the difference spectrum, cyan bars pointing up mean B is louder at that frequency, while green bars pointing down mean A is louder. This color coding is consistent throughout the tool for clarity.

Does volume affect the match percentage?

No. The match percentage uses cosine similarity, which measures the angle between two spectral vectors regardless of their magnitude. This means two recordings of the same sound at different volumes will still show a high match percentage. The cosine similarity metric is specifically chosen because it is amplitude-invariant, making it robust for real-world comparisons where recording conditions vary.

Is my audio data private?

Your audio is 100% private. All frequency analysis, comparison, and visualization happens entirely in your browser using the Web Audio API. No audio data is ever recorded, stored, or transmitted to any server. The tool works completely offline once loaded — you can even disconnect from the internet and it will continue to function.