Extracting InnerFidelity Data to Create Convolution Filters
Dec 20, 2016 at 10:54 AM Thread Starter Post #1 of 19

prescient

Head-Fier
Joined
Oct 31, 2006
Posts
73
Likes
41
I thought it would be interesting to get some feedback on my thought process for creating REW convolution filters for headphones. Feel free to tell me the whole idea is nonsense as I'm no audio expert!
 
Anyway, as many folks have noticed headphones have terrible FR response, and I've been thinking about how to create convolution filters to EQ my headphones. The problem obviously is that it is expensive to acquire the data, and I'm not willing to spend $8k on a measurement head. I've tried creating my own measurement setup for IEMs (http://www.head-fi.org/t/829104/drc-dsp-for-iems), and I think the results were an improvement. Unfortunately my measurement technique does not translate well to full size headphones. 
 
So what is a poor guy with no test measurement gear to do? My thought is that I can use the graphs on InnerFidelity and image processing to extract the data I need. Then I can then load the data into REW to create convolution filters.
 
Step 1: Get the graph from InnerFidelity.
 
Below is the InnerFidelity frequency response graph of my beloved and now 10 year old HD580s. These headphones are amazing. They cost $120 when I bought them new, still sound great, and look brand new with updated velour pads. However, as seen in the graph the headphones lack bass and have a high frequency roll-off with a spike around 9K. The information is great, but without a data file to load into REW there isn't much I can do to correct the issues (besides playing with a parametric EQ). So we need to get the data!
 

 
Step 2: Extract the data from the graph
 
 The data we want to extract from the graph are the red or blue frequency response lines. The red and blue lines represent the Harman target curve compensated and averaged frequency responses for the headphone. If the headphones were to measure perfectly the frequency response would be a flat line. To extract the data we can use the WebPlotDigitizer (http://arohatgi.info/WebPlotDigitizer/). The WebPlotDigitizer is a great tool made by Ankit Rohatgi, that allows you to load an image and extract data from that image using image processing techniques. The tool even supports extracting a log x-axis. After we use the tool we end up with a graph like the one shown below where each point is a data point identified from the graph.
 

Once we have identified the data points to extract we can export a CSV file that can be loaded into Room EQ Wizard.
 
Step 3: Check the Data
 
The data that comes out of the WebPlotDigitizer while great needs a little cleanup before processing in REW. REW expects a file where each frequency is larger than the next so the first step is to remove any frequency values that aren't greater than the preceding values.  Once the import is done we should have a graph that looks a bit like the below, and matches the InnerFidelity graph.
 
 

 
 
Step 4: Create Convolution Filters
 
This step is pretty easy. All we need to do is go into REW's EQ view:
- Set rise slope to 0
- Set fall slope to 0
- Set target level DB (For the HD 580's I set it to -8 as there is such a huge amount of variance across the FR)
 
For the HD 580s I'm not sure there is much we can do for frequencies over 11K. They just drop off too quickly for them to be reasonably fixed. After that we can export as a WAV file and load into our convolver of choice. 
 

 
Overall this might be a bit of a fools errand given the erratic behavior of headphones above 10k, but I've found the process to be interesting and I've learned about some new tools. I'd love to hear what others think or whether there is a better way to go about this.
 
Dec 20, 2016 at 1:03 PM Post #2 of 19
webplotdigitizer seems super cool. when I try to copy a curve I usually get a picture and use "peek through", really old stuff that works up to win7 that I used when I tried to learn how to draw with a wacom(emphasis on the try). it lets me set the transparency in REW or my EQ while the graph I copy is in the background. when I had like you suggest no mean at all to make measurements, I would use virtual audio cable to include my EQ in REW internal loop, just so that I could get the starting curve more or less in the shape I liked. poor guys have to be creative.
 
I got used to that over the years, but the plot digitizer feels like the future is coming to me ^_^. just tried it and it allows to specify if it's a log scale \o/  TBH it's really what scared me before I tried it and watched the tuto video.
ok I'm getting exited about the wrong thing here, sorry
tongue.gif
.
 
 
when I tried over the years to do something along the lines of what you did, my personal problems were:
1/ how do I know that my pair of headphone/IEM actually measures the same as the pair Tyll measured? it's something you start to wonder only after you've measured some yourself IMO.
 
2/ here you just assume that flat on Tyll's graph is flat, but in your other post you tackle the problem and try to aim at harman's target. still in both cases, we can only assume that we'll be fine with an average target.  and in my very subjective case, I clearly need a few changes(I'm overly sensitive to 4khz and 10khz for example) and more generally I found myself in between diffuse field and harman(harman sounds just lovely, but not exactly my neutral). so I end up using an EQ by ear anyway at the end of the process.
 
3/ I'm with you about not trying to use that method for the upper trebles, for plenty of reasons. I tend to stop at 8khz and do up to 12 by ear. the rest I lower stuff that are too much and leave the rest as it is. 
I also do the subs by ear instead of following the measurements. Tyll tends to average several measurements at different positions on the dummy head(except on IEMs), so some positions are bound to leak more than others and I find that his curve falls more than what I'm hearing. also I find that in general the attempt at compensating for the lack of tactile sub is a subjective thing and I just go for what I like most.  but from bass to upper medium, it's certainly a nice way to get a more even response IMO.
 
4/ if we stay in the context of not having any mean to measure the result, I would add a warning for when something would require many db of compensation, even more so if it's to compensate a roll off at on end of the frequency response. because distortions could become pretty loud in some cases, and EQ won't fix the problem in others. so I'd try different values at frequencies where a lot needs to be EQed and decide by ear if it doesn't sound weird(as we're limited to that in this case).
 
 
ps: I felt like your explanation was very clear(I dream of being able to explain things like that), I tried for the lolz and all went smoothly indeed. but then again I already know REW.  I'd be curious to know if someone brave enough would try without any experience in REW and tell us how the all process went.
I remember someone a few years back had done something for equalizer apo where you could insert a picture in the background and invert it to create the EQ. I couldn't find the topic with my lame search skills, but it was a more basic way of following the same idea.
 
Dec 20, 2016 at 1:26 PM Post #3 of 19
I appreciate the response and think you raise a number of good points.

On point #1 I make the foolhardy assumption that Tyll's measurements aren't way off. While there can and will be variation from headphone to headphone I've noticed that the variation doesn't look to be substantial. For example when I compare his LCD-3 Fazor measurements the problem areas look to persist from headphone to headphone. The other thing I've noticed is that through the range we should care about the most (1k-6k) headphone measurements seem to be relatively consistent. Anyway we can always use some EQ to perform final fine tuning after running through the convolver as you suggest. For example, I have my 580's a bump in treble above 10K.

On point #2 if we get Tyll's graph to measure flat it should actually measure as if it is the Harman curve. My understand is that as a result of his compensation process a headphone that measures perfectly flat in his compensated curve would actually have the response of the Harman curve.

All in all, I think my adjustments via the convolution filters sound closer to what the recording should sound like. I went through a few test tracks and they seem pretty spot on. The other thing I keep doing is listening to piano tracks and mentally comparing them to when my SO plays the piano. The FR without equalization just sounds wrong compared to the piano in our house. It feels like too much mid bass obscures the key strokes(?). Probably not a great explanation and I'm not sure if I'm the only one that feels this way.

That said I find it really strange that headphone manufacturers aren't focusing on using DSP to improve headphone response and instead dumping money into marginally better and better drivers. This is doubly true when we consider that future headphones will probably be wireless with DACs/DSP built in for signal processing.
 
Dec 20, 2016 at 1:57 PM Post #4 of 19
I've tried using a high or low shelf filter to help even out the upper treble in REW's EQ settings; ymmv. Good work! About as much as you can do without having to get measured in a "flat" room.
 
Dec 20, 2016 at 2:16 PM Post #5 of 19
If you look at the final EQ from this process it doesn't look much different than having a few high or low shelf filters.
 

 
What I think would be cool is to have community developed convolution filters for a number of different headphones that people could use to plug & play (maybe Flat and Bass EQs). Sonarworks has something similar, but I'd rather not send them my LCD-3's for measurement.
 
Dec 20, 2016 at 2:22 PM Post #6 of 19
  If you look at the final EQ from this process it doesn't look much different than having a few high or low shelf filters.
 

 
What I think would be cool is to have community developed convolution filters for a number of different headphones that people could use to plug & play (maybe Flat and Bass EQs). Sonarworks has something similar, but I'd rather not send them my LCD-3's for measurement.

 
Yeah, there's a hodgepodge of "My EQ settings for X headphone" threads; having a central repository for "starter" EQs would be great. In theory you could automate all this without REW by feeding the FR data into a program that made an inverse minimum phase filter.
 
edit: can you post the data from the digitizer?
 
Dec 20, 2016 at 2:34 PM Post #7 of 19
on #2, the compensated curve is a diffuse field compensation. compared to harman it's really close in overall shape(except the bass) but tilted to be warmer for harman. and if you go find within the few times Tyll mentioned the harman target in the blog, there is one time where he explains how he kind of made up his own harman target for the examples that followed because the actual harman curve just sounded weird if strictly applied to his measurement.
with some of the measurements he did going at harman with his dummy head, I guess we should be able to get a more fitting diffuse field target in relation to the room at harman's and as a direct consequence a better relation with the harman target of preferred FR(as that's what they went for with that curve). but I'd need to steal all his data, and then grow another brain to get how to interpret it all ^_^.
 
 
about DSP, I have a pair of xtz divine(and a review that I should have finished like a year ago... worst reviewer ever!), it's a BT headphone that uses an app and most likely convolution to get a better response. so basically a standard BT headphone+an app that included a preset convolutions. nothing extraordinary at a technical level.  the result is still what you'd expect from a cheap system that include battery dac amp headphone in one small and light format, but it's by far what feels to me like the most balanced sound in all the BT headphones I've tried. and without the app the sound is very average. it indeed makes you wonder why the headphone manufacturers themselves don't move more toward this. maybe it's just inertia and the divisions needing to be created? IDK but I'm clearly a DSP believer.
 
about making a database, it could always be nice. there are already a few apps that exist with such things indeed (free or not), the problem is always how they determined what is flat, just like here. viper for android has a few convolution files, our fellow JoeBloggs did several for IEMs, but he did so by ear with his double equal loudness contour method.
about getting data, if it's to make an automated method, maybe it could be worth it to ask Tyll for his numbers instead of copying the graphs(no idea if it's something he would be willing to do).
 
 
 
 
off topic, mostly.
@RRod, I tried(last week in fact) to use the sweeps you gave me like 3.7 eternities ago when I asked you stuff about IR not being precise enough when recording them. but since I notice that REW would generate whatever I wanted in the super secret plug in called... "generator". 
rolleyes.gif
(yeah I'm just that blind) and I could then logically read them back into graphs in REW once I was done ruining them through a device and some EQ. so I used that, but never really said thank you for trying to help and suggesting to record sweep instead of IR.  thanks!
 
Dec 20, 2016 at 2:34 PM Post #8 of 19
Please see below:
 
Convolution Filter: https://dl.dropboxusercontent.com/u/10684925/Head%20Fi/HD580%20Frequency%20Resp-filters%20192%20-8db%2011k%20Max.wav
FR from Graph: https://dl.dropboxusercontent.com/u/10684925/Head%20Fi/HD580%20Frequency%20Response%20v3.csv
REW File: https://dl.dropboxusercontent.com/u/10684925/Head%20Fi/HD%20580%20Measurements.mdat
 
Dec 20, 2016 at 2:47 PM Post #9 of 19
The XTZ divine uses Dirac which is state of the art. You'll find it in $30k Datasat AV processors, BMWs, Bentleys, etc.  It is what I use in my living room for home theater, and does a great job of correcting my terrible room. Obviously Dirac is subject to some limitations regarding headphone design, materials, chip quality, etc., so while the XTZ Divine might not sound great I do think that is the way of the future. I could even imagine multi-BA IEMs with digital crossovers tuned via products like Acourate or Audiolense. I feel like the industry is stuck in the wrong paradigm but that is neither here nor there.
 
Dec 20, 2016 at 3:48 PM Post #10 of 19
Hey, terrific idea.  While likely not perfect it should get us in the right direction.  A whole lot better than nothing other than one's guesses.  Probably gets you quite close and one can tune to preference from there. 
 
If for no other reason, thanks for bringing webplot digitizer to my attention.  I have wanted something like that so many times, and did not know of its existence.  I am running linux, but the chrome browser plug in works great. 
 
Dec 20, 2016 at 3:56 PM Post #11 of 19
  The XTZ divine uses Dirac which is state of the art. You'll find it in $30k Datasat AV processors, BMWs, Bentleys, etc.  It is what I use in my living room for home theater, and does a great job of correcting my terrible room. Obviously Dirac is subject to some limitations regarding headphone design, materials, chip quality, etc., so while the XTZ Divine might not sound great I do think that is the way of the future. I could even imagine multi-BA IEMs with digital crossovers tuned via products like Acourate or Audiolense. I feel like the industry is stuck in the wrong paradigm but that is neither here nor there.

yup. 
and I'm being a jerk about the divine TBH, because I don't like BT headphones, closed headphone, or over ear headphones. but despite that I still decided to keep it so it does something well enough ^_^. I must finish and post my review, I actually am quite fond of it in its category and was using it no later than yesterday.
 
Dec 20, 2016 at 4:09 PM Post #12 of 19
  yup. 
and I'm being a jerk about the divine TBH, because I don't like BT headphones, closed headphone, or over ear headphones. but despite that I still decided to keep it so it does something well enough ^_^. I must finish and post my review, I actually am quite fond of it in its category and was using it no later than yesterday.

 
I'd take a Christmas gift, monsieur.
 
Dec 22, 2016 at 6:24 PM Post #13 of 19
For sanity we do similar things.  With plotting others measurements.  We do however have access to our own measuring gear.  
 
Here is my process for fitting filters.  
 
We do have our own software that does what you are doing but it allows to export those coefficients so we can plug them into some DSP.  
 
We load a file into our software or several.  
We can choose from several different types of filters.  Butterworth, Biquad, Dips Peaks, etc....
 
This interface also allows us to focus in on certain areas for the FRQ we want to fit. 

 
Here I am matching the Peak.  

More refinement around the Peak.

 
Working on the DIP

 
Result of Invert. 

 
 
here are all the filters. 

 
Here are the filters and the original and the inverse filter. 

 
 
Inverse filter alone. 

 
Inverse vs original file. It still needs some refinement after loading into the DSP.
 

 
And finally a bunch of code to load into the DSP.  
 
Filter x [Bz0, Bz1, Bz2, Az0, Az1, Az2]
Fs = 48000
Filter: 0
2nd order HP (F=31.623,Q=0.53631) G= 0db
[0.9961514514718391, -1.992302902943678, 0.9961514514718391, 1, -1.992294368527631, 0.9923114373597254]
Filter: 1
Dip (F=2648.4,Q=2.3109,G=9.4015) G= 0db
[0.8821030879796318, -1.54562134715918, 0.7612888542397065, 1, -1.54562134715918, 0.6433919422193383]
Filter: 2
Dip (F=7889.2,Q=5.1295,G=10.035) G= 0db
[0.856170387484778, -0.8098090854090707, 0.7239161785497644, 1, -0.8098090854090707, 0.5800865660345426]
Filter: 3
2nd order LP (F=17386,Q=0.61236) G= 0db
[0.5080577141410277, 1.016115428282055, 0.5080577141410277, 1, 0.7990910395299725, 0.2331398170341383]
 
Dec 23, 2016 at 3:10 AM Post #14 of 19
 I know it depends on so many things and don't expect an absolute and objective answer, but do you tend to find important to use as little filters as possible to achieve a curve?
 
Dec 23, 2016 at 4:50 PM Post #15 of 19
It's complete trial and error. Headphones are far more difficult to match. So for them I tend to pick a stop frequency well below 20k. Like stated by the topic starter.

I also don't have a limit or maximum to get the job done. But most of the time a good fit is done with 4. Low pass High pass and 2 peak filters.

Always take measurements after the eq has been implemented. Then tweak and listen. In the DSP we can simulate the filters as well which helps in fine tuning.
 

Users who are viewing this thread

Back
Top