Edited by vid - 6/25/12 at 3:51pm
If you are only interested in the frequency response (from a sine sweep it is also possible to determine distortion), then it is better to use a maximum length sequence as the source signal. Also, you may want to use a real microphone instead of a headphone for recording, a small electret capsule would be suitable for this purpose.
Thanks for the suggestions!
Well, if you are interested, I can post the program, and a compiled version of it if needed. It only outputs raw PCM data, though. It can also resample the sequence to a power of two length, which I find useful for real time FFT analysis.
It is available here. The program is a simple command line application that takes two or three arguments, in this order: the output file name, the polynomial (in binary format), and an optional "1" to enable resampling to a power of two size. The package also includes a text file containing polynomials for lengths ranging from 13 to 24 bits. Some examples:
.\mls.exe mls17.pcm 10010000000000000
.\mls.exe mlsi17.pcm 10000000000000100
.\mls.exe mls14.pcm 10000010100001 1
The first of these creates a 17-bit sequence (131071 samples). The second one creates a reverse version of the same sequence (this is done by reversing the order of bits after the initial '1'). The reverse sequence is needed for extracting the impulse response: you play the original sequence looped a few times, record it, and then convolve the result with the reverse sequence (the amplitude will need to be adjusted by a factor inversely proportional to the sequence length to avoid clipping). The third example creates a 14-bit sequence resampled to a length of 16384 samples; I use this type of sequence for real time testing (by playing it looped, and displaying the spectrum with Visual Analyser, using the same FFT size as the length of the sequence and the "Smoothing windows" set to "None").
The first two examples write 16-bit signed linear PCM data with no header, in LSB-first byte order. The third example writes 32-bit floats in native byte order, also without a header.
It is important to make the recording of the sequences sample accurate, otherwise the extracted impulse responses will be noisy. Therefore, it is best to use the same sound card for recording as for playback, at the same sample rate. Also try to make sure that the response does not change much during the test (e.g. due to moving the microphone or headphones). Keeping distortion reasonably low also improves the accuracy of the results. The noise floor can be reduced by increasing the length of the sequence used.
The implementation of the program is not very elegant, efficient, or user friendly, but perhaps it can be useful.
There are omnidirectional electret measurement microphones available for as low as about $50, for example the Behringer ECM8000, but probably there are other better suited ones. Note that the electronics of the microphones often need relatively large phantom voltage (in the range 12 to 48 Volts), have an XLR connector, and output a low signal level, so using them with a simple PC sound card without a pre-amplifier can be tricky. For headphone measurements, some DIY work may also be necessary if the microphone is too bulky (the capsule itself often has a size of only a few millimeters).
You may be more likely to have success with small electret microphones made specifically for use with PCs (for gaming etc.), these may not have as good frequency response (lacking the bass extension, for example) or low distortion, but are much easier to use with just a sound card, and could still be an improvement over a microphone made from a headphone driver.
Now, this is the part I don't quite understand: I was told to "convolve" the recording with the reverse of the MLS sequence, but I've no idea how one goes about convolving. What I did was load up HOLMImpulse, specify the measurement signal as "Square Noise" and import the recording along with the reversed MLS as the signal. Not sure if this is correct, but please set me right if not.
I did not test it, but according to the documentation of HOLMImpulse, it is possible to import a "signal and recording", that is, the original sample and what was recorded with the microphone, and it will calculate the impulse response from that. Also, if you upload the recorded WAV file, I can extract the impulse responses from that.
It is very difficult to measure the frequency response above a few kHz accurately, so differences like that with simple equipment are not surprising. For example, this graph is an attempt to measure the frequency response of a DT770 Pro with an "ear bud" made of a small measurement microphone, and the part above about 5 kHz is basically useless, and already from ~2 kHz it gets less accurate.
The DF for hip hop? If we ever get to meet up in person, I'll let you listen to the 580. Going head to head with the 580 bass, the DF definitely loses out. I've been told by folks who work in professional recording studios, that the hd580/600 is close to 'flat'/neutral. If that's true, then the DF and the 702 bass are both on the lean side of 'neutral'. Of course it's possibly something to do with the amp, though I'm not totally convinced of that. Never thought of driving them out of the 1/8 stereo line out jack of the 0404....but there's not the option you mention. BTW, you're not the only forum member with no bass issues with the DF. There's another forum member who tells me the same....that I'm not giving them proper amping. I tend to think it's, at least in part, the nature of the phone itself. Lots of people also claim the k70X has weak bass (a few others claim it's close to perfect). I've heard both phones, and the mid bass impact is about equivalent on the DF and 702. The 580(and 600 I think since the drivers are the same) is a different story.. Much more engaging to listen to out of my set up. I used to be a real DF fanboy, but the DF isn't getting much head time here since getting the 580.
It does not seem to be quite right, though, as the graphs should not be so noisy with a 20-bit sequence, if the IR is correctly extracted.
It was tested while actually wearing the headphones, using an "ear bud" microphone which is basically just a small (1/4") capsule in some foam, similarly to the method someone used in this thread. It was not meant to be reliable in the high frequency range (that is not easy to achieve even with a dummy head, and the presence of the microphone also noticeably affects the treble response), and the measurement is "raw", without any correction. HRTFs are measured at a different position and are more affected by the ear canal, so the equalization curve you have shown cannot be applied to this graph. I could test the treble separately without wearing the headphones - this obviously does not give an accurate frequency response either, but it shows how well the treble is extended, and if there are any obvious driver resonances.
I'm not exactly sure yet how the HRTF thing works, but from what I gather (could be quite wrong), it's basically an EQ that gets applied to the recording to account for the way the upper torso of a listener would fling the sound around. I have a feeling it's not quite this simple, but that the best I've been able to grasp for now.
It is mostly due to the outer ear, the pinna and the ear canal affecting the frequency response. But to equalize the effects of these, first you need to have them correctly reproduced in the test, i.e. ideally use a dummy head.