Hacker News new | past | comments | ask | show | jobs | submit login
[flagged] How to measure frequency response of a speaker at home (crabman.me)
57 points by philip-b 32 days ago | hide | past | favorite | 57 comments



You need a calibrated measurement microphone to do this for real. Otherwise the microphone’s frequency response will skew the results.


You can check whether responses differ without a calibrated microphone.

But regardless here the methodology is very weak, just playing a sine sweep with a spectrum recorder open and eyeballing the frequency magnitudes.


For actual speakers, you could use a second of the same type of speaker as a microphone, and assume the losses are similar, do a slow sine sweep through, and just divide all the dB values in half.

Obviously this will only work if there's a passive crossover network, and nothing active in the speakers.


Not just that but the FRF calculation is slightly complex. You need to take into account windowing function, amplitude correction factor, sampling rate and block size of each measurement and %overlap… leakage is a very important thing in signal processing and spectral analysis. Also you need an anechoic environment to capture this, because you would be also capturing room reflections and characteristics of room acoustics.


For the logarithmic sine sweeps (confunsigly also known as exponential sine sweeps) used here the standard method is to use an inverse filter to (de)convolve the sweep recording into an impulse response. No worries about windowing or leakage when using that.

This is sadly not very well documented process, but some open source implementations exist. E.g. https://github.com/maj4e/pyrirtool


Well, you don't need an anechoic environment for that. Just use a time window. Signal will be captured by mic before any reflection arrives. You won't be able to measure lows well, though. But ~300-20k Hz is fine.


> Also you need an anechoic environment to capture this,

They were talking about a home. /s


iPhone mics are consistent enough to be used for most purposes. Apple provides the correction curves and they are used by apps like Audiotools


This! So many people don't take advantage of this fact.


Do you know if the same is true of iPads and if there is a program like Spectroid for iOS?


I've always wondered... is there some way to mathematically "solve" for this with multiple microphones and multiple speakers?

Like with 2 of each, or 3 of each, where you play the same waveform through every possible pair of speaker and microphone, you can solve some kind of system of matrix equations to determine the only possible combination of responsiveness at each device at each frequency?

Or do you just need a reference microphone with known characteristics, period, end of story, because math can't do it?

(Obviously from a practical perspective you want the reference microphone... I'm just curious about in theory.)


Yes, multiple microphones is how microphones can be calibrated in the first place. You make a particular kind of microphone that also functions as a speaker, with certain testable assumptions about how they work. Then you point one at the other and vice versa. The result is a reference microphone that can then be used to calibrate other microphones.

You don't do it every day, which is why an outfit like Bruel & Kjaer can charge a lot for their gear. ;-)


I believe it's hardly different from trying to deduce perfect distances from multiple rulers of dubious precision: you need to compare them to one of extreme precision. Arranging 4 rulers into a perfect square proves that they have equal lengths, but you still don't know their offset from standard length.

However, if you ignore tolerances and assume that every microphone of a given model number has equal response, then it's simply a matter of having that known response information available, similar to a hypothetical brand of ruler being known for coming up short.


> but you still don't know their offset from standard length.

But that's fine for microphones -- the question here isn't to determine their absolute volume, which is of course unsolvable. It's to determine the relative "volume" (response) at each frequency. It's the shape of the curve that matters, not its offset.

And again, I'm not looking for a practical solution (like getting the info from a manufacturer) -- I'm just curious about it in theory. If it's inherently solvable or not.


This isn't solvable. Each loudspeaker and microphone has its own frequency response and will always measure the product of any two of them. This does not result in a unique solution for any single frequency response, even when you know the clean source signal. There is always a degree of freedom of how much each device in a pairing contributes to the final response.


what if you move the microphones and speakers at varying but precise speeds so that doppler shift can be used to shift frequencies? you could play a tone on the speaker, shift the relative velocity (spin the microphone really fast?) and calibrate a frequency range of the microphone. with a calibrated mic frequency range, you can now calibrate that range of the speaker. repeat. each calibration step is going to accumulate error. to be clear, not a practical solution, but fun to theorize.


And how do you calibrate a microphone? With a calibrated speaker? :P

I'm guessing that there must be a way to either cancel out skews and work around this, but I guess it's just easier to start with a calibrated microphone


Generally speaking “you” do not calibrate a measurement mic. I’m restricting the discussion to measurement mics because that’s pertinent to the OP and because mics have all sorts of frequency responses designed into them on purpose.

Measurement mics (the professionally targeted kind) can with some models be purchased from the manufacturer with a calibration file that can be used by various audio measurement software packages. There are also places that will calibrate your mics for you. In the end what this really means is just figuring out the frequency response characteristics of a given mic relative to a known source. This could just be a case of “we match it to this mic over here.” As long as all the mics someone is using are calibrated to the same standard then it’s less important that they’re perfectly flat in frequency response. I have some really good mics but the bulk of my measurement mics are inexpensive and not calibrated. They work fine though because they all measure close enough to the same that once you figure in all the external parts of a system (the room for instance) the mics minor variations become insignificant. The important thing is that I can put 8 mics around a room and pull reliable data to tune the room and make it sound musical. At the end of the day all the measurement stuff is just there to help you scientifically quantify why a room doesn’t sound right and then you can fix it. Like the last room I tuned that had 2 blown HF drivers and the polarity flipped on some LF drivers. The ears easily said there was a problem. The tools told me right away what they were. Sure I could have found them without the tools and by tweaking settings till everything was right, but the proper tools (and knowing how to use them) makes a huge difference.


That's a great question! I have no idea. At low frequencies it should be very easy, because the sound is just a pressure measurement, so you can compare against a calibrated pressure reference. So the main challenge is measuring the high-frequency amplitude and phase response. If I had to do this, I'd probably set up a speaker in a long box with standing-wave resonance modes, and put both the microphone-under-test and a laser interferometer at an antinode to measure the change in refractive index that occurs with air pressure. A photodiode should have a flat frequency response out to well beyond 20 kHz, so that would do well as a calibration. But this is probably overkill for audible frequencies.


Generally you look up your microphone's magnitude response and enter it into whatever interface you have. For home audio receivers they have this hard coded for their included microphone.

Also, generally microphones are sensitive to orientation, so to have repeatable results be sure to control that. Position in a room is also essential for repeatability.


True, but of the same importance, the speaker cannot be measured independently of the room in a home setup. You need an anechoic chamber, or at least a large and very quiet space. Even a decent size living room will alter the measurements considerably and of course materials matter too.

I have spent a lot of time measuring rooms and you can't underestimate how they can mess with frequencies, but it's also true that good speakers sound pretty good in almost any room, and bad ones will sound bad.


Indeed, the article is very unsophisticated. Here are some relatively inexpensive measurement mics: https://roga-instruments.com/usb-measuring-microphone/

Going the USB route sidesteps the separate DACs, which either add to the problem or run into the thousands.


I have Lyngdorf amplifier at home, and it came with a calibration microphone. You move it to different locations while the speakers play different tones and measure how the sound interacts with your environment, and creates a listening profile for it.


Looking at those spectrograms, the uncorrected frequency response of the phone's microphone is unlikely to be responsible for most of what you can see.


> when Motion+ is connected to my phone via bluetooth, and when it's connected to my laptop via aux-in

Why not for it's always interesting to experiment but one is lossy (all bluetooth codecs are lossy AFAIK) and the other is analog. Probably on top of an already lossy source too. They "sound" the same the same way a pixelized color print of Mona Lisa next to the real Mona Lisa looks identical if you're far enough. You may or may not be able to tell the difference but lossy Bluetooth and analog aux-in don't sound the same.

I decided to go for a simple setup: a Yamaha fully integrated amp that does it all, including a network streamer. And I stream from Qobuz (lossless streaming) and from my own collection of CDs I ripped to FLAC (lossless and bit-perfect rips even though you're ripping from an audio CD, verified with an online DB of hashes from other people who did ripped the same CDs).

So I know that up to amp, it's all lossless. Then the amp does its magic.

It's simple really: even though I can't tell the difference between a pixelized color print of Mona Lisa and the real thing from far enough, I'd still prefer to know I'm actually looking at the real thing.

A Qobuz (lossless) subscription doesn't cost more than a Spotify one (lossy although they announced they'd move to lossless IIRC).

It's 2024: FLAC files are tiny compared to, say, even just a 1080p movie. Bandwith is plenty to stream lossless.

Why even bother with lossy? Lossy audio is tech from a quarter of a century ago.


> Why even bother with lossy? Lossy audio is tech from a quarter of a century ago.

I know I'm rehashing the same argument that has been had around and around for decades but - because it often doesn't matter. In 2024 a 320Kbps or whatever high quality lossy source over a recent bluetooth codec into a Chinesium amp + DAC into a mid-range $500 pair of speakers sounds _awesome_ and the amount of time and money you spend going above that may be a fun hobby but it's really not worth the effort for most people.


To do this at home somewhat accurately, see this article 'How to make quasi-anechoic speaker measurements/spinoramas with REW and VituixCAD' https://audiosciencereview.com/forum/index.php?threads/how-t...


> I eyeballed the two (red) plots and I think they look more or less identical.

I overlaid those two images [0], and they seem significantly (though not hugely) different to me.

Wouldn't speculate as to why that is though, without checking the consistency of passes with the same setup.

0 - https://imgur.com/a/7GUSmPW (with hue shift for comparison)


This is useful, thanks. I should've done it on my own. And checking the consistency of passes would be a good idea too. If you don't mind, I'll update my blog post to include your overlaid image.


No worries.. I'd be interested to see the results of a multi pass consistency test.


Oh my. I mean, if this guy is happy with his results then more power to him. However, this write up is a textbook case of the blind leading the blind. I don’t even know where to begin. The classic smiley faced EQ, equating spectograph with transfer function, no discussion of phase or any other time domain considerations. It reminds me of when I was 17 and thought I knew everything about computers. Then I went to college and learned how little it was that I actually knew. The author’s knowledge is me when I was 17. I however own thousands of dollars of measurement mics, audio interfaces, and software, and have experience built on decades of pro audio work using those tools and honing my craft.

It’s not my desire to slam the author but it’s also important that people don’t take this correct methodology.


`When disagreeing, please reply to the argument instead of calling names. "That is idiotic; 1 + 1 is 2, not 3" can be shortened to "1 + 1 is 2, not 3".`

`Please don't fulminate. Please don't sneer, including at the rest of the community.`

As a curious person with a degree in Electrical Engineering, and one in Computer Science, very interested in quality audio, etc, I know what you mean.

But please, don't be the person who kills curiousity. This person was curious, did some experiments, and posted the result. If you have time, write some of the major ways that such a measurement is inadequate. If not, link to some resources.

`Please don't post shallow dismissals, especially of other people's work. A good critical comment teaches us something.`


I find it interesting that you chose to respond to my comment like this as opposed to others which are more egregious on the issues you bring up.

That aside though, I did mention a number of issues with the write up. Anyone interested is welcome to dig into them and come back with questions if they desire. This is not however an introductory level topic and I elected to not try to thumb tap out a distillation of a very advanced and multi-faceted topic here.

I would not expect someone with graduate level qualifications and years of experience in software development to try to distill their work down to my level either.


He responded to you because he thinks you can still be saved


Your last sentence is exactly what the best of HN is: wonderful distillation of complex topics.



Years ago at uni, one group chose as their control systems term project to take a known bad speaker (2 inch from transistor radio), measure its response, then build an inverse function to make it perfect using an analog computer. Don't know what the result was but they did have fun.


That will be tough because any attenuation will have to be cancelled by a gain, but the gain will amplify both noise and signal. So the end result might have the right spectral balance but be noisy in the frequency bands where the original signal was weak.


It's a university project, so it wouldn't have been expected to be perfect. I had to do something similar as an assignment, but if I had the choice, I would have chosen anything else because the project was anything but fun.

Everything was implemented using transistors, so it involved a lot of calculations, and simulation in LTSpice.


Probably even more years ago at Uni, my senior project group built an automated analysis system for a large (literally large,club to stadium sized) speaker company.

It was a very cool project that spanned multiple disciplines as we built a phased microphone array, a system to tilt and rotate the speaker, and programmable logic and software to generate and analyze signals.

It was proof-of-concept quality, but was later made real and reduced analysis time from dozens of hours to about 45 minutes. Two of the project members were even hired by the company.


I just want to point out that it's a pretty big leap to go from "I observed the same frequency response curve with two different inputs" to "there is no audible difference between the two inputs". There are many other measurements you would need to take to prove or disprove the hypothesis, such as signal to noise ratio and dynamic range. And even then you couldn't really prove it definitively due to the complexity of how humans interpret the sound.

When you use Bluetooth, your speaker is functioning as the DAC (digital to analog converter), but when you use the aux, your computer is functioning as the DAC and also amplifying the signal, so it's reasonable to expect them to sound different.


are there any established speaker metrics that would get at something like "reconstruction error"? i've seen total harmonic distortion (THD) published in some spec sheets, but i'm not clear if there's a standard method for how that gets calculated or if it's just marketing hype.

moreover, i'm not sure if/how something like THD relates to accuracy of reconstructing more complex naturalistic (i.e., non-sine wave) signals.


Do different DACs frequently sound different? I would expect that it's audiophile's fairy tales.


>I eyeballed the two (red) plots and I think they look more or less identical. So I guess there is actually no difference in sound and I just imagined it.

LOL. Why is this even on the front page? He measured it with a phone's mic, then he goes on to "eyeball" the results, which are clearly different even to the eye. He then declares them the same. From top to bottom, everything is wrong with this.


Always hear my audiophile friends talking about this company/product:

https://www.dirac.com/live/



Shammy. You cannot truly correct for a room without actually changing the room itself.


You don't have to "truly" correct for the room for EQ/calibration to be worthwhile - you just have to make it sound better than it did. I've used the built-in calibration in my WIIM Pro and it subjectively made a massive improvement.

I used to be in-principle anti-EQ, but the AutoEQ project for headphones completely changed my opinion (though obviously headphones are far easier to EQ).


Sounds like they described a sub-par preamp on the wired input; something to the quality of BT compression.

You can still tell that from the coloring of a local reference mic.


I own a Soundcore Motion+ and can attest to it to be terribly sounding, even for a Bluetooth speaker.


This assumes your amp and speaker are linear systems.


Linearity is an excellent assumption for virtually any non-overdriven modern amplifier. THD measurements make sense for speakers, but that's not getting in the way of what the author is attempting to do here.

I don't even know where to begin addressing everything that's wrong with this article, but assuming linearity isn't one of those errors.


'I tested different EQ presets on "Levitating" by Dua Lipa (Youtube Music, Music video on Youtube). The song is fantastic, and I've been listening to it on repeat these last few days'

Stopped reading


can't forget

> The music video is fantastic too and so, so beautiful except for the rap part which I don't like.


personally I use Korn's "Freak on a Leash", lets me quickly know how low the driver can go


Bone Thugs in Harmony "Tha Crossroads" has been my test track for many years. I think the many variences in the various male singing parts is excellent for calibration, as I rarely ever listen to bands with female singers. Plus, the backing track is quite variable as well.


same here :D




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: