jaakkopasanen / AutoEq

Automatic headphone equalization from frequency responses
MIT License
13.52k stars 2.48k forks source link

Same command results in different results in macos/ windows #170

Closed swan11jf closed 4 years ago

swan11jf commented 4 years ago

Here's the windows command:

python autoeq.py --input_dir="measurements\rtings\data\onear\Bose QuietControl 30" --output_dir="my_results/Bose QC30 w/ Grado" --compensation="compensation\harman_over-ear_2018_wo_bass.csv" --sound_signature="results\oratory1990\harman_over-ear_2018\Grado SR60e\Grado SR60e.csv" --equalize --parametric_eq --max_filters=5+5 --ten_band_eq --bass_boost=4 --convolution_eq --fs=44100,48000 --show_plot

Here's the macos command:

python autoeq.py --input_dir="/Applications/AutoEq-master/measurements/rtings/data/onear/Bose QuietControl 30" --output_dir="my_results/Bose QC30 w/ Grado" --compensation="compensation/harman_over-ear_2018_wo_bass.csv" --sound_signature="/Applications/AutoEq-master/results/oratory1990/harman_over-ear_2018/Grado SR60e/Grado SR60e.csv" --equalize --parametric_eq --max_filters=5+5 --ten_band_eq --bass_boost=4 --convolution_eq --fs=44100,48000 --show_plot

Here's the output images:

macos: Bose QuietControl 30

windows: Bose QuietControl 30

rubu commented 4 years ago

Did you notice that the scales differ (the amplitude axis)? Ofc, even with that on windows the error curve ends at above +20 while on macos it does not, but same plot scale would definately help.

swan11jf commented 4 years ago

I'm aware that the scales differ - however, that does not explain why there's a peak at 2000hz at one and not on the other

jaakkopasanen commented 4 years ago

Hey there! The target curves in these pictures are very different. To me it looks like both are pointing to the same compensation file and sound signature file. Do you have the latest master of AutoEQ on both devices? I'm thinking that either one could be older and have different pre-computed results for the Grado SR60e.

swan11jf commented 4 years ago

Thanks - the macos version is two days older than my windows version, which was installed yesterday. Why are the results so drastically different?

Furthermore, after importing these parameteric txts into DDCToolbox (https://github.com/ThePBone/DDCToolbox), the resulting waveforms are drastically different. In particular, is there a way of boosting all the frequencies, as in the latter version, this results in my audio being played very quietly in Viper4Android.

image

image

Many thanks for your help!

jaakkopasanen commented 4 years ago

First thing is to confirm if there is a bug in AutoEq. Could you try to do this same thing on both devices but this time with same sound signature file ie. copy the Grado SR60e.csv from Mac to Windows or vise versa?

swan11jf commented 4 years ago

So I've copied the older version of autoeq onto my windows machine, so there's two versions of autoeq. I still get the disparities between the graphs. Note that the older version of autoeq produces the same output as my mac.

jaakkopasanen commented 4 years ago

Could you still try to copy the SR60e file from old to new and vise versa and then run the equalization on both?

swan11jf commented 4 years ago

Hi, after running equalization, the results are reversed.

jaakkopasanen commented 4 years ago

Using the exact same Grado SR60e file as the sound signature in both?

swan11jf commented 4 years ago

Sorry, I thought you wanted me to swap the two .csvs and run.

With the old .csv copied to the new folder:

newer: Bose QuietControl 30

older: Bose QuietControl 30

the results are very similar, but there's a peak at 8khz from the newer folder which isn't visible on the older one

jaakkopasanen commented 4 years ago

The smoothing algorithm has changed a bit in the high frequencies to follow peaks less closely. So this looks to be in order.

swan11jf commented 4 years ago

Ok, so do you have an explanation to explain the fairly different results when comparing the old and new csv. In particular, with the new csv, is there a way of boosting all of the frequencies, so the distribution of amplitudes has a mean closer to zero?

jaakkopasanen commented 4 years ago

The total level being down so much in the newer one is caused by the 19 kHz filter which has very large bandwidth and a lot of negative gain. It looks to me like the DDC Toolbox and AutoEq are calculating the filters' frequency responses differently near Nyquist frequency. Is there a pre-amp option in DDC Toolbox?

If you're using DDC Toolbox to produce convolution filters for Viper4Android, you could just pick up the WAV files from your results. I believe the WAV files produced by AutoEq should be directly compatible with Viper4Android.

swan11jf commented 4 years ago

Ah, I see thanks for that - in this scenario, I want to mimic the sound of the Grados on my Bose headphones.

Thus, are you saying that:

  1. Apply equalisation on the Bose
  2. Then adding the wav convolution filter of the Grados

would yield similar/ better results? Many thanks for your responses.

jaakkopasanen commented 4 years ago

When you ran your equalization, you got couple of WAV files in your output directory. You should be able to use them with Viper4android as is without having to deal with the parametric eq filters and DDC toolbox. Assuming you want to have eq in Viper4android that makes your Boses sound like Grados.

jaakkopasanen commented 4 years ago

I may have found a bug. Could you run this on both Mac and Windows and attach the graphs here:

python autoeq.py --input_dir="results/oratory1990/harman_over-ear_2018/Grado SR60e" --output_dir="my_results/Grado SR60e graphs"
swan11jf commented 4 years ago

Sure: macos: Grado SR60e

windows: Grado SR60e

When comparing the effect of the convolution filters with the DDC filters, I notice that the convolution filters result in the sound being more muffled - is this just a product of how these filters work, or should they sound fairly similar?

jaakkopasanen commented 4 years ago

I know now what happened. I fixed fixed band eq curve handling in CSV writes but forgot to add it to CSV reads. This caused the newest results to have fixed band eq curves in the CSV files but the CSV reader stopped matching to these files because it didn't expect them to have the fixed band eq data. The result was that the newest results read with this code only read frequency data and raw frequency response.

Sound signature looks at error curve in the CSV if exists and raw curve if error curve doesn't. So I believe in this case your older local copy didn't include the newest results (with fixed band eq data) and therefore read the error curve correctly while the newer local copy had the newest results and therefor only read the raw data. This lead to sound signature using error curve in the older local copy and raw curve in the newer local copy. This explains why the two target curves were so drastically different.

I made the fix for this bug just now. Please get the latest AutoEq version to both Mac and Windows and try running your equalization again. You should get exactly the same results now.

jaakkopasanen commented 4 years ago

WAV files produced by AutoEq have pre-amp built in and it looks like the DDC Toolbox might not do this. So I guess you're not doing these comparisons with matched levels. This would explain the sonic differences in the two. Try both with exactly the same level and they should be very, very similar sounding.

swan11jf commented 4 years ago

Fantastic - the new version does indeed seem to be working, and when comparing the convolver and DDC filters, they do indeed sound similar after some adjustments of the volume. Thanks for your time and effort.

jaakkopasanen commented 4 years ago

Great! Thanks a lot for reporting this, I would have not found this on my own.