I know that you can calculate the gain of a low-pass filter by summing the filter coefficients. I don't know how to calculate the gain of an arbitrary matched filter.
For instance, I have created a matched filter for an 802.11a long training symbol (for the purposes of this question that detail doesn't matter- just thought some of you might be curious). My MATLAB code for creating the filter is:
longSymFreq = [0 1 -1 -1 1 1 -1 1 -1 1 -1 -1 -1 -1 -1 1 1 -1 -1 1 -1 1 -1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 ...
1 1 -1 -1 1 1 -1 1 -1 1 1 1 1 1 1 -1 -1 1 1 -1 1 -1 1 1 1 1];
longSymTime = ifft(longSymFreq);
intentionalTimeOffset = 4;
% Barrel shift by intentionalTimeOffset to avoid the corruption of the early data samples. Due to the
% cyclic prefix doing this is not a problem.
longSymTime = [longSymTime(end-(intentionalTimeOffset-1):end) longSymTime(1:end-intentionalTimeOffset)];
longSymFilter = conj(fliplr(longSymTime));
The sum of this filter is 6.938893903907228e-018 +3.122502256758253e-017i
. The average of the absolute value of the taps, though, is 0.107538417337840
, so clearly the sum is not giving me any information on what kind of gain I will get when the filter gets the matched signal.
How do I calculate that gain? The reason I care is because my final filter will be fixed-point, and I can't have an overflow when I get the signal that I'm looking for.
Is the gain the energy of the filter?