psmokotnin / osm

Open sound meter. FFT based application for tuning sound systems.
GNU General Public License v3.0
222 stars 35 forks source link

Applying a low pass filter to a stored measurement isn't resulting in the expected filtering #72

Closed ross closed 1 year ago

ross commented 1 year ago

I have a completely raw/default measurement of a single sub (with OK coherence all above .7 in case that's relevant)

Screen Shot 2023-08-28 at 7 24 51 PM

and a 10th order Butterworth LP filter at 100Hz.

Screen Shot 2023-08-28 at 7 25 12 PM

I then created a math source and set it to Apply with the stored measurement and the lp filter:

Screen Shot 2023-08-28 at 7 27 23 PM

I expected the math source to preserve the sub measurement below 100Hz and quickly attenuate the signal above it, but as you can see in the image above it has no effect until 357Hz.

To check my approach I switched to a high pass filter @ 100Hz and quickly generated a signal and measurement with my laptop. I get the expected behavior in this case where the measurement has some signal below 100Hz, but when the high pass filter is applied to it that response is attenuated roughly in line with the filter's fall off.

Screen Shot 2023-08-28 at 7 31 27 PM

Anyway, not sure if my setup and/or expectations are wrong.

I've enjoyed playing around with the software over the past couple days or so and have managed to hand tune my home system fairly well with it as I've been experimenting. I was looking to model various cross over points and I would like to play around with seeing if I could code up the ability to simulate the effects of PEQ, I guess similar to https://github.com/psmokotnin/osm/issues/69.

Regardless thanks for all the work you've put into OSM.

ross commented 1 year ago

Figured out what was up. The measurement was taken at 192kHz and the low pass filter was set to 48kHz.

When I change the LP filter to 192kHz

Screen Shot 2023-08-29 at 12 51 25 PM

I guess I assumed that since it forces the same transform mode that it was also forcing the same sample rate to be used so I didn't check to see what the rate of the measurement was once the math apply started displaying data.

With the sample rate matched I get the expected behavior:

Screen Shot 2023-08-29 at 12 54 12 PM

I'll go ahead and leave this open in case the same rate mis-match should be an error the same way that source size is. Feel free to close if not.

psmokotnin commented 1 year ago

I am glad you figured out why there was an issue. I'll add to my task list a new task to check all the sources have a common sample rate.