Skip to main content

Matched Filter Explained


Matched Filter: Theory and MATLAB Example

A matched filter is a linear filter designed to maximize the signal-to-noise ratio (SNR) for detecting a known signal in the presence of additive noise. It is widely used in communications, radar, and sonar.

1. Definition

If the known signal is s(t) with duration T, the impulse response of the matched filter is:

h(t) = s*(T - t)

In discrete time, for a signal s[n] of length N:

h[n] = s*[N-1-n]

2. Example: Rectangular Pulse

Consider a simple rectangular pulse:

s(t) = {

  1, 0 ≤ t ≤ 2

  0, elsewhere

}

Matched filter:

h(t) = s(2 - t)
s(t):      ┌───────┐
           |       |
───────────┘       └────────
           0       2

h(t):              ┌───────┐
                   |       |
───────────--------        |
          0        2

3. MATLAB Simulation Example

We can implement a simple matched filter in MATLAB using a rectangular pulse:

% MATLAB Code: Matched Filter Example

% Parameters
T = 2;           
Fs = 100;        
t = 0:1/Fs:T-1/Fs;  

s = ones(1,length(t));

noise = 0.5*randn(size(s)); 
r = s + noise;

h = fliplr(s);

y = conv(r,h);

t_y = 0:1/Fs:(length(y)-1)/Fs;

figure;

subplot(3,1,1);
plot(t,s,'LineWidth',2);
title('Transmitted Signal s(t)');
xlabel('Time (s)');
ylabel('Amplitude');

subplot(3,1,2);
plot(t,r,'LineWidth',1.5);
title('Received Signal r(t) = s(t) + Noise');
xlabel('Time (s)');
ylabel('Amplitude');

subplot(3,1,3);
plot(t_y,y,'LineWidth',2);
title('Matched Filter Output y(t)');
xlabel('Time (s)');
ylabel('Amplitude');

Explanation:

  • s is the known transmitted pulse.
  • r is the received signal corrupted by Gaussian noise.
  • h is the matched filter (time-reversed pulse).
  • y is the convolution output showing a peak at the point of maximum alignment, which corresponds to the detection instant.
The peak of y(t) corresponds to the maximum correlation between the received signal and the known pulse, demonstrating the matched filter's ability to detect the signal in noise.

Peak Location of the Matched Filter Output

The peak of the matched filter output does not necessarily occur at the midpoint of the pulse. It occurs at the end of the pulse duration (t = T), which is the point where the entire pulse has “slid” across the filter.

1. Why the peak is at t = T

Matched filter:

h(t) = s(T - t)

Output:

y(t) = ∫₀แต€ r(ฯ„) · h(t - ฯ„) dฯ„
  • At t = 0 → small overlap → small output
  • As t increases → overlap increases → output grows
  • At t = T → full alignment → maximum output

2. Example with numbers

Pulse s[n] = [1, 2, 3], duration T = 3 samples
Matched filter h[n] = [3, 2, 1]

Convolution output y[n] = s[n] * h[n] = [3, 8, 14, 8, 3]

  • n = 0 → small
  • n = 1 → larger
  • n = 2 → peak
  • n > 2 → output decreases

Peak occurs where the full pulse aligns with the filter, not at the midpoint.

4. Summary

Matched filters leverage the known structure of a signal to produce a maximum output at the detection instant, allowing reliable detection even in the presence of noise. The impulse response is always the time-reversed and conjugated version of the transmitted signal. MATLAB simulation confirms that the filter output peaks exactly when the received pulse is aligned with the filter.

If you want, I can draw a tiny diagram showing the sliding pulse and peak at t = T — it really helps people see why it’s the end of the pulse, not the middle, that matters.

Further Reading

People are good at skipping over material they already know!

View Related Topics to







Contact Us

Name

Email *

Message *

Popular Posts

BER vs SNR for M-ary QAM, M-ary PSK, QPSK, BPSK, ...(MATLAB Code + Simulator)

Bit Error Rate (BER) & SNR Guide Analyze communication system performance with our interactive simulators and MATLAB tools. ๐Ÿ“˜ Theory ๐Ÿงฎ Simulators ๐Ÿ’ป MATLAB Code ๐Ÿ“š Resources BER Definition SNR Formula BER Calculator MATLAB Comparison ๐Ÿ“‚ Explore M-ary QAM, PSK, and QPSK Topics ▼ ๐Ÿงฎ Constellation Simulator: M-ary QAM ๐Ÿงฎ Constellation Simulator: M-ary PSK ๐Ÿงฎ BER calculation for ASK, FSK, and PSK ๐Ÿงฎ Approaches to BER vs SNR What is Bit Error Rate (BER)? The BER indicates how many corrupted bits are received compared to the total number of bits sent. It is the primary figure of merit for a...

Online Simulator for ASK, FSK, and PSK

Try our new Digital Signal Processing Simulator!   •   Interactive ASK, FSK, and BPSK tools updated for 2025. Start Now Interactive Modulation Simulators Visualize binary modulation techniques (ASK, FSK, BPSK) in real-time with adjustable carrier and sampling parameters. ๐Ÿ“ก ASK Simulator ๐Ÿ“ถ FSK Simulator ๐ŸŽš️ BPSK Simulator ๐Ÿ“š More Topics ASK Modulator FSK Modulator BPSK Modulator More Topics Simulator for Binary ASK Modulation Digital Message Bits Carrier Freq (Hz) Sampling Rate (...

Constellation Diagrams of ASK, PSK, and FSK (with MATLAB Code + Simulator)

Constellation Diagrams: ASK, FSK, and PSK Comprehensive guide to signal space representation, including interactive simulators and MATLAB implementations. ๐Ÿ“˜ Overview ๐Ÿงฎ Simulator ⚖️ Theory ๐Ÿ“š Resources Definitions Constellation Tool Key Points MATLAB Code ๐Ÿ“‚ Other Topics: M-ary PSK & QAM Diagrams ▼ ๐Ÿงฎ Simulator for M-ary PSK Constellation ๐Ÿงฎ Simulator for M-ary QAM Constellation BASK (Binary ASK) Modulation Transmits one of two signals: 0 or -√Eb, where Eb​ is the energy per bit. These signals represent binary 0 and 1. BFSK (Binary FSK) Modulation Transmits one ...

Power Spectral Density Calculation Using FFT in MATLAB

๐Ÿ“˜ Overview ๐Ÿงฎ Steps to calculate the PSD of a signal ๐Ÿงฎ MATLAB Codes ๐Ÿ“š Further Reading Power spectral density (PSD) tells us how the power of a signal is distributed across different frequency components, whereas Fourier Magnitude gives you the amplitude (or strength) of each frequency component in the signal. Steps to calculate the PSD of a signal Firstly, calculate the fast Fourier transform (FFT) of a signal. Then, calculate the Fourier magnitude (absolute value) of the signal. Square the Fourier magnitude to get the power spectrum. To calculate the Power Spectral Density (PSD), divide the squared magnitude by the product of the sampling frequency (fs) and the total number of samples (N). Formula: PSD = |FFT|^2 / (fs * N) Sampling frequency (fs): The rate at which the continuous-time signal is sampled (in ...

UGC NET Electronic Science Previous Year Question Papers

Home / Engineering & Other Exams / UGC NET 2022 PYQ ๐Ÿ“ฅ Download UGC NET Electronics PDFs Complete collection of previous year question papers, answer keys and explanations for Subject Code 88. Start Downloading UGC-NET (Electronics Science, Subject code: 88) Subject_Code : 88; Department : Electronic Science; ๐Ÿ“‚ View All Question Papers UGC Net Electronic Science Question Paper With Answer Key Download Pdf [June 2025] with full explanation UGC Net Electronic Science Question Paper With Answer Key Download Pdf [December 2024] UGC Net Paper 1 With Answer Key Download Pdf [Sep 2024] with full explanation UGC Net Electronic Science Question Paper With Answer Key Download Pdf [Aug 2024] with full explanation UGC Net Paper 1 With Answer Key Download...

FM Modulation Online Simulator

Frequency Modulation Simulator Message Frequency (fm): Hz Carrier Frequency (fc): Hz Carrier Amplitude (Ac): Modulation Index (ฮฒ): Frequency deviation ฮ”f = ฮฒ × fm Online Signal Processing Simulations Home Page >

Theoretical vs. simulated BER vs. SNR for ASK, FSK, and PSK (MATLAB Code + Simulator)

๐Ÿ“˜ Overview ๐Ÿงฎ Simulator for calculating BER ๐Ÿงฎ MATLAB Codes for calculating theoretical BER ๐Ÿงฎ MATLAB Codes for calculating simulated BER ๐Ÿ“š Further Reading BER vs. SNR denotes how many bits in error are received for a given signal-to-noise ratio, typically measured in dB. Common noise types in wireless systems: 1. Additive White Gaussian Noise (AWGN) 2. Rayleigh Fading AWGN adds random noise; Rayleigh fading attenuates the signal variably. A good SNR helps reduce these effects. Simulator for calculating BER vs SNR for binary ASK, FSK, and PSK Calculate BER for Binary ASK Modulation Enter SNR (dB): Calculate BER Calculate BER for Binary FSK Modulation Enter SNR (dB): Calculate BER Calculate BER for Binary PSK Modulation Enter SNR (dB): Calculate BER BER vs. SNR Curves MATLAB Code for Theoretical BER % The code is written by SalimWireless.Com clc; clear; close all; % SNR va...

ASK, FSK, and PSK (with MATLAB + Online Simulator)

๐Ÿ“˜ ASK Theory ๐Ÿ“˜ FSK Theory ๐Ÿ“˜ PSK Theory ๐Ÿ“Š Comparison ๐Ÿงฎ MATLAB Codes ๐ŸŽฎ Simulator ASK or OFF ON Keying ASK is a simple (less complex) Digital Modulation Scheme where we vary the modulation signal's amplitude or voltage by the message signal's amplitude or voltage. We select two levels (two different voltage levels) for transmitting modulated message signals. Example: "+5 Volt" (upper level) and "0 Volt" (lower level). To transmit binary bit "1", the transmitter sends "+5 Volts", and for bit "0", it sends no power. The receiver uses filters to detect whether a binary "1" or "0" was transmitted. Fig 1: Output of ASK, FSK, and PSK modulation using MATLAB for a data stream "1 1 0 0 1 0 1 0" ( Get MATLAB Code ) ...