(3 votes, average: 3.33 out of 5)
Loading ...

# BER with Matched Filtering

by on May 8, 2009

In the post on transmit pulse shaping filter, we had discussed pulse shaping using rectangular and sinc. In this post we will discuss about optimal receiver structure when pulse shaping is used at the transmitter. The receiver structure is also called as matched filter. For the discussion, we will assume rectangular pulse shaping, the channel is AWGN only and the modulation is BPSK.

## Transmitter

The simplified transmitter structure is as shown below:

Transmit pulse shaping filter

Figure: Transmit block diagram

The sequence of operation are as follows:

a). The random binary data comes as input to the the BPSK modulator circuit.

b). The BPSK modulator maps bits to symbols i.e bit0 to -1 and bit1 to +1

The sequence of transmit symbols maybe visualized as follows.

Figure: Transmit symbols for baseband PAM transmission

c). The upsampling block (the block with upward arrow) insert zeros between the samples based on the oversampling factor. For example, if the oversampling factor is 4, the block inserts 3 zeros between samples.

d). The last block in the chain is the filter, where the upsampled sequence is convolved with the filter. In this example, we have assumued rectangular filtering (also known as zero order hold), i.e. to repeat the current symbol till the next symbol arrives and so on. Mathematically, the filter can be represented as,

$\begin{eqnarray}g(t)&=&1,\mbox{ } 0\le t < T\\&=& 0\mbox{ } \mbox{elsewhere}\end{eqnarray}$.

The filtered waveform can be as shown below.

Figure: Baseband PAM transmisison with rectangular filtering

The transmit spectrum assume that the symbol duration $T=1\mu s$ is shown below.

Figure: Transmit spectrum for rectangular matched filter

## Matched filter Receiver

The filter having an impulse response $h(t) = g(T-t)$ is called a matched filter of $g(t)$.

Matched filter response for rectangular pulse

Figure: Matched filter response for a rectangular pulse shaping filter

In this example, as $g(t)$ is a rectangular function, the mtched filter is also rectangular.

We pass the received signal $s(t)$ through the matched filter $h(t)$. The output of the convolution peaks at time $T$ and we sample the at that time instant to perform the demodulation.

Further, if the filtered transmit signal $s(t)$ is corrupted by noise, the filter with impulse response matched to $s(t)$ maximizes the output Signal to Noise Ratio. The proof for this claim is detailed in Chapter 5.1.2 Matched Filter Demodulator in Digital Communications by John Proakis.

## Simulation Model

The Matlab/Octave script performs the following

(a) Generate random binary sequence of +1′s and -1′s.

(b) Upsample by inserting zeros and the convolve with rectangular filter

(c) Add white Gaussian noise.

(d) Convolve the received samples with matched filter, and extract output at time T

(e) Perform hard decision decoding and count the bit errors

(f) Repeat for multiple values of $\frac{E_b}{N_0}$ and plot the simulation and theoretical results.

Figure: BER plot for BPSK with rectangular pulse shaping and matched filtering

## Observations

Can see that the simulated results are in good agreement with the theoretical BER results for BPSK in AWGN in AWGN.

## References

D id you like this article? Make sure that you do not miss a new article by subscribing to RSS feed OR subscribing to e-mail newsletter. Note: Subscribing via e-mail entitles you to download the free e-Book on BER of BPSK/QPSK/16QAM/16PSK in AWGN.

{ 38 comments… read them below or add one }

nabil December 31, 2012 at 6:15 pm

HELLO SIR,
we r doing project on modulation and demodulation of OFDM signal.
and having problem in QAM modulation.can u help us ???
we shall b very thankfull to u
nabil akram

Reply

Krishna Sankar January 2, 2013 at 5:37 am

@nabil: For posts on general M-QAM modulation with OFDM, please check out
http://www.dsplog.com/2012/01/01/symbol-error-rate-16qam-64qam-256qam/

Reply

comm-eng December 19, 2012 at 8:58 pm

i didnot get the concept why we use upsampling

Reply

Krishna Sankar December 20, 2012 at 6:11 am

@comm-eng: at a sampling frequency fs, we are limited to ‘seeing’ frequencies from [-fs/2 to fs/2). Typically, if we wish to see a higher frequency range, upsampling is used.

Reply

abdou November 13, 2012 at 4:45 pm

hello sir . i have question .
why the BER as function of SNR don’t change with filter shaping and without it .i think the fitter shaping reduce ISI so reduce BER,
i simulated the BER of Bpsk and Qpsk with and without the raised cosine filter but the result is almost the same , help me please

Reply

Krishna Sankar November 18, 2012 at 7:07 am

@abdou: To understand the effect of ISI, compute the error vector magnitude (EVM) between the received symbol and transmitted symbol for the two cases. If the EVM is below -30dB or so, it will have negligible impact on the BER for BPSK/QPSK (which has a 10^-4 ber at 12dB ish Eb/N0).

Reply

jaspreet October 30, 2012 at 4:47 pm

plz help me to make ISI channel

Reply

Krishna Sankar November 2, 2012 at 7:08 am

@jaspreet: Please check out posts under
http://www.dsplog.com/category/channel/

Reply

Sapphire November 5, 2010 at 8:28 am

Hello sir,
about the awgn…Why don’t we use awgn() function of matlab directly to the signal?
about the rectangular shaping filter…Why don’t we use rectpulse() of matlab too instead of upsampling with zeros?

Thank you..

Reply

Krishna Sankar November 14, 2010 at 10:38 am

@Sapphire: No special reason, personal choice. I wish to use the bare minimum build blocks, so that I understand each function better

Reply

uma March 16, 2010 at 10:33 pm

hello sir…
how to downsample the received UWB signal ??kindly help us with matlab code sir…

Reply

Krishna Sankar March 28, 2010 at 2:28 pm

@Uma: Sorry, I have not tried modeling UWB signals

Reply

sindhu March 16, 2010 at 2:17 pm

hello sir,
we r doin final year project.. sir please can you help us to downsample the received uwb signal.. kindly send us the matlab code for that sir..

Reply

Krishna Sankar March 28, 2010 at 2:32 pm

@jennifer: Sorry, I have not tried modeling UWB signals. However,
for downsampling by factor of 2, take one sample every two samples;
for downsampling by factor of 3, take one sample every three samples; and so on

Reply

Amjad February 18, 2010 at 7:49 am

I have one question, how can we do the mapping for 2-PPM, I mean If we have ’0′ bit to transmit, map the rectangular pulse at 01(decimal 1) for the first time slot and if we have ’1′, map the rectangular pulse at 10(decimal 2) for the 2nd time slot. if you advise me

Reply

Krishna Sankar March 31, 2010 at 5:42 am

@Amjad: Seems you are looking for BPSK transmission? http://www.dsplog.com/2007/08/05/bit-error-probability-for-bpsk-modulation/

Reply

vasanth October 27, 2009 at 12:03 pm

hello sir,
I’m doing receiver design of Cdma communications, i need to design matched filter for that can help regarding its internal structure…

Reply

Krishna Sankar November 8, 2009 at 7:18 am

@vasanth: You might want to know the transmit pulse shaping filter which was used. You may try with rectangular, raised cosine, Gaussian pulse shapes.

Reply

vikas September 2, 2009 at 9:42 am

hi…i just went thru ur code….
what if i use ral noise insteadf of complex noise,,,,,
performance should change or not??
I am getting changed performance….can u tell whtz the reason??

Reply

Krishna Sankar September 7, 2009 at 5:43 am

@vikas: If its BPSK modulation, and you do the scaling correctly, there should not be any difference in performance.

Reply

Wig August 7, 2009 at 7:00 am

Sorry~ I already solving it yesterday, the fading channel
have to assuming “slow fading” , a symbol was affected
by a fading.

thank you~! this is a very good blog!

Reply

Krishna Sankar August 10, 2009 at 5:57 am

@Wig: Glad to hear that. Good luck for your future algorithm investigations.

Reply

Wig August 5, 2009 at 6:19 pm

hello ~

I tried this method , BPSK with MF over “fading channel”, it has a big

problem, if I change sampling time (ts), then the BER change,too! I

think its power need normalize? But I’m not sure…

I wish you can solve my problem. thanks a lot!!

Reply

Krishna Sankar August 10, 2009 at 5:50 am

@Wig: If BER is changing with sampling time, quite likely its a power normalization issue. Hope the code in the attached post might be of help to you.

Reply

Saria July 9, 2009 at 8:47 am

Another question, in the recieving side the code
ySamp = yFilt(os:os:N*os); % sampling at time T

why not using
ySamp = yFilt(1:os:N*os);

Reply

Krishna Sankar July 15, 2009 at 4:58 am

@Saria: We are taking at the output of matched filter. For optimal performance, we need to let the matched filter run for the time ‘os’ and then tap the value. If we were to do as what you have proposed, then our performance will be poorer. You can experiment in the code and try.

Reply

Khan March 26, 2012 at 5:24 pm

I think you are trying to pick sample for the symbol with max energy, am I right? Thats what downsampling will do in matlab. If we have more than 1 samples per symbol we pick max sampling while downsampling or we could have picked avg of all, but this would be a poor performance as you rightly said.

regards

Reply

Krishna Sankar March 30, 2012 at 6:24 am

@Khan: The idea is take all the information which is available i.e. for a rectangular pulse shaping, we accumulate over the rectangular window and use.

Reply

Saria July 9, 2009 at 8:28 am

Dear Khrishna, thank you forever! you are really helping us. I would like to ask in the transmit filter you multiplied the result of convolution by 1/sqrt(os), why? and why you didnot use this factor in the matched filter at the reciever side?

Reply

Krishna Sankar July 15, 2009 at 4:56 am

@Saria: The multiplication by 1/sqrt(os) is to normalize the transmit power to 1. Recall: We are sending the same information os times. We do this at the transmitter, because we want to scale the transmit power accordingly to make our Eb/N0 definition correct.
At the receiver, we do not have such constraints.

Reply

Khan March 26, 2012 at 5:21 pm

Hi Krishna,

You are a great help, Just to check I have calculated the power for sFilt which is

sum(abs(sFilt))/length(sFilt)

this doesnt c0me to 1, am I doing something wrong?

regards

Reply

Krishna Sankar March 26, 2012 at 7:37 pm

@Khan: You might want to do sum of the powers and not sum of absolute values.
octave:16> sum(abs(sFilt).^2)/length(sFilt)
ans = 0.20000

I think 0.2 is because of oversampling ratio of 1/5.

Reply

communications_engineer May 9, 2009 at 10:06 am

I have two questions,

1) Why do we need to upsample?

2) Why is the impulse response of the matched filter for g(t) equal to g(T-t)? I know we always use this kind of relation when ever we write an equation for a signal recieved at the receiver. Maybe I dont understand the “(T-t)” thing

Reply

Krishna Sankar May 12, 2009 at 5:32 am

@communications_engineer: My replies
1) When doing digital domain, the frequencies which we can ‘see’ are limited by the sampling rate. For eg, if the sampling rate is fs, the frequencies which we can see is from [-fs/2 to fs/2). Typically, when doing digital frequencies, you would want to control the frequency response over a wider frequency range (else spectrum just repeats as +/-k*fs), hence we do upsampling.

2) g(T-t) stands for time reversed version of g(t). Does that help?

Reply

communications_engineer May 13, 2009 at 12:18 pm

So we take the upsampling factor that is equal to the twice of the edge frequency till which we want to control the frequency response – right?

Reply

Krishna Sankar May 20, 2009 at 5:09 am

@communications_engineer: Correct

Reply

communications_engineer May 9, 2009 at 9:34 am

Hello Krishna, another gem of an article. We all owe you for the work that you are doing.

May I suggest/request you that please extend this post as a series where we discuss Maximum likelihood, Log-likelihood and MAP detection

Or you explain the Single user detection and Multiuser detection. Most strategies used here, we have already discussed in MIMO systems like (ZF, MRC, EQC, MMSE, SIC, PIC) so please put some tutorials over here for CDMA before any other topic.

Thanks again Krishna

Reply

Krishna Sankar May 12, 2009 at 5:28 am

@communications_engineer: Kind words indeed. Thanks. All the above topics are there in my TO-DO list. Hopefully, slowly we cover them….

Reply

Previous post:

Next post: