# (How to) DIY Microphone calibration



## Chester (Feb 19, 2007)

First, I am not completely done with this project, I am about half way there actually: considering I can pretty effectively calibrate 500hz+ thus far. I am in the process of setting up a pressure chamber to measure the low frequency response of my mic. It is probably easier to send your mic somewhere to get it calibrated, however I am a DIY kind of guy and want to figure this out. It is a good learning experience if nothing else (though I am pretty confident that I will be able to calibrate things pretty accurately). Not everything is going to be explained 100% yet, this is a pretty involved project and I am trying to investigate which factors affect the measured frequency response - so this isn't a complete guide yet.

Things you will need (for the high frequency calibration):
-electric grill starter (10kv sparker)
-measurement microphone to calibrate
-*QUIET* large room in which furniture can be moved out of the way
-audio editing software, I am using Adobe Audition v3, Audacity should work too.
-ADC (I am using a Tascam US-1800)
-wire to channel the 10kv
-tape measure and 'general tools' are also useful

Electric grill sparker, it uses an inductor/circuitry to generate the spark, not a piezo element, so it is silent in its operation. A VERY quiet room is key in getting useful data here, the spark is not particularly loud. I have been able to achieve a ~-60 to -65 db noise floor in my measurements after applying the 20db/decade (~6db/oct) low-pass filter and removing invalid data below 500 hz with a FFT Equalizer.










It uses a 1.5v battery and outputs a 10kv spark









I made sure I have a 3+ foot distance between the mic and anything else in the room.









Closeup of the high-voltage leads and the mic. Since the spark gap is generated across the floor, I get a little more SPL out of it which helps with the noise floor of the measurements.









I used an inductor to measure the initial impulse of the spark, it is as fast as the ADC can resolve @96khz, actually, the recorded impulse from the inductor can be used to calibrate the frequency response of the input channels. This will allow me to isolate the microphones frequency response from the response of the input. The main reason I used the inductor was to make sure there was a delay between the spark event (since the electro-magnetic waves travel at the speed of light) and the impulse the microphone recorded. Since I am using a 10kv spark I was not sure if it would cause any electrical interference with the microphone: it appears to not be an issue.









I am hanging the microphone from a string suspended from a ceiling fan receptacle.









This is a 'half processed' impulse response file. I have applied a 20db/decade low-pass filter (in Adobe Audition) to the recorded spark impulses and normalized the data. Subsequently I imported the impulse response into REW and set the IR Window to exclude any room noise from the graphed data. As you can see, around 500 hz, the phase shifts from being pretty linear to highly erratic. I have used this to determine that 500hz+ is 'valid' for the calibration, anything below is basically noise.









This is an impulse response with the 'bad data' removed. I used a 200 db cut at 500 hz with the FFT Equalizer. Using other methods, such as creating a pressure chamber with a speaker transducer, I can find the low frequency response of the microphone and have a complete calibration file.









This is an investigation of how the microphone height (distance from the floor) affects the measured frequency response. Notice how at higher frequencies there is some sort of phase cancellation that shifts as the height changes.









This is an investigation of how the spark gap length affects the measured impulse response.









This shows the repeatability of the sparks; on accident I included a third measurement which is of the same gap distance but a different height, however if you focus on measurements 6 and 9, you can see that there is at most ~0.2 db of difference between the measured impulses when using sparks. I plan to investigate this further eventually, however for now, I am confident that "a spark is a spark" for these purposes.


----------



## Barleywater (Dec 11, 2011)

This shows more promise than previous reciprocity approach.

Still, many variables, and need for validation. 


Microphone response is much smoother than this, and displayed roll-off above 8kHz is not representative of your measurement microphone.

Spark length, orientation and distance above floor likely have big impact on results.

Keep on spark'n!:T

Andrew


----------



## Chester (Feb 19, 2007)

Thanks for the feedback Barleywater! You mention that the response of the mic above 8khz is not representitive, how do we know it is not? I am not trying to say you are incorrect in that statement, I am just looking for ways to improve my methods. While my microphone is not an ECM-8000, this graph leads me to believe that the response I am seeing is *possible* for a measurement microphone, however there probably should be a smoother high frequency response being seen. I am getting about -4 db at 20khz in my findings.









While there are variations between measurements there is definitely a trend showing up. In varying the spark gap I found +/-0.5 db of between a 2.41 mm and 8.95 mm gap, at least in the high frequency response and after accounting for differences in volume. Since the thing is hanging from the ceiling it is my suspicion that a part of the variation is due to 'swaying', I will try to be more careful about that.

I am going to try to get the microphone closer to the spark gap and use a shorter gap to ensure that the spark is not going to travel through the microphone  Hopefully this approach will push any resonances between the mic and the floor up past what can be measured...


----------



## Barleywater (Dec 11, 2011)

Possible yes, but crying out for validation.

Highly recommend getting calibrated microphone. Otherwise it remains blind fun.

Regards,

Andrew


----------



## Chester (Feb 19, 2007)

I understand where you are coming from. another idea I [just] had was to do a combination between the close pressure chamber low frequency setup (see here: http://www.artalabs.hr/AppNotes/AP5_MikroMeasChamber-Rev03Eng.pdf) and also using a spark gap to create an impulsive pressure wave. If I make a short 5mm chamber and make a spark across the open end, it should have a resonance of over 34khz, which would allow me to decrease the noise floor and have a more controlled environment... Another idea is to use a cone (again 5 mm for high resonant frequency) and have a spark originate in the 'peak' of the cone, again, maintaining pressure while not having the spark too close to the microphone element.
http://hyperphysics.phy-astr.gsu.edu/hbase/waves/opecol.html#c1
If I create a closed chamber and generate a spark in there it may give me a pressure response?... feedback is welcome, I am figuring this out as I go!


----------



## Anechoic (Jan 16, 2009)

Very interesting. I considered experimenting with sparks early on but was dissuaded due to the low SNR,especially at low frequencies. The advantage of using sparks is that it should allow you to directly measure the phase response at the mic, assuming you can get close to an "ideal" spark.

A couple of questions:

1. What does the impulse (time trace) look like? Is it repeatable?

2. Are you applying a weighting window (Hanning/Hamming/etc) before the FFT? That might help with some of the ripple.

3. What is the low-pass filter freqency?

Also, you might want to back the mic a little further mic away from the spark generator, you might be getting nearfield turbulence cased by the expanding air that might be causing funny results. 



> If I make a short 5mm chamber and make a spark across the open end, it should have a resonance of over 34khz, which would allow me to decrease the noise floor and have a more controlled environment... Another idea is to use a cone (again 5 mm for high resonant frequency) and have a spark originate in the 'peak' of the cone, again, maintaining pressure while not having the spark too close to the microphone element.
> http://hyperphysics.phy-astr.gsu.edu...opecol.html#c1
> If I create a closed chamber and generate a spark in there it may give me a pressure response?... feedback is welcome, I am figuring this out as I go!


It seems like with a mic that close to the spark, you have a good chance of melting or otherwsie damaging the diaphragm, especially for low-cost mics that have plastic diaphragms. Also, if the spark heats up the air, that affects the speed of sound which in turn affects the frequency response. To use a spark in that small of a volume would require finding a way to make the process isothermal.

It would be cool to see if you can get this to work, I might hire you to take care of some of my overflow .


----------



## Chester (Feb 19, 2007)

1) it appears to be highly repeatable - within 0.5 db per run if the microphone stays still  I can send you some recordings of impulses if you would like (my raw data).

2) I am applying a 20db/decade (6db/oct) lowpass filter using a FFT Equalizer in Adobe Audition - I am pretty sure that it only affects frequency response (linear phase). For clarity sake, I have also been using the FFT EQ to cut out anything below what I have found to be the 'valid' data. I am not exactly sure if this answers your question or not, please let me know.

3) The low-pass filter frequency is 47.5 hz; that is as low as the FFT EQ in Audition will show. However, remember that I am removing anything below 500 hz after I apply the low-pass filter

That is a good point about the turbulence, I had considered that: on that note, if the spark gap is short, the sparks tend to be very 'linear' and make straight lines between electrodes, when the gap is larger (closer to the maximum distance achievable) the sparks tend to have some 'jaggies' in them  With a larger gap, the SPL intensity is greater (more air is heated) - so in the enclosure it probably would be best to have a small gap to have a consistent, lower temperature spark.

In loudspeakers, the whole idea behind using 'stuffing'/insulation is to make the compression/rarefaction of the air isothermal -> problem solved? 

I will do some experiments with Saran Wrap to see how plastic holds up near the spark.

