1
$\begingroup$

I have noticed that all filter taps from the firdes class are normalized by dividing them over the sum of all taps magnitude, as shown in the example below for Gaussian Filter. Is this normalization meant to keep the filter unit energy (or power)? and if that is the case, what is the mathematical justification for doing so in this way?

vector<float> firdes::gaussian(double gain, double spb, double bt, int ntaps)
{
    vector<float> taps(ntaps);
    double scale = 0;
    double dt = 1.0 / spb;
    double s = 1.0 / (sqrt(log(2.0)) / (2 * GR_M_PI * bt));
    double t0 = -0.5 * ntaps;
    double ts;
    for (int i = 0; i < ntaps; i++) {
        t0++;
        ts = s * dt * t0;
        taps[i] = exp(-0.5 * ts * ts);
        scale += taps[i];
    }
    for (int i = 0; i < ntaps; i++)
        taps[i] = taps[i] / scale * gain;

    return taps;
}
$\endgroup$
1
  • 1
    $\begingroup$ Looks like $0$ dB gain at DC to me. $\endgroup$
    – Andy Walls
    Commented Jul 30, 2021 at 0:43

1 Answer 1

1
$\begingroup$

I have noticed that all filter taps from the firdes class are normalized by dividing them over the sum of all taps magnitude

Not strictly:

for (int i = 0; i < ntaps; i++)
    taps[i] = taps[i] / scale * gain;

is not summing over the magnitude, but over the taps.

(doesn't make a difference here, all these taps are positive real numbers, but for other filters it would.)

So, @AndyWalls is right, this is the DC gain, and you're normalizing this low-pass filter to have gain 1 at 0 Hz.

Think about this for a moment: when you feed in a constant streams of "1", what value do you want to get?

$\endgroup$
3
  • $\begingroup$ One additional question. I take it the 0 dB gain at DC keeps the amplitude constant? What happens to the output energy per sample? For example, what will be the output power through an SRRC filter (0 dB gain at DC) when the signal is upsampled by a factor of Q? How about downsampling by a factor of P? $\endgroup$ Commented Aug 4, 2021 at 9:49
  • $\begingroup$ I don't get the question, sorry. If the amplitude is the same, so is the power, since power = amplitude² $\endgroup$ Commented Aug 4, 2021 at 10:03
  • $\begingroup$ Sorry. I meant energy per symbol. What happens when you insert Q - 1 zero (upsampling) or retaining Pth samples (downsampling)? $\endgroup$ Commented Aug 4, 2021 at 10:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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