Here is a bunch of code from MATLAB documentation: Designing a Basic Monostatic Pulse Radar:

wav = phased.RectangularWaveform(...
matchingcoeff = getMatchedFilter(wav);

hmf = phased.MatchedFilter(...

[rx_pulses, mfgain] = step(hmf,rx_pulses);

How MATLAB calculates the mfgain (matched filter gain)? Any formula for that?


2 Answers 2


Matched filter gain is calculated as (in dB):

  • $G_{dB} = 10 \cdot \log_{10}(L)$,

where $L$ - is filter length. It's maximum possible SNR improvement that filter can provide.

Try this formula and compare result with MATLAB one. I suppose it will be the same.


Actually, if you dig into the code you'll find that MATLAB calculates the gain with the following:

obj.pMFGain = pow2db(real(obj.Coefficients'*obj.Coefficients));

Here obj is the AbstractMatchedFilter object and Coefficients are the matched filter coefficients, which, in the simplest form, is the model of your waveform sampled at the same rate as your input signal. When MATLAB calculates the matched filter, these coefficients are complex.

Note the '* in the line above, which makes this a dot-product. (sum of squares).


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.