Recreating matlab second order filter in python I want to create some custom filters in Matlab filterDesigner tool and then apply those filters to a large set of audio files. I want to use python to do the application of the filters to the audios.
I created a Butterworth filter in Matlab and exported it as an ASCII file. In there I get two datas. SOS Matrix and Scale Values. Then I read the file in python and got the SOS matrix and filtered my signal using the result as follows (using scipy.sosfilt)
from scipy import signal

x_sos = signal.sosfilt(sos, x)  # x is my signal

The result I get has the desired shape except for the amplitude being different (I applied the same filter in Matlab and compared the output from the python code). I understand that scale values needs to come into this equation. But how do I incorporate that? I don't understand this answer. This question has answers explaining the scale values but still I have no idea how I should use that in the python code

EDIT: (After getting the answer) To anyone who is interested in the final code, here it is. And there's an explanation again in this thread
from scipy import signal
import numpy as np

x_sos = signal.sosfilt(sos, x) * np.prod(scale)  # x is my signal
The scale values should be all $1$ except for the first Unless that's $1$ too. Multiply your output signal with that first scale value OR multiply the first three numbers in the first three row of you SOS matrix with that number before filtering.
EDIT
Turns out the filter designer makes this more convoluted than it needs to be. Just multiply all the scale values and multiply output with the product.