# How to create a frequency weighted measurement? / How to design a Pinking FIR Filter?

Disclaimer: I have read a lot about signal processing, but I taught everything myself and therefore have some gaps in theory and practice.

I am currently working on a measurement software that is supposed to calibrate the loudspeakers to the listening position. For this, I use maximum sequences (MLS) as excitation signal. The calibration algorithm works so far that I can calculate an impulse response and a corresponding frequency response. Now I have noticed that with MLS signals 90% of the energy is on the high frequency range and I would like to build a low pass filter that has -3dB per octave ("pinking filter"), which I then apply to the excitation signal and inverted to the measured signal. Since it will be used to measure the listening position/speaker, I thought it's best to make it a linear-phase FIR filter. However, when designing this filter I just can't get any further and only find rough approaches, or IIR filters in Laplace form. As a filter designer, I have tried: http://t-filter.engineerjs.com, but I can't get anywhere near what I want. Also, I found this page: https://www.firstpr.com.au/dsp/pink-noise/, which is probably often shared on this topic, but even from it I do not manage to extract a reasonable filter.Does anyone have a suggestion how I can continue? Is the way I chose the right one?

P.s. In the end I want to program everything in c++, which is why I need to understand every step, so most Matlab examples don't help me.

• I'd argue that code in any language you're able to read wouldn't be that bad, you'll translate anything you'd learn into "your" C++ anyways (and if you're able to write C++, reading not-overcomplicating MATLAB code is probably a-ok) :) But, yeah, understanding is the primary goal. Commented Jun 13, 2022 at 13:18
• True, but I meant that I can't do anything with Matlab commands like "pinknoise(z)", because I still don't understand how it works. Commented Jun 13, 2022 at 14:56