I hope I can get this figured out to the point where other people would want their mics calibrated this way. If I can get the spark chamber idea working it would be a very small device to calibrate a mic.

Results: unless I specifically make the spark *through* the saran wrap, no melting. Actually, going through the saran wrap only yields a very small pin prick of a hole.

I found an acrylic 'comically oversized bachelorette party ring of science ' which I am going to router out and make a chamber for my mic. It just so happens that the countersync that came with our Dewalt Drill is 10.47 mm diameter... my mic is 10.07 mm diameter: is it fate? also the countersync part creates a point that is 5.51 mm deep (I was hoping for 5 mm depth): the guys at Dewalt must have known I would be trying to calibrate my microphone in a spark chamber and designed this thing specificaly for me!

Another thought: while what you said about the temperature of the air is true and should definitely be investigated, the actual duration of the spark is VERY short, I am estimating less than 1/96000 of a second based on the EM field data I measured. I can try and measure the light pulse with my solar panel apparatus (not sure how well that will work :/) My point is, the pulse is so short, there is probably not enough time to disturb the air too much - I definitely could be wrong about that though.


----------



## Anechoic (Jan 16, 2009)

Chester said:


> 2) I am applying a 20db/decade (6db/oct) lowpass filter using a FFT Equalizer in Adobe Audition - I am pretty sure that it only affects frequency response (linear phase). For clarity sake, I have also been using the FFT EQ to cut out anything below what I have found to be the 'valid' data. I am not exactly sure if this answers your question or not, please let me know.


Right, but if you also apply a window function like a Hanning or Hamming window, you might get rid of some of the ripple.



> 3) The low-pass filter frequency is 47.5 hz; that is as low as the FFT EQ in Audition will show. However, remember that I am removing anything below 500 hz after I apply the low-pass filter


 Do you mean 47.5 kHz? Or is it a 47.5 highpass filter?



> That is a good point about the turbulence, I had considered that: on that note, if the spark gap is short, the sparks tend to be very 'linear' and make straight lines between electrodes, when the gap is larger (closer to the maximum distance achievable) the sparks tend to have some 'jaggies' in them  With a larger gap, the SPL intensity is greater (more air is heated) - so in the enclosure it probably would be best to have a small gap to have a consistent, lower temperature spark.


Shorter sparks are closer to an ideal impulse, but at the cost of SNR. Ideally you could average a bunch of sparks together, you get 3 dB of SNR for every doubling in the number of averages.




> In loudspeakers, the whole idea behind using 'stuffing'/insulation is to make the compression/rarefaction of the air isothermal -> problem solved?


True regarding stuffing, but that doesn't help you unfortunately . You probably want to chose a material for the chamber that can draw the heat away from the air as fast as the spark heats it up.



> I will do some experiments with Saran Wrap to see how plastic holds up near the spark.


You'll probably need something thinner than Saran Wrap to simulate a mic diaphragm - but I don't know what a suitable material would be. Maybe stretch the wrap to thin it out?


----------



## Chester (Feb 19, 2007)

well, the 'spark chamber' idea definitely increased the s/n ratio - It actually got loud enough that the mic was 'clipping' and distorting from the pressure! As I shortened the gap in the chamber I did manage to get the spl low enough to eliminate that issue as far as I could tell.

An interesting aspect of the 'spark chamber' measurement: it seems that when the microphone capsule distorted from over-SPL, if I add a 20db/decade *highpass* filter, I get a very even low (less than 1khz) frequency response! I am not sure how valid that is though, it is probably just coincidence.

The grill starter has two 'output circuits' I had been wiring them in series, so I was getting 20kv: now I am using one of the outputs at 10kv; this, and also making the gap as small as possible (0.85 mm) has allowed me to move the microphone even closer (4mm between mic and floor, I am now using two needles taped even closer to the floor). When the high voltage is interfering with the measurements it becomes fairly obvious, I seem to get the same effect as in the pressure chamber (maybe the HV was interfering there too) where the frequency response below 1k is almost perfectly flat. In the 'flat low frequency but invalid' measurements above 1k, there is 24 db of gain from 3k to 12k, which is what tips me off to them very likely being invalid 

With the very short spark, I am still getting a pretty flat response to ~1khz and even more consistent measurements. I have a piece of 1/2" pvc pipe and a 1/2" headphone transducer which I have begun fashioning into a pressure chamber to measure the low frequency side of things (will use REW to do a frequency sweep) - my 'invalid' measurements that I described earlier MAY contain valid low frequency info too, I will try to look into that too.

I have found that the FFT EQ in Audition does not extrapolate below 47.5 hz. I am almost certain that the Audacity FFT EQ allows manipulation of lower frequencies. Yes, I meant 47.5 hz last time, however you are correct, it is a high-pass filter: I messed up -> the way it shows up in Audition, the graph is reversed because I have 80 db in the 'min' area and 0 db in the 'max' area  sorry about the confusion! I have been making so many measurements and messing around with them that it had 'just worked' so I never noticed; when I said low pass, I was visualizing the graph in my head 

Addition: As I changed the mic between 7 and 4 mm from the spark, with a very short spark gap, the only real change in frequency response occured at frequencies above 30k


----------



## Barleywater (Dec 11, 2011)

Have you turned down gain on microphone preamplifier?

FFT limitations of Audition may be worked around in several ways. I use Cool Edit Pro.

Main trick is using lower sample rate. If you re-sample to 1/2 of current rate, FFT limit reaches down by same factor. Of course Nyquist gets chopped too, for which additional work around exists.

A copy of wave is down sampled, filtered and up sampled back. This brings brick wall of lower sample rate Nyquist with it. Track is made stereo and paired up with copy of unaltered original. FFT is used in steeply low pass below frequency for Nyquist of resampled track, and matching FFT high pass applied to original on track pairings, and then two tracks are summed for result.

Limit of 65k window and low frequency limit of frequency response display is also overcome by down sampling to lower rate. I've done sub analysis with Cool Edit Pro at 1/10 regular sample rates with great results.

Are you triggering with mechanical switch? Contact variation may be eliminated with power transistor/fet with protection diode. A few more parts on front end allow triggering with periodic signal from computer. This in turn allowing averaging results for improved S/N.

Cheers,

Andrew


----------



## chris319 (Dec 16, 2008)

I have tried calibrating mics with sparks. The big, big problem is that the spark samples are quite inconsistent from sample to sample. Until this problem is solved I don't think this method is viable.


----------



## chris319 (Dec 16, 2008)

Update: I got the idea to record my sparks using, instead of my trusty ECM8000, a Shure SM63 omnidirectional _dynamic_ mic! The sparks themselves may be less inconsistent than I thought. It occurred to me that the low-mass plastic diaphragm of the ECM8000 condenser mic may be a little too sensitive to the impulses and not sufficiently damped, giving me inconsistent results due to the way the diaphragm moves in response to the initial spark impulse.

I am getting more consistent results over three samples, BUT I am using only the first doublet of the impulse response, i.e. from DC to the first peak to the first valley and back to DC again. It looks basically like one sine cycle. At the moment I am averaging the two closest measurements. I should record some more sparks.

The SM63 is unusual in that it has better high-frequency response than just about any dynamic mic I've seen.

http://cdn.shure.com/user_guide/upload/1563/us_pro_sm63_ug.pdf


----------



## Chester (Feb 19, 2007)

I got very consistent results (within 0.2 db) when testing spark to spark, with a SHORT spark gap 

some generalities I have deduced:
short spark gap = more consistent spark, across the same line of space, if it is too large, 
short spark gap = less intense spl produced by spark (it doesn't heat as much air)
short spark gap = more consistent high frequency response: if the gap is greater than 1/4 wavelength, it may affect the frequency response of the impulse that is produced

the s/n ratio (including max spl from spark, and how loud ambient sounds are), the distance between the spark and the mic (closer improves s/n, but too close will either be too much spl and clip mic transducer, OR possibly there can be electrical interference from the spark induced in the wiring and maybe the mic voice coil too)

basically, you want a short spark gap, around 1-2 mm or less, provided you can find a quiet enough environment to test in. a very sharp (pinpoint) for the spark to arc off of is also beneficial for a consistent spark. 

If you have the spark against a surface, you will double the energy the mic receives because the pressure wave can only travel in a hemisphere however, if the mic is parallel to the surface used to increase the spark pressure wave, there will be a standing wave produced between the mic transducer and the surface, which will also affect the impulse response captured (and therefore, the frequency response)

hope this helps 

I am still in the process of perfecting this whole thing, but have not given up on it! I have shifted my focus to the low frequency portion of the spectrum now...


----------

