+
Skip to content

Tool that extracts Electric Network Frequency (ENF) fluctuations from audio/video recordings. Useful for authentication, geolocation, and temporal verification of digital evidence. Grid reference not included.

Notifications You must be signed in to change notification settings

josuenadal/ENF-extractor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ENF Extractor

Extract Electric Network Frequency (ENF) from an audio/video file as CSV for analysis.

The clip shows ENF from a recording of motors found at the 120Hz harmonic in the audio of a youtube video.

ENF Reference not included.

Table of Contents

Features

  • Extract ENF signals from audio/video files
  • Visual spectrogram analysis
  • Adjustable FFT parameters via interactive sliders
  • Target frequency filtering
  • Segmented processing for large files
  • CSV export functionality

Installation

git clone [repository-url]
cd enf-extractor
pip install -r requirements.txt

Usage

Basic Usage

python enf_extractor.py "path/to/your/file.mp3"

Command Line Options

Flag Description Type
-f Target frequency to filter and center on plot. -f 120
-s Time interval (in seconds) to plot at once -s 100

Interface Guide

Spectrogram View

Initial Spectrogram

If you pass in a video, the tool will automatically extract audio (saved to ./audio/) and display the spectrogram.

Image

American ENF signals appear at:

  • 60Hz (fundamental frequency)
  • 120Hz (first harmonic)
  • 180Hz (second harmonic)
Slider Controls

The interactive sliders adjust spectrogram parameters for optimal ENF extraction. Check out my working explanation:

Slider Description
NFFT The NFFT is the number of points used in each block for the FFT. This can control frequency definition vertically. The larger the block the better the time component (how the frequency changes), the smaller it is the better the frequency component (what frequencies exist in that block). The default value of 4096 is good for our application.
n_overlap The n_overlap is the number of points to overlap between these blocks. The closer to NFFT the more time points, but it cannot be larger than NFFT-1.
pad_to The pad_to slider controls the length of the transformed axis of the output. If its smaller than the length of the input the output gets cropped, if its larget it gets padded. This can increase the amount of vertical points.
vmin_vmax Defines the range of the colormap. Use it to highlight specific levels you want to see.

For a detailed explanation, watch this FFT Parameters Tutorial on youtube.

Plotting Features

Target Frequency Mode:

python enf_extractor.py "./Calming & Relaxing 60 Cycle Hum.mp3" -f 120

Note that the plot has been centered on the frequency passed in through the -f flag and the signal has also been filtered to +-1Hz of that frequency.

Image

Segmented Processing: Handle large files in sections

python enf_extractor.py "./Calming & Relaxing 60 Cycle Hum.mp3" -f 120 -s 100

Note that the signal length has been reduced to about 100 seconds.

Image

When you press the Plot All button the view will split showing the current segment at the top and the total ENF graph at the bottom.

Image

Saving Results

Click "Save ENF plot" to export data as a CSV file:

Image

Technical Notes

  • ENF is not always present in a recording.
  • All recordings have a quality limit you can't pass no matter how much you tweak the spectrogram. (No "Enhance")
    • Some audio recordings are compressed, you will know because compression artifacts usually appear as horizontal lines in the ENF.
  • The signal is downsampled to 420Hz, which limits the amount of frequencies you can view. (Nyquist Frequency)
  • Memory requirements increase really fast with file size and FFT parameters.

References (you can find them online easily):

Grigoras, C. (2005). Digital audio recording analysis: the Electric Network Frequency (ENF) Criterion. International Journal of Speech, Language and the Law, 12(1), 63-76. https://doi.org/10.1558/sll.2005.12.1.63

Jr, Ojowu, & Karlsson, Johan & Li, Jian & Liu, Yilu. (2012). ENF Extraction From Digital Recordings Using Adaptive Techniques and Frequency Tracking. IEEE Transactions on Information Forensics and Security. 7. 1330-1338. https://doi.org/10.1109/TIFS.2012.2197391

About

Tool that extracts Electric Network Frequency (ENF) fluctuations from audio/video recordings. Useful for authentication, geolocation, and temporal verification of digital evidence. Grid reference not included.

Topics

Resources

Stars

Watchers

Forks

Languages

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载