Modern computing power has put in our hands incredibly powerful measurement tools. Prime example is Room EQ Wizard (REW), a free program which is an amazing toolbox of acoustic measurements. Alas, while computing power may be free enabling us to run such analysis that used to cost a lot of money in dedicated hardware, the fundamentals of what the tool measures must still be understood. Otherwise, it is exceedingly easy to arrive at the wrong data and worse yet, wrong conclusions about the science.
The purpose of this article is to demonstrate a key element: the relationship between time and frequency resolution. This is an underlying signal processing concept that is core to functionality of everything from audio and video to compression to how we measure room acoustics. Alas, while the concept is rather simple, it is not intuitive nor is it talked about much outside of the circle of industry researchers and professionals. Simply put, time and frequency resolution are enemies of each other. If attempt to get a lot of frequency resolution, you lose time resolution and vice versa. Oh, please stay with me . This will get interesting in a hurry as we apply it to electronic correction/EQ of the sound in our rooms.
When we look at bass response of our room, often we find massive peaks and valleys. These are caused by so called room modes and we could see swings of 20 or 30 dB (every 10 dB means 2X louder perceptually). We clearly hear the frequency response variations. These room "resonances" have another manifestation. They create "ringing." Ringing is a time domain phenomena where an impulse -- an infinitely short pulse with infinite amplitude -- continues to live on in the room even after it has vanished. The lingering effect of a low frequency note after it has gone away from our source causes the rest of our music/video soundtrack to sound bloated and boomy. Bass notes are not sharp and distinct but seem to last long and overwhelm the higher frequency tones.
An assertion by some in acoustic circles is that you must correct the time response in addition to frequency response. Some will say that this is only possible using acoustic material and not electronic means. As a matter of mathematics, this can't be right. What causes ringing is the room resonance. The very same resonance will also increase the amplitude at that frequency. Fundamentals of signal processing fall apart if what these people say is true. For their proof, they present acoustic measurements that seemingly show that correcting frequency response did not improve the time domain ringing. Let's see if we can duplicate their work and demonstrate where they have may have gone wrong and in the process cover the time and frequency relationship.
For this exercise, I took a subwoofer and stuffed it in the corner. I shut off the crossover and ran a sweep up to 200 Hz. Since the topic of interest here is both frequency smoothness and time domain ringing, we invoke the "waterfall" display in REW. Here is what I got:
The graph shows at time zero the original signal and its frequency response and then in successive "slices" moving forward in time it will perform the same analysis showing that frequency response. It will keep going until the limits of the graph setting are reached which in this case is 300 milliseconds or 1/3 of a second. I suspect other than noticing the non-smooth frequency response in the original signal in the back, you are scratching your head as to what else this graph means. It sure is pretty though . But it is not giving us much insight. The problem is one of settings for that measurement and graph. Let's dig into them.
The Noise Floor
The biggest problem here is that we have not paid attention to the vertical scale. This axis shows the amplitude of the sound in the room. Lowest level is 15 dB SPL and highest is 95 dB SPL. The max is OK. The problem is the min. You can't just pick a random number here. There is a minimum below which we are just measuring the noise in the room which in the case of low frequencies can be a lot. See my article on room noise: http://www.madronadigital.com/Library/RoomDynamicRange.html.
Let's put this to practice. Here is the same REW waterfall display, this time with me turning off the output so that nothing was playing:
We see noise floor that reaches up to 45 dB, a whopping 30 dB higher than what we were measuring before! So a bunch of data in the previous graph was simply noise that is independent of what our system is doing. Let's overlay this noise on top of our sub response and see the two together:
Let's correct for that by raising the bottom level of our measurement to top of the noise floor. We do this simply by sliding the scroll bar or setting the limits in REW for our graph. While we are at it, let's perform some other changes. For one, let's re-orient our viewpoint onto the 3-d graph to make it better to see the time response. Hit "Controls" button on top right and change X to 21, Y to 122 and Z to 50. This is what we get now:
I am liking this better already! We have a much clearer picture since we got rid of the noise. We see the frequency response changes and with it, the associated time domain activity. The peaks in the amplitude of the frequency response are accompanied by time domain forward/back continuation of signal.
Time and Frequency Domain Resolution
As I mentioned, the core of this article is to talk about how these two factors are enemies of each other. We can easily demonstrate this by changing the "Window" parameter in REW. The Window sets the time window or put another way, the number of audio samples uses to determined the frequency response. If you set this to 1 second, then you get a resolution of 1 Hz. If you set it to 0.1 seconds, then the resolution jumps to 10 Hz. Let's see what happens when we set this to 40 milliseconds for a 25 Hz frequency resolution:
We see a huge change in the graph. The curves left to right have become very smooth and a lot of the ups and downs have disappeared. The reason? We have lost frequency resolution. As stated, we now are dealing with chunks of 25 Hz at a time. This is way, way too big for analyzing bass frequencies because room resonances are much smaller than this. So let's optimize for frequency response by going the other direction. Here is what it looks like with 300 milliseconds window and 3.3 Hz resolution which by the way, is the default for REW:
This brought back our frequency ups and downs but notice what it did in time domain. Look at how the curve front to back for any one resonance peak has a huge hump. Just like what we had in the other direction before. Here, we know the offending frequencies but no longer know what they are really doing in time domain. I.e. determining ringing is more difficult since time domain response is distorted.
We therefore see that we cannot have high resolution in both time and frequency domain. One comes at the expense of the other and there is no way around it.
Optimized Display and Filtering
For this test, the best settings I found were 400 milliseconds for the total "Time Range" or total display and 200 milliseconds for time window. 100 milliseconds also works well but values above and below this range just cause too much distortion. I eyeballed a frequency response peak and picked 53 Hz as the first frequency to go after. I put in a parametric EQ at that frequency to pull it down and the frequencies around it. Here is what we get with the new settings and filtered response, overlaid on the non-filtered measurement.
What do you know? The math worked! I put the cursor at 53 Hz (blue line) and you can easily see that time domain ringing has heavily subsided at that frequency. The rest remains there because I have not touched them. BTW, a key note. If you change the Time/Window setting in one graph of REW and attempt to overlay another, you have to go to the other graph and apply the same settings. Otherwise, REW will happily mix the two graphs even though they were not analyzed the same.
Let's add another filter at 140 Hz:
The math works again with the both the frequency response peak going down and time domain ringing reduced.
Oh, do not be alarmed if you see some extra bits pop up in the noise floor of the system after you make changes. This is a much more advanced topic but the analysis of the system in slices can cause errors in measurements due to truncation of samples at either end. Focus on the big picture here, pun intended .
Let's go all out and add a few more filters:
We see across the board improvement in time domain and frequency domain. In practice, we would only care about response to ~100 Hz as the rest would start to get filtered by the crossover. So that sharp drop around 100 Hz is a much smaller problem than it seems.
Subjectively the bass response became all that I said at the start. I played a string track with I could now hear every one plucked even though all I was listening to was the sub! Before one pick would result in a lot of boom and the strings would all run into each other as they were played. So clearly we had made improvements in time domain. Overall bass level however seemed low. This was fixed by a boost of the entire sub by a few db. I know had the impact but kept all that was clean about my optimization. Considering that I was just playing to create these set of scenarios, these are pretty encouraging results.
For grins, let me show you how not to do this. Here is the overlay of the 53 Hz correction over no correction but with levels wrong:
Looking at this, it is very easy to conclude that we did not correct anything in time domain. It seems like a jumbled mess before and after. But per above, this is the wrong use of the tool. Set the levels right and you too can be in good hands of science .
The purpose of this article is to demonstrate a key element: the relationship between time and frequency resolution. This is an underlying signal processing concept that is core to functionality of everything from audio and video to compression to how we measure room acoustics. Alas, while the concept is rather simple, it is not intuitive nor is it talked about much outside of the circle of industry researchers and professionals. Simply put, time and frequency resolution are enemies of each other. If attempt to get a lot of frequency resolution, you lose time resolution and vice versa. Oh, please stay with me . This will get interesting in a hurry as we apply it to electronic correction/EQ of the sound in our rooms.
When we look at bass response of our room, often we find massive peaks and valleys. These are caused by so called room modes and we could see swings of 20 or 30 dB (every 10 dB means 2X louder perceptually). We clearly hear the frequency response variations. These room "resonances" have another manifestation. They create "ringing." Ringing is a time domain phenomena where an impulse -- an infinitely short pulse with infinite amplitude -- continues to live on in the room even after it has vanished. The lingering effect of a low frequency note after it has gone away from our source causes the rest of our music/video soundtrack to sound bloated and boomy. Bass notes are not sharp and distinct but seem to last long and overwhelm the higher frequency tones.
An assertion by some in acoustic circles is that you must correct the time response in addition to frequency response. Some will say that this is only possible using acoustic material and not electronic means. As a matter of mathematics, this can't be right. What causes ringing is the room resonance. The very same resonance will also increase the amplitude at that frequency. Fundamentals of signal processing fall apart if what these people say is true. For their proof, they present acoustic measurements that seemingly show that correcting frequency response did not improve the time domain ringing. Let's see if we can duplicate their work and demonstrate where they have may have gone wrong and in the process cover the time and frequency relationship.
For this exercise, I took a subwoofer and stuffed it in the corner. I shut off the crossover and ran a sweep up to 200 Hz. Since the topic of interest here is both frequency smoothness and time domain ringing, we invoke the "waterfall" display in REW. Here is what I got:
The graph shows at time zero the original signal and its frequency response and then in successive "slices" moving forward in time it will perform the same analysis showing that frequency response. It will keep going until the limits of the graph setting are reached which in this case is 300 milliseconds or 1/3 of a second. I suspect other than noticing the non-smooth frequency response in the original signal in the back, you are scratching your head as to what else this graph means. It sure is pretty though . But it is not giving us much insight. The problem is one of settings for that measurement and graph. Let's dig into them.
The Noise Floor
The biggest problem here is that we have not paid attention to the vertical scale. This axis shows the amplitude of the sound in the room. Lowest level is 15 dB SPL and highest is 95 dB SPL. The max is OK. The problem is the min. You can't just pick a random number here. There is a minimum below which we are just measuring the noise in the room which in the case of low frequencies can be a lot. See my article on room noise: http://www.madronadigital.com/Library/RoomDynamicRange.html.
Let's put this to practice. Here is the same REW waterfall display, this time with me turning off the output so that nothing was playing:
We see noise floor that reaches up to 45 dB, a whopping 30 dB higher than what we were measuring before! So a bunch of data in the previous graph was simply noise that is independent of what our system is doing. Let's overlay this noise on top of our sub response and see the two together:
Let's correct for that by raising the bottom level of our measurement to top of the noise floor. We do this simply by sliding the scroll bar or setting the limits in REW for our graph. While we are at it, let's perform some other changes. For one, let's re-orient our viewpoint onto the 3-d graph to make it better to see the time response. Hit "Controls" button on top right and change X to 21, Y to 122 and Z to 50. This is what we get now:
I am liking this better already! We have a much clearer picture since we got rid of the noise. We see the frequency response changes and with it, the associated time domain activity. The peaks in the amplitude of the frequency response are accompanied by time domain forward/back continuation of signal.
Time and Frequency Domain Resolution
As I mentioned, the core of this article is to talk about how these two factors are enemies of each other. We can easily demonstrate this by changing the "Window" parameter in REW. The Window sets the time window or put another way, the number of audio samples uses to determined the frequency response. If you set this to 1 second, then you get a resolution of 1 Hz. If you set it to 0.1 seconds, then the resolution jumps to 10 Hz. Let's see what happens when we set this to 40 milliseconds for a 25 Hz frequency resolution:
We see a huge change in the graph. The curves left to right have become very smooth and a lot of the ups and downs have disappeared. The reason? We have lost frequency resolution. As stated, we now are dealing with chunks of 25 Hz at a time. This is way, way too big for analyzing bass frequencies because room resonances are much smaller than this. So let's optimize for frequency response by going the other direction. Here is what it looks like with 300 milliseconds window and 3.3 Hz resolution which by the way, is the default for REW:
This brought back our frequency ups and downs but notice what it did in time domain. Look at how the curve front to back for any one resonance peak has a huge hump. Just like what we had in the other direction before. Here, we know the offending frequencies but no longer know what they are really doing in time domain. I.e. determining ringing is more difficult since time domain response is distorted.
We therefore see that we cannot have high resolution in both time and frequency domain. One comes at the expense of the other and there is no way around it.
Optimized Display and Filtering
For this test, the best settings I found were 400 milliseconds for the total "Time Range" or total display and 200 milliseconds for time window. 100 milliseconds also works well but values above and below this range just cause too much distortion. I eyeballed a frequency response peak and picked 53 Hz as the first frequency to go after. I put in a parametric EQ at that frequency to pull it down and the frequencies around it. Here is what we get with the new settings and filtered response, overlaid on the non-filtered measurement.
What do you know? The math worked! I put the cursor at 53 Hz (blue line) and you can easily see that time domain ringing has heavily subsided at that frequency. The rest remains there because I have not touched them. BTW, a key note. If you change the Time/Window setting in one graph of REW and attempt to overlay another, you have to go to the other graph and apply the same settings. Otherwise, REW will happily mix the two graphs even though they were not analyzed the same.
Let's add another filter at 140 Hz:
The math works again with the both the frequency response peak going down and time domain ringing reduced.
Oh, do not be alarmed if you see some extra bits pop up in the noise floor of the system after you make changes. This is a much more advanced topic but the analysis of the system in slices can cause errors in measurements due to truncation of samples at either end. Focus on the big picture here, pun intended .
Let's go all out and add a few more filters:
We see across the board improvement in time domain and frequency domain. In practice, we would only care about response to ~100 Hz as the rest would start to get filtered by the crossover. So that sharp drop around 100 Hz is a much smaller problem than it seems.
Subjectively the bass response became all that I said at the start. I played a string track with I could now hear every one plucked even though all I was listening to was the sub! Before one pick would result in a lot of boom and the strings would all run into each other as they were played. So clearly we had made improvements in time domain. Overall bass level however seemed low. This was fixed by a boost of the entire sub by a few db. I know had the impact but kept all that was clean about my optimization. Considering that I was just playing to create these set of scenarios, these are pretty encouraging results.
For grins, let me show you how not to do this. Here is the overlay of the 53 Hz correction over no correction but with levels wrong:
Looking at this, it is very easy to conclude that we did not correct anything in time domain. It seems like a jumbled mess before and after. But per above, this is the wrong use of the tool. Set the levels right and you too can be in good hands of science .