I’m currently working on my master’s thesis which involves sending and receiving sinusoids. For a test case, I’ve generated a sound consisting of the first 24 harmonics of a tone with fundamental frequency 440Hz. All harmonics have the same amplitude. The corresponding magnitude spectrum looks like follows:
My problem is that if I send the signal through a loudspeaker to a microphone, the sinusoids in the received signal show very different attenuations which I can’t explain myself. At first I observed these results with custom software written for my master’s thesis, but as it turns out the observations can also be reproduced with standard Linux tools. Even if I send the signal as a Wave file via aplay (from alsa-utils) and then record it with audacity, I get basically the same odd results.
My only expectation for the test was that higher frequencies might get stronger attenuated over distance than lower frequencies. But the attenuation I’ve observed seems to be pretty random to me. Here’s the spectrum when I send the signal through my notebook loudspeaker and receive it with my Zoom H2:
The envelope looks almost like the back of a camel and consists of two lobes centered around the 11th harmonic at 4840Hz.
I’ve tried another microphone (a very old and noisy one) and get the same characteristics as previously described.
After that, I’ve used a desktop loudspeaker instead, and the Zoom H2 gives me the following magnitude spectrum if it is placed in front of the speaker at a distance of 50cm:
Well, this doesn’t look as bad as the previous ones, but I can still observe that some harmonics get drastically attenuated while other have an extremly high amplitude compared to the rest.
Even more mysterious, if I increase the distance between the loudspeaker and the H2, the attenuation of the frequencies changes each time in another way…
To prevent measurement errors, I’ve made sure to send the mono signal only through one of the loudspeakers, and I’ve also deactivated every option from the Zoom H2 which might influence the result (e.g. compressor, monomix, lo-cut, …)
Using the H2 as a stand-alone recorder or as a microphone via USB doesn’t seem to make a difference.
So to cut a long story short, I don’t understand why I see so different forms of attenuation.
I’ve seen that different loudspeakers (notebook or desktop) can influence the outcome, while switching the microphone hasn’t yielded any changes in my experiments.
But I don’t understand why different distances show so different results.
Are the observations I’ve made supposed to be normal, or am I overlooking an important aspect in my setup?
Does anybody have an idea why attenuation behaves so different (even on a direct line between loudspeaker and microphone) or maybe a buzzword which I can search for in the literature?
Thanks for any hint a can get on this topic!
First of all you can expect to see the combined effect of the frequency responses of the loudspeaker and the microphone.
Are you working in an anechoic chamber? Reflections from nearby surfaces will be, in effect, more sources with different paths and therefore different times from source to microphone. The result would be comb filtering.
Think about the possible implications of those “facts”. Let me make the statements more simplistic: changing loudspeakers makes a difference, changing microphones doesn’t. What does that tell you about where the “problem” might lie?
Look at things another way: how many variables do you have in your “experiment”? You need to understand the potential impact of each one; and then work out how you can manage them to limit the variability that they might introduce. I can count at least six - and twice that if you separate the hardware from the software:
the tone generator hardware/software
the original recording hardware/software that captured the tones
the playback hardware/software that played the tones
the second stage recording hardware/software (Zoom H2)
the third stage recording/playback hardware/software (whatever you used to turn the Zoom’s files into files you could analyse)
the analysis hardware/software.
And there is, of course, one more: yourself - the biggest variable of all, the human factor. If you are, as you say, doing a masters degree project, you should be able to apply some logical analysis to your situation to rule some of the above options out and then seek advice on how to test the remaining ones.
With the previous statement I actually wanted to make clear that I had understood that part of the effect came from the transfer functions of the hardware, and that at least the functions for the loudspeakers differed. I thought the sentence after that
had indicated this enough.
But I think this misunderstanding is partially due to the fact that I couldn’t send all spectrum screen shots that I wanted to (restricted to 3 per post by phpBB) and couldn’t send them right away in a second post because my topic had to be approved first. I now want to catch up on that.
This is the continuation of my test with the desktop loudspeaker and the H2 with increasing distances. These magnitude spectra along with the one for 50cm from my first post show different attenuation patterns which I could not describe, at least not in a mathematical way.
Sorry that I forgot to mention the environment in which I was testing. It is just a plain non-empty room at home, so it has no echo cancelling. Concerning the idea of reflections, I must admit that I hadn’t thought of that up to now. Maybe because I (as a human) didn’t hear any differences in the received tones when standing at different distances from the sound source, and therefore thought that the problem must lie at the receiver site.
My initial idea/intention was that if I sent a tone with a couple of harmonics at equal (or otherwise predefined) amplitude, and then receive the attenuated signal, that I might conclude from the differently attenuated frequencies something about the distance from the sound source (without resorting to using stereo microphones). But instead of getting a monotone behavior of attenuation depending on frequency and distance I observed more or less random attenuation patterns.
The tone consisting of 24 harmonics has been generated by self-written software (with Overlap-Add synthesis) and the time-domain signal has been saved directly as a *.wav file. If I don’t send the sound file but analyse it right away with e.g. audacity (see first spectrum in my first post) or custom software (using something called “derivative algorithm” for sinusoidal parameter improvement) I can see that the amplitudes of the different sinusoids/harmonics are in fact equal. As stated before, all spectra that I’ve attached were obtained by sending the generated sound file with the aplay tool (because it’s simple and robust). I’ve also encountered the observed effects when using my self-written software alone. So all in all, I can conclude that apart from the transfer functions of the loudspeaker and the microphone, a major part of the effect takes place in the medium.
At least I now have the information that the impact of effects happening in the medium (air/room) like reflection can be so high that I cannot robustly encode information in the amplitude relation between different frequencies at the same time. Therefore my next approach will be to encode information in the temporal behavior of single sinusoids.
I presume that you are using a single loudspeaker?
If you have two loudspeakers then there will be comb filter effects caused by the interaction of the two sound sources.
Also, it is very rare that speakers will produce a coherent wavefront across the audio frequency range. Other speakers, in effect, behave as multiple sound sources rather than a single planar sound source, so there will be comb filter effects even with one speaker, and this effect will vary with distance from the speaker. I would expect these effects to be more noticeable when measuring individual sine waves rather than broad band sound.
The most accurate coupling between loudspeaker and microphone are likely to be achieved by using a single omnidirectional microphone (“omnidirectional” so as to reduce the “proximity effect”), very close to the speaker, in a well damped environment, but even then it would not be surprising to see strange frequency responses due to the geometry of the speaker cone in relation to the microphone position.
When considering damping the environment, don’t forget the back of the speaker. For small computer speakers, significant amounts of sound will come off the back of the speaker and bounce back from surfaces behind the speaker, particularly in the low frequency range. Ideally these types of tests should be performed in an anechoic chamber.
So are you looking for a measurement technique that will allow you to use tables such as these
or this formula
to determine the distance to the sound source?
These seem to be valid only for free-field sounds (no reflections) and for distances of 30 m or more. Yes, you could theoretically determine if the sound was 3 m from the source, but it appears from the table in the first link that you would be looking for a difference in level of 0.8 dB between the low frequency tone and the 10 kHz tone with a relative humidity of about 20%. If the RH was 50% the difference would be about 0.4 dB.
You could get completely crazy and put one of the noise signals through the system, find out the non-linearities and damage in the system and generate tools that cancel them to zero. From that point forward, the channel should be clear and controllable – assuming no echoes and nothing ever moves. You can’t compensate for echoes.
And because you can’t control for echoes, your experiments in a normal room might be really entertaining.
Yes, I’m using only one loudspeaker. I’ve found that source of problem relatively early, because I could observe a sinusoid at half the fundamental frequency of the tone when using two loudspeakers. That is why I mentioned it in my first post.
Indeed, I was quite stuck with the results.
Yes, I was looking for something like that. But as your expertise and opinions shown me, the restrictions are too tight for my application scenario. The software framework which I am working on is intended to be used with embedded systems in a normal environment with the use of inexpensive hardware. So all in all, I know now that it is a lost battle to continue this approach. But at least I am now certain of that, and therefore I can now go on with other alternatives. And on top of that, I think that I have now gained enough information to describe in my thesis why my initial idea didn’t yield any useful results, and this is not a bad outcome either.