The goal is to record a spectrum from my speaker which presentation is comparable with the manufacturer's spectrum. (Explanation at the end of the post if you are interested.)
I try to obtain a response curve from my midtone speaker (Visaton W130S-8) by exiting it with white noise. The recording spectrum for a single trace is orange. There is so much noise it is not useful.
The spectrum analyzer I use offers averaging over 20 times. That is, the display is averaged over 20 traces. (Like the LeCroy spectrum analyzers did, if someone remembers that). The noise is considerable less, blue curve. That is to be expected. Noise is not correlated, so every averaging action will reduce noise.
Still I don't find the trace as smooth as the manufacturer's. What I did was applying a moving average filter as post-processing. The width of the averaging filter is 1/3 octave. So for each frequency I determined the frequency bin 1/6 octave lower, the frequency bin 1/6 octave higher and averaged over those bins. So for example for 400 Hz I averaged over frequencies between 256 Hz and 348 Hz. A total of 63 frequencies. As the frequencies become higher, the number of bins for 1/3 octave increases. FFT has a linear distribution, humans prefer a logarithmic presentation.
The postprocessing was performed on exactly the blue data. That is, I exported 16383 values which were displayed from the spectrum analyzer. Then applied the moving average with 1/3 octave width. The yellow line is the result.
The increase in level below 40 Hz may be caused by my microphone or microphone pre-amp. I don't care about it because I am interested in the range 200Hz - 3000Hz.
As a comparison I also post the manufacturer's trace.
I would say it is comparable and my method is useful. The question is, does it make sense?
I know that averaging the spectrum is useful for noise reduction. And it does. But it does not smooth. I know that 1/3 octave smoothing is performed by some spectrum analyzers. And it is a somewhat complicated process. What I did, smoothing by applying a moving average in the frequency domain, is that correct and useful in some way?
Or are the results unreliable and not physically correct? I do have access to the spectrum analyzer source code so I could implement the officially correct 1/3 octave smoothing. But if I can get away with this post-processing I'd prefer that. The project is improving my speaker, not improving my spectrum analyzer. On this moment at least.
The spectrum analyzer is AudMes, multi-platform and FOSS. https://github.com/swwa/audmes.git
Some more information: Not relevant for this thread but then you understand why I do this and why I need this.
What I am trying to do in the audio domain is this. The W130S is part of a hybrid active/passive system. Bass/Mid+High is actively filtered at 200 Hz. Mid/High is passively filtered at 3000 Hz. The relative levels of the speakers are correctly adjusted. The system sounds like total ****. No bass, no high. When looking up the manufacturer's specs I noticed a 6 dB increase in SPL between 200 Hz and 3000 Hz. That is 2 times as loud!
When I apply an exact reverse curve in my equalizer (in my Linux PC, PulseEffects) the system sounds smooth as a baby butt. Suddenly there is bass, suddenly there is treble. It is not so much that the mids are suppressed. But the bass and treble suddenly are present. At least that is the perception.
The system will be converted to fully active filtering. And I want to correct the active filter with the reverse frequency curve. So far I have been able to derive a way to design a correction network with an arbitrary n dB/oct filter with n < 6. Like a pinking filter but then for 2 or 4.5 dB/oct or whatever. Calculations of the filter are correct. Simulations are correct. If I apply the simulated curve to the manufacturer's response curve, the response is straight. Now is the time to build the filter and test it with the real speaker. And for that I need a decent frequency curve to see what I have achieved.
The theory on the arbitrary n dB/oct filter will be published by the end of the year when I have the time to write the report,
I try to obtain a response curve from my midtone speaker (Visaton W130S-8) by exiting it with white noise. The recording spectrum for a single trace is orange. There is so much noise it is not useful.
The spectrum analyzer I use offers averaging over 20 times. That is, the display is averaged over 20 traces. (Like the LeCroy spectrum analyzers did, if someone remembers that). The noise is considerable less, blue curve. That is to be expected. Noise is not correlated, so every averaging action will reduce noise.
Still I don't find the trace as smooth as the manufacturer's. What I did was applying a moving average filter as post-processing. The width of the averaging filter is 1/3 octave. So for each frequency I determined the frequency bin 1/6 octave lower, the frequency bin 1/6 octave higher and averaged over those bins. So for example for 400 Hz I averaged over frequencies between 256 Hz and 348 Hz. A total of 63 frequencies. As the frequencies become higher, the number of bins for 1/3 octave increases. FFT has a linear distribution, humans prefer a logarithmic presentation.
The postprocessing was performed on exactly the blue data. That is, I exported 16383 values which were displayed from the spectrum analyzer. Then applied the moving average with 1/3 octave width. The yellow line is the result.
The increase in level below 40 Hz may be caused by my microphone or microphone pre-amp. I don't care about it because I am interested in the range 200Hz - 3000Hz.
As a comparison I also post the manufacturer's trace.
I would say it is comparable and my method is useful. The question is, does it make sense?
I know that averaging the spectrum is useful for noise reduction. And it does. But it does not smooth. I know that 1/3 octave smoothing is performed by some spectrum analyzers. And it is a somewhat complicated process. What I did, smoothing by applying a moving average in the frequency domain, is that correct and useful in some way?
Or are the results unreliable and not physically correct? I do have access to the spectrum analyzer source code so I could implement the officially correct 1/3 octave smoothing. But if I can get away with this post-processing I'd prefer that. The project is improving my speaker, not improving my spectrum analyzer. On this moment at least.
The spectrum analyzer is AudMes, multi-platform and FOSS. https://github.com/swwa/audmes.git
Some more information: Not relevant for this thread but then you understand why I do this and why I need this.
What I am trying to do in the audio domain is this. The W130S is part of a hybrid active/passive system. Bass/Mid+High is actively filtered at 200 Hz. Mid/High is passively filtered at 3000 Hz. The relative levels of the speakers are correctly adjusted. The system sounds like total ****. No bass, no high. When looking up the manufacturer's specs I noticed a 6 dB increase in SPL between 200 Hz and 3000 Hz. That is 2 times as loud!
When I apply an exact reverse curve in my equalizer (in my Linux PC, PulseEffects) the system sounds smooth as a baby butt. Suddenly there is bass, suddenly there is treble. It is not so much that the mids are suppressed. But the bass and treble suddenly are present. At least that is the perception.
The system will be converted to fully active filtering. And I want to correct the active filter with the reverse frequency curve. So far I have been able to derive a way to design a correction network with an arbitrary n dB/oct filter with n < 6. Like a pinking filter but then for 2 or 4.5 dB/oct or whatever. Calculations of the filter are correct. Simulations are correct. If I apply the simulated curve to the manufacturer's response curve, the response is straight. Now is the time to build the filter and test it with the real speaker. And for that I need a decent frequency curve to see what I have achieved.
The theory on the arbitrary n dB/oct filter will be published by the end of the year when I have the time to write the report,
15th octave smoothing is not unusual, we tend not to hear the very high q resonances anyway so sometimes it can be helpful. However this is conditional on what has caused them. It’s better to focus on how you measure. Smoothing is not always needed, and other times you don’t have much choice, but anechoic measurements are usually smooth enough already.
I know free air is better. However. Either I measure during daytime but then there always is wind. Or when there is less wind at night I am supper for mosquitos. I tried. Really. The wind creates more noise than the room reflections.
Moreover with this post I asked for feedback on my smoothing method. Not so much on the measuring method. I know it is flawed. Once I have the analysis figured out I might do other attempts for measuring in free air. Maybe in the dry season but then there generally is more wind.
I see you use 1/24 octave analysis. I could try and vary my post processing for various widths and see how that affects the presentation. Right now this is a quick and dirty script with hard coded filter width. But I can change that for different values.
Do you do the 1/24 octave smoothing in your spectrum analyzer? Or as post processing?
It is re-assuring you use 20x averaging for SNR improvement.
Moreover with this post I asked for feedback on my smoothing method. Not so much on the measuring method. I know it is flawed. Once I have the analysis figured out I might do other attempts for measuring in free air. Maybe in the dry season but then there generally is more wind.
I see you use 1/24 octave analysis. I could try and vary my post processing for various widths and see how that affects the presentation. Right now this is a quick and dirty script with hard coded filter width. But I can change that for different values.
Do you do the 1/24 octave smoothing in your spectrum analyzer? Or as post processing?
It is re-assuring you use 20x averaging for SNR improvement.
People use this term a lot, it means measure the driver without the box and away from the table. It is often quite possible to take good measurements inside your room.for measuring in free air.
I know you are focussed on the smoothing process (I'll think about it later) but just to keep consistent terminology, this is not noise, but peaks and cancellations caused by sound wave reflections, right? They have different nature.There is so much noise it is not useful.
I always use REW 1/24 or 1/12 smoothing to extract a useful information.
When you can measured outdoor, there will be much less reflections.
I know it's difficult to measure outdoor, I have the same problem with wind, neighbor dogs, cars passing, rain etc. 🙂
I have implemented smoothing in the frequency domain by computing a weighted average of the FFT bins. I use RMS averaging to conserve energy. Peaks are reduced. As you noted, this type of smoothing is useful on continuous spectra (frequency response).
In contrast, discrete spectra (distortion) compute a maximum of neighboring bins. That preserves the amplitude of peaks but gives a distorted view of energy.
The FFT is lossless, but graphing the bins is not. Each method tells one truth along with one lie. 😉
Ed
In contrast, discrete spectra (distortion) compute a maximum of neighboring bins. That preserves the amplitude of peaks but gives a distorted view of energy.
The FFT is lossless, but graphing the bins is not. Each method tells one truth along with one lie. 😉
Ed
I am aware of the difference between noise and peaks+ cancellations. Maybe I did not describe it correctly in my original post. It is good that you point it out.I know you are focussed on the smoothing process (I'll think about it later) but just to keep consistent terminology, this is not noise, but peaks and cancellations caused by sound wave reflections, right? They have different nature.
The orange curve in the picture of the original post is full of noise. The peaks and cancellations are totally hidden by the noise.
The blue curve has much less noise due to averaging 20 times. Between say 100Hz and 400Hz the noise is so low that the said peaks and cancellations can be detected.
So yes, I literally wanted to smooth out those peaks and cancellations. Since they are narrow in nature they should smooth out. And give me a better picture of the trend and the average levels.
Tonight I will work on different widths of the moving average.I always use REW 1/24 or 1/12 smoothing to extract a useful information.
Does REW use gated measurements to not measure time delayed reflections? I do not use Windows so I cannot install REW.
Weighted average as in you use lower weights for the values further away from the center frequency? Convolution with a triangle instead of a square?I have implemented smoothing in the frequency domain by computing a weighted average of the FFT bins. I use RMS averaging to conserve energy.
What is RMS averaging? I can imagine what you mean, but how is it done?
Now I know what this is. A continuous spectrum. Thanks.Peaks are reduced. As you noted, this type of smoothing is useful on continuous spectra (frequency response).
Yes, I noticed that peaks can disappear completely. But then again those discrete spectra are different you are only interested in the peak heights and not so much in what happens in between the peaks.In contrast, discrete spectra (distortion) compute a maximum of neighboring bins. That preserves the amplitude of peaks but gives a distorted view of energy.
Isn't that the law of conservation of misery.The FFT is lossless, but graphing the bins is not. Each method tells one truth along with one lie. 😉
Ed
Which noise would it be?The orange curve in the picture of the original post is full of noise. The peaks and cancellations are totally hidden by the noise.
I think those wildly ups and downs (more downs than ups) in the orange graph are due to the peaks and cancellations.
If you observe the orange graph, it "oscillates" much more down, indicating cancelllations, then up (peaks). And, as we know, peaks in mid and high frequencies are less proeminent than cancellations, since in these frequencies, peaks are made of sums of weaker signals.
But cancellation signals can reach zero, so much more proeminent.
Noise in general is more random, so you would see a "cloud" around the graph and not a "cloud" more below the graph.
And in my experiences, when looking at the raw measurements (no smoothing), every indoor measurement I do, I get exactly the type of graph you've got in orange.
If I move the speaker outdoors and perform the same measurement, there is much less of this "cloud" below the graph, indicating less cancellations.
I'm not an expert, but I've being playing a lot with this during last months, so I'm talking about what I'm seeing in practical experiments.
Does it make sense?
Does REW use gated measurements to not measure time delayed reflections? I do not use Windows so I cannot install REW.
Yes, it has the option of gated measurements, but as I understood and tried out, it is more limited to mid/high frequencies (around >200Hz).
We have to better understand how smoothing process works. I tried a simple moving average in Excel and it was close to your blue curve, but I think this is not the way to go, since it didn't get exactly what REW does. The moving average would better smooth a random signal.So yes, I literally wanted to smooth out those peaks and cancellations. Since they are narrow in nature they should smooth out. And give me a better picture of the trend and the average levels.
The smoothing process seams to be a more complex computational process.
See below what the REW documentation says about it.
https://www.roomeqwizard.com/help/help_en-GB/html/graph.html
Just quoting a phrase from the link above:
"REW's smoothing uses multiple forward and backward passes of first order IIR filters to implement a Gaussian smoothing kernel of the chosen fractional octave bandwidth. For log spaced data those are IIR approximations to a Gaussian filter after Alvarez-Mazorra. For linear spaced data the time constant of the first order filter is varied according to the sample index to reflect the equivalent fractional octave bandwidth desired at the frequency of the sample."
- Home
- Design & Build
- Software Tools
- Spectrum smoothing in the frequency domain - does this make sense?