Git Product home page Git Product logo

autoeq's Introduction

AutoEq

AutoEq is a tool for automatically equalizing headphones.

Go to autoeq.app to get started.

This Github repository now mainly serves developers. The contributions of this project are:

  • Web application for easily equalize and tweak headphone frequency responses without needing to install anything
  • Library for working with (headphone) frequency responses and optimizing parametric equalizers
  • PyPi package for installing the library on your projects
  • Collection of headphone measurements as numerical data from oratory1990, crinacle, Innerfidelity, Rtings and legacy headphone.com measurements (which are not the same as what the company produces today).
  • Collection of different headphone frequency response targets as numerical data
  • Pre-computed equalizer settings in results, although these should not be used by normal users since autoeq.app exists

Sennheiser HD 800

Sennheiser HD 800 equalization results plotted

Updates

2023-10-29 AutoEq version 4.0.0. Improved and unified naming conventions across the project. Cleaned up obsolete files and reorganized directory structure. Completely reworked database management tools.

2022-05-14 Web application. Reorganized measurements and results.

2022-10-30 Restructured the project and published in PyPi. Source code moved under autoeq directory and command line usage changed from python autoeq.py to python -m autoeq with underscores _ replaced with hyphens - in the parameter names.

2022-09-18 Parametric eq optimizer reworked. The new optimizer supports shelf filters, has a powerful configuration system, run 10x faster, has limits for Fc, Q and gain value ranges and treats +10 kHz range as average value instead of trying to fix it precisely.

Usage

AutoEq produces settings for basically all types of equalizer apps but does not do the equalization itself. You'll need a different app for that. Go to autoeq.app and select your equalizer app of choice. Quick instructions for importing the produced settings will be shown there.

Command Line Use

In addition to the web application, AutoEq can be used from command line (terminal). This is advanced use mainly intended for developers. The following instructions apply for command line and Python interface use.

Installing

  • Download and install Git: https://git-scm.com/downloads. When installing Git on Windows, use Windows SSL verification instead of Open SSL or you might run into problems when installing project dependencies.
  • Download and install 64-bit Python 3. Make sure to check Add Python 3.X to PATH.
  • You may need to install libsndfile if you're having problems with soundfile when installing and/or running AutoEq.
  • On Linux you may need to install Python dev packages
sudo apt install python3-dev python3-pip python3-venv
git clone https://github.com/jaakkopasanen/AutoEq.git
  • Go to AutoEq location
cd AutoEq
  • Create a python virtual environment
python -m venv venv
  • Activate virtualenv
# On Windows
venv\Scripts\activate.bat
# On Linux and Mac
. venv/bin/activate
  • Update pip
python -m pip install -U pip
  • Install required packages
python -m pip install -U -e .
  • Verify installation. If everything went well, you'll see the list of command line parameters AutoEq accepts.
python -m autoeq --help
python -m autoeq --input-file="measurements/oratory1990/data/over-ear/Sennheiser HD 800.csv" --output-dir="my_results" --target="targets/harman_over-ear_2018_wo_bass.csv" --max-gain=24 --parametric-eq --parametric-eq-config=4_PEAKING_WITH_LOW_SHELF,4_PEAKING_WITH_HIGH_SHELF --bass-boost=6 --convolution-eq --fs=48000 --bit-depth=32 --f-res=16

When coming back at a later time you'll only need to activate virtual environment again

# On Windows
cd AutoEq
venv\Scripts\activate.bat
# On Linux and Mac
cd AutoEq
. venv/bin/activate

To learn more about virtual environments, read Python' venv documentation.

Updating

AutoEq is in active development and gets new measurements, results and features all the time. You can get the latest version from git

git pull

Dependencies may change from time to time, you can update to the latest with

python -m pip install -U -e .

Checking Installation

This prints out CLI parameters if installation was successful.

python -m autoeq --help

Example

Equalizing Sennheiser HD 650 and saving results to my_results/:

python -m autoeq --input-file="measurements/oratory1990/data/over-ear/Sennheiser HD 650.csv" --output-dir="my_results" --target="targets/harman_over-ear_2018.csv" --convolution-eq --parametric-eq --ten-band-eq --fs=44100,48000

Building

Add changelog entry before building and update version number in pyproject.toml!

Install build and twine

python -m pip install build twine

Add updates to autoeq/README.md before building!

Build PyPi package on Windows

copy /y README.md README.md.bak && copy /y autoeq\README.md README.md && python -m build && copy /y README.md.bak README.md && del README.md.bak

Build PyPi package on Linux / MacOS

cp README.md README.md.bak && cp autoeq/README.md README.md && python -m build && cp README.md.bak README.md && rm README.md.bak

publish

python -m twine upload dist/autoeq-<VERSION>*

Remember to add Git tag!

Contact

Issues are the way to go if you are experiencing problems or have ideas or feature requests. Issues are not the correct channel for headphone requests because this project sources the measurements from other databases and a headphone missing from AutoEq means it has not been measured by any of the supported sources.

You can find me in Reddit, Audio Science Review and Head-fi if you just want to say hello.

autoeq's People

Contributors

avilad avatar bhack avatar cobaltspace avatar decadent avatar dmitrykos avatar douglascamata avatar gauthierplm avatar hyperknot avatar jaakkoai avatar jaakkopasanen avatar jrc2139 avatar kquote03 avatar m0rf30 avatar maxbachmann avatar nodeful avatar oscardev avatar tiefseetauchner avatar zian avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

autoeq's Issues

Preference Model Based Filter Optimization

Currently filters are optimized with loss function that only takes the average deviation into account. While this works alright for cases where there are plenty of parametric eq filters available less flexible systems are not necessarily optimized well.

Prime example of this is Sennheiser HD 800 with standard 10-band equalizer. The main problem of HD 800 is it's 6 kHz peak which happens to fall right in the middle of 4 kHz and 8 kHz filters. Simple filter optimization cannot reduce gain on 4 kHz and 8 kHz filters because that would affect other frequencies as well. However not all deviations from target curve are equal. A peak in treble is perceived to have greater negative effect than having a similar notch.

HD 800

Ideally filter optimization would be based on preference model like the one developed by Sean Olive and others for their 2018 Harman over-ear target curve. This is obviously only defined for Harman target compatible measurement systems but probably would be significant improvement over current simple model on other measurements as well if the chosen target curve is assumed to represent neutral.

Sloved: About the calibration argument alternative

The running command:

python .\frequency_response.py --input_dir="C:\AutoEq-master\innerfidelity\data\onear\Audio Technica ATH-M50x" --output_dir="myresults\m50x_simulate_razer_kraken" --compensation="C:\AutoEq-master\rtings\data\onear\Razer Kraken Pro V2\Razer Kraken Pro V2.csv" --calibration="calibration\innerfidelity_to_rtings.csv" --equalize --max_gain 24.0 --treble_max_gain 24.0

The console output:

frequency_response.py: error: unrecognized arguments: --calibration=calibration\innerfidelity_to_rtings.csv
usage: frequency_response.py [-h] --input_dir INPUT_DIR
                             [--output_dir OUTPUT_DIR] [--standardize_input]
                             [--new_only] [--compensation COMPENSATION]
                             [--equalize] [--parametric_eq] [--fixed_band_eq]
                             [--fc FC] [--q Q] [--ten_band_eq]
                             [--max_filters MAX_FILTERS] [--fs FS]
                             [--bit_depth BIT_DEPTH] [--phase PHASE]
                             [--f_res F_RES] [--bass_boost BASS_BOOST]
                             [--iem_bass_boost IEM_BASS_BOOST] [--tilt TILT]
                             [--sound_signature SOUND_SIGNATURE]
                             [--max_gain MAX_GAIN]
                             [--treble_f_lower TREBLE_F_LOWER]
                             [--treble_f_upper TREBLE_F_UPPER]
                             [--treble_max_gain TREBLE_MAX_GAIN]
                             [--treble_gain_k TREBLE_GAIN_K] [--show_plot]

[IRS issue] Impulse file is mono with 64bit resolution

Hi,
I've tested the irs file generated for AKG Y50 and is invalid. This is the report of mediainfo on repo wav file

General
Complete name                            : AKG Y50 48000Hz.wav
Format                                   : Wave
File size                                : 375 KiB
Duration                                 : 1 s 0 ms
Overall bit rate mode                    : Constant
Overall bit rate                         : 3 072 kb/s

Audio
Format                                   : PCM
Format profile                           : Float
Codec ID                                 : 3
Codec ID/Hint                            : IEEE 
Duration                                 : 1 s 0 ms
Bit rate mode                            : Constant
Bit rate                                 : 3 072 kb/s
Channel(s)                               : 1 channel
Sampling rate                            : 48.0 kHz
Bit depth                                : 64 bits
Stream size                              : 375 KiB (100%)

I've converted the file to 32bit, stereo and seems to work on PulseEffects and Viper4Android

Crinacle's IEM Measurements

Crinacle has measured several hundreds of IEMs with measurement system which is compatible with Harman targets. He is going to publish the raw data at some point so there won't be need to create image graph parser for them.

  1. Create a script for transforming crinacle's raw data into AutoEQ style CSVs.
  2. Create script to download measurements from the shared location (probably Drive or Dropbox)
  3. Add all the measurements and fix any conflicting naming conventions
  4. Process results for all the measurements
  5. Update recommendations, full index and add note to documentation
  6. Remove Crinacle's measurements from oratory1990 data folder

KZ AS-10 ParametricEQ Does not work on Viper4Android unless i remove 22050 Hz

If i apply the EQ as a whole, it will be silent
If i remove 22050 Hz which i find to be the issue, the sound came back on. Not sure what the issue...

Last time you requested me to test it but i only tested it on desktop which it work but i should have tested it on Viper4Android which i didn't >_<

I'm pretty sure it's just Viper4Android issue on 44.1 mode but when i reduce the hz to 22043 it miracle work again.

[Request] Reference-audio-analyzer.pro parameters processing and AKG Y50

Hi,
In the past days I've submitted a PR for reference-audio-analyzer.pro, a russian website that does something similar to the most popular innerfidelity. I'm very excited about this project and I wish you can take a look to this request. Obviously if you accept this, I'll keep myself available for any debug purpose.
Regards and thanks for AutoEQ

Mac support?

Hello,

First of all, thanks for such a fantastic work! It looks really impressive.
Unfortunately, i don't have windows at all :( I think that wine or macports will not work with any of provided solution.
Do you know any software that i can use on Mac?

Thanks!

Guide for WebPlotDigitizer

Write a simple user guide how to use WebPlotDigitizer to parse frequency response graph images and processing the output with AutoEQ. This will serve as a de facto way for supporting all the other measurements which are not included in the supported databases.

array error

I am stuck with the following array error after removing duplicate entries.
image

Installation problem

What a great project! However, current installation script does not work. (Python 3.6.6, Win10-64)

tensorflow 1.10.0 has requirement numpy<=1.14.5,>=1.13.3, but you'll have numpy 1.15.2 which is incompatible.
tensorflow 1.10.0 has requirement setuptools<=39.1.0, but you'll have setuptools 40.4.3 which is incompatible.

GiveUp: Preamp support

In the early version (near 1/29/2019),
the following command generated result folder will contain Preamp value in README.MD,
like:

python .\frequency_response.py --input_dir="%inputDir%" --output_dir="%outputDir%" --compensation="%compensationFile%" --equalize --show_plot --max_gain %MAX_GAIN% --treble_max_gain %TREBLE_MAX_GAIN%
...
### EqualizerAPO
In case of using EqualizerAPO without any GUI, replace `C:\Program Files\EqualizerAPO\config\config.txt`
with:

Preamp: -12.3dB
GraphicEQ: 21 0.0; 23 6.2; 25 5.8; 28
...

With this version, the generated result will not have "Normalize response".
And in new version, the generated result have "Normalize response" by default,
and not a preset Preamp value out there anymore.

I think this is relatively bad idea,
because you can imagine, a user across those command line commands,
and finally generated his exciting eq settings,
hi might be click on the power button at the left of the GraphicEQ,
to switch the GraphicEQ on and off to try to hear the difference between the two status.
By default Autoeq have a 6db limit,
for some reason we can release the limit,
in this case, the switch action will result in a maximum to the release value(e.g 24 db)
volume level difference.
This have a risk to damage hearing.
The early version, with Preamp still on,
simply switch GraphicEQ off will not get the volume level change,
so it's much more safe than "Normalize response".

I understand that maybe a unknown reason to do the change,
but can we add a argument to use old method to provide result?
That would be handy.

KZ ZSN EQ Settings

Please measure KZ ZSN graph as this graph is hard to find on the Internet, so please add it on this list... Thanks!

Reference Audio Analyzer Measurements

Reference Audio Analyzer has several hundred of measurements for all kinds of headphones and therefore would be valuable addition to this collection. They have several different measurement systems and have not published (to my knowledge) the compensation curves. All of their graphs are compensated. Therefore it's better and simpler to take the compensated data as is and use zeros as the target curve. These will be the lowest priority for recommendation among all databases.

  1. Create script for crawling links to graph images
  2. Create image graph parser
  3. Download all measurements and fix potential conflicting naming conventions
  4. Process images and check that all were parsed correctly
  5. Process results for all Reference Audio Analyzer measurements
  6. Update recommendations, full index and add a note to documentation

Fork as Code Only Repository

AutoEQ contains a lot of useful algorithms for equalization and other signal processing tasks. However because the repository also contains raw data and results there are thousands upon thousands of files which are not needed when importing these algorithms for other projects.

A new repository should be made which has only the code files and nothing else. Also setup file for installing with pip should be added and the package published in pip index. The new repository should have data, results and other irrelevant folders in gitignore to avoid pulling data files added to this repository later because the code only repository will follow this repository by frequent syncs.

Sub 20 Hz Problems with FIR Filters

FIR filters do all sorts of bad things because they interpolate the frequency response with linear sampling starting from zero but the original data never contains sub 20 Hz so the interpolation does wild guesses. These wild guesses cause problems with the FIR filters.

Fix all sub 20 Hz gains to 20 Hz value before interpolation to fix this.

USound target

Can you add the USound target for an alternative for oratory1990's in-ear measurements?

Add ZSN from Rtings and other target curves

Hi!

Can you please add KZ ZSN measurement from Rtings.com? It was added about a week ago, and I don't have a working PC to use your app. Also, can you add other target curves as well on measurements (Rtings, Innerfidelity, RAA etc.) like usound and Harman IE17.

Thanks in advance!

Question about oratory1990 parser

I've been looking into some oratory1990 measurements, and have found an offset between the graphs I'm looking at and the parsed CSV data. For example, looking at Campfire Audio Andromeda measurement, the raw values should be approximately these:

20Hz: -9dB
30Hz: -7.8dB
100Hz: +3dB
1kHz: -1.4dB

The CSV for the measurements has this instead:

20,2.45
30,3.78
100,4.49
1001,0.00

But when I look at rendered raw response charts, their shapes look pretty close to the ones oratory1990 published. Looks like things are normalized around 1kHz somehow? What is happening here?

Repository size

Huge. Why not keep the pregenerated presets in a different repository or elsewhere?

Why are there two different measurements for Audio-Technica ATH-M40x and Audio-Technica ATH-M70x?

AutoEQ won't accept q values

After inputting frequences and q values for a fixed band preset within venv an error is returned:
ValueError: Initializer type '<dtype: 'float64'>' and explicit dtype 'float32' don't match.

I'm unable to get around the issue and unable to generate a fixed band preset for my headphones.

KZ earbuds

Any chance we could get profiles for the budget KZ ZST, ZS3, ZS5, etc.? Thanks!

Center Data by Error Average

In some rare cases headphone frequency response has a notch or spike in 1 kHz creating a DC bias to entire graph because data is centered by 1 kHz. More robust way is to center the data by error average value in range 100 Hz to 10 kHz. This means that either raw data or target should be adjusted with the same bias or error won't match difference between raw and target.

Use ax in plot_graph()

Currently plot_graph() plots always to the currently active figure and axis although figure and axis can be passed as parameters. Change all plt calls to ax and fig. Fix figure closing.

EQ for AKG K271 Studio (MK I)

Any chance we'll see an EQ for that model? The Mark II is already there but they have a different frequency response than the AKG K271 Studio Mark I headphones.

shorter impulse responses?

Since impulse responses introduce an unavoidable delay during real-time processing, this additional lag in the system could potentially make issues like AV sync in videos or audio lag in games more noticeable.

Currently, impulse responses are ~100 ms at ~5000 samples. An option to adjust the length of impulse responses to ~1024-2048 samples should reduce delay as well as CPU usage without reducing frequency resolution too much (down to 20 Hz?). Truncated impulse responses would also preferably be multiplied by a window function in the time domain to reduce aliasing.

Sound Signature Target

AutoEQ is written completely on the assumption that everyone likes neutral the most of all possible sound signatures. While Harman target is preferred by most people there still is significant number of users who would like to have different sound signature. For example V-shaped curve is preferred by some because it sound more "fun". Currently there is no good way of playing around with different sound signatures. Technically it is possible to craft personalized compensation curves but very few people have skills to do this and one would have to create curve for each measurement system separately.

One way of achieving different sound signatures across all measurement systems would be to have a parameter for sound signature target. This would still utilize the compensation curve already provided as an anchor for neutral but modify the target on top of that. This would also make it quite easy to equalize a pair of headphones to sound like another pair by setting the sound signature target to the other headphone's result CSV file.

Sound signature target parameter value is a file path to a CSV file which can be understood by AutoEQ. The CSV file can be a simple one where there is only frequencies and raw data or be a AutoEQ result file where there is an error column as well. If the file has an error column, that is used and raw column is used otherwise.

Things that are needed to support this:

  • sound_signature parameter to CLI arguments and main function
  • Data read from the file using raw or error
  • Target curve modification based on the given signature
  • Instructions on Equalization section of documentation

Solved: How to generate results folder but different argument

I have a headphone data, and in results\rtings\avg there's a result.
I did a manual generate and by different argument, use "rtings_compensation_avg.csv"
but I got a different curve than the results\rings\avg one.

The reason I try again is I modify the argument to release the 6.0 db limit.

python .\frequency_response.py --input_dir="%inputDir%" --output_dir="%outputDir%" --compensation="%compensationFile%" --equalize --show_plot --max_gain %MAX_GAIN% --treble_max_gain %TREBLE_MAX_GAIN%

Minimum Phase Impulse Response Has Frequency Shift

Minimum phase impulse response created from biquad filters shifts all frequencies up by about 10%. With HiFiMAN HE400S the 5.5 kHz boost moves to 6 kHz. Other that that the curve shape seems correct.

Minimum Phase Impulse Responses were added because the existing linear phase impulse responses introduce pre-ringing and delay to the signal. Generally minimum phase filters are more suitable for equalizing when listening to music.

Error with frequency_response.py

I own an Onkyo A800 headphone and it doesn't being supported by AutoEQ. So I made a CSV file using WebPlotDigitizer, plotting the graph based on the frequency response I got from here. I made a header row consisting frequency,raw in said CSV file (pastebin link here), then put it into a new folder called onkyo inside the AutoEQ folder. I set up everything and I can't seem to make it work. I use the following line:

python frequency_response.py --input_dir="onkyo" --compensation="headphonecom\resources\headphonecom_compensation_sbaf-serious.csv" --equalize --show_plot

And it then shows the following error:

Traceback (most recent call last):
File "frequency_response.py", line 1482, in
FrequencyResponse.main(**FrequencyResponse.cli_args())
File "frequency_response.py", line 1435, in main
treble_gain_k=treble_gain_k
File "frequency_response.py", line 1299, in process
self.interpolate()
File "frequency_response.py", line 765, in interpolate
interpolator = InterpolatedUnivariateSpline(np.log10(self.frequency), self.raw, k=pol_order)
File "D:\AutoEq-master\venv\lib\site-packages\scipy\interpolate\fitpack2.py", line 601, in init
raise ValueError('x must be strictly increasing')
ValueError: x must be strictly increasing

What did I do wrong here?

I use Python 3.6.8.

Avoid Narrow Spikes in Treble Range

Narrow notches in treble range are not very noticeable for human hearing and equalizing those notches to target response will very often create issues with sibilance or harshness. Generally it better to avoid doing anything with them. However it is still unclear what is the limit for width of the notch that should be avoided, what is the smallest frequency which should be considered treble range for this and if it would be better to have a smooth transition zone for both of these where positive gain is limited but not entirely avoided.

Massdrop AKG K7XX parametric EQ error

The 5th filter currently appears as :
29532 Hz | 3.16 | -4.4 dB
This causes Peace to instantly make a loud distorted sound which gets caught by the clipping filter until the pre amp hits -30 dB.
Based on the graphic EQ settings I assume the frequency was supposed to be 19532: changing it to this, or to anything under 20k, resolves the issue.

Typo in crinacle's PP8 results

All 4 variations of the results (with/without bass/treble switches) for both targets, are named PhoPhile-8 instead of ProPhile-8.

The names.txt file uses the correct name.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.