0
$\begingroup$

I am writing some simple matlab code to refresh my convolution knowledge (it has been awhile) in regards to DSP. I have an input signal x and a filter -

x = [1 3 6 2 8];
h = [2 9 5 3];
y=conv(x,h); 

which results in

y = [2 15 44 76 73 100 46 24];

I understand these values are large because convolution has lots of multiplication and addition, however if this was an audio signal I was trying to filter, these values seem very large.

Do I need to scale the input filter or output signal some how? If so which one and by how much?

$\endgroup$
1
$\begingroup$

In practice you would make sure that your filters don't have very large gains, at least not over a large frequency range. The filter you're using in the given example has a maximum gain of almost $26$ dB (at DC), and the gain is no less than $12$ dB for any frequency. I.e., you're applying a flat gain of $12$ dB, and on top of that you boost a relatively wide band around DC by another $14$ dB. This is not what a typical filter for audio signals would do, unless you make sure that the input signal is small enough and the additional gain is really needed.

$\endgroup$
2
  • 1
    $\begingroup$ ok, so there is nothing I would have to do to this filter in theory. I understand somewhat how to calculate filter coefficients so I get the gain and phase I want. I just wanted to tell if I am missing a step in this process or not. I guess this was just a really bad example filter to use. $\endgroup$ – scott Dec 22 '20 at 23:27
  • 1
    $\begingroup$ @scott: You would normally scale that filter such that its average gain is not that large, but it was indeed not a very representative example for audio processing. $\endgroup$ – Matt L. Dec 23 '20 at 8:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.