Processing of Digital Samples
Processing of Digital Samples
I NTRODUCTION
1
This is the introduction of the laboratory report, where the topic
of the laboratory exercise and the objectives to be pursued are be
described, in order to put in context the answers to the questions that 0.8
will follow next.
Amplitude
0.6
I. A NSWER TO Q UESTION 1
In the first section we have to generate raised cosine with a roll-
0.4
off factor of 0.35, 20 length of the pulse in units of symbols and
25 number of samples per symbol. To generate the raised cosine we
will use one sample. The raised cosine is generated by the fucntion 0.2
pam sqrrc.
0
SQRRC Pulse Shape
1.2
-0.2
0 100 200 300 400 500 600
1 Samples
Fig. 2: Modulated word 1010 with the raised cosine generated before.
0.8
Where r[n] is the signal, h[n] is the impulse response of the filter
Amplitude
0.6
and r∗ [n] is the conjugate of the signal.
The Overlap and Add method is implemented in the function
0.4 overlap add and we follow the steps given in the statement to
implement it.
0.2
A. Initialisation
First of all we have defined the number of coefficients of the filter
0
as M, the length of the signal as Ls, the size of our blocks, defined
by L, are 2*M. We define Llast as the rest of the division of Ls by
-0.2 L. N is the size of the convolution of the signal and the filter.
0 100 200 300 400 500 600
Samples B. Compute H
Fig. 1: Raised cosine generated with roll-off factor 0.35, pulse length We compute the DFT of H in N samples to force H and final signal
20 symbols, and 25 samples per symbol. have the same length. We store the result in a vector denoted H.
C. Compute Rm
In this image we can see the raised cosine generated with the
First we define the quantity of rows that the matrix rm has. Each
parameters given in the statement. This type of pulse is useful to avoid
row correspond to one block, so its size is (nRows x L). Before filling
ocupation of the spectrum and to avoid inter-symbol interference.
the matrix we initialized with function zeros() to avoid future errors.
In the Figure 2 we can see a word of 4 bits, the word is 1010.
Then, for each block (row) we compute the DFT of size N in order
This word is modulated with the raised cosine generated before.
to have the same length of samples as H. The result is stored in the
II. A NSWER TO Q UESTION 2 (nRows x N) matrix Rm.
In this section we have to implement the Overlap and Add method D. Compute Ym
to process a digital signal. We part from the base that we have We compute Ym = Rm ·H, the product of DFT of the input signal,
a large signal and we want to process it in blocks to avoid large Rm , with the DFT of the filter coefficients. Both of them have the
computational cost. To do this we will use a linear property of the same length. Ym has to be a (nRows × N ) matrix, so H has to be
convolution: also a (1 × N ) vector. We did this by using the function repmat.
(r[n] + r∗ [n]) ∗ h[n] = r[n] ∗ h[n] + r∗ [n] ∗ h[n] (1) Ym = Rm · repmat(H, nRows, 1) (2)
E. Obtain ym Overlap & Match
30
−1
We obtain ym = DFT {Ym }, by applying the inverse discrete
Fourier transform (IDFT) to Ym . We have used the matlab function
ifft (). 20
Amplitude
ym have to be added with the last M − 1 samples of the previous 0
vector.
First, we initialize the output vector y with zeros. Next, we
initialize the index of y that will be incremented by L in each -10
iteration.
Then we iterate over each row of ym :
-20
• For the first row, we copy all elements of ym to y:
0
The ground truth was obtained using the conv() function. The
comparison between the ground truth and the result of the Overlap -0.5
and Add method is shown in Figure 5.
-1
Ground truth
30 -1.5
-2
20
-2.5
0 2000 4000 6000 8000 10000 12000 14000 16000
10 Samples
Fig. 5: Difference between the ground truth and the result of the
Amplitude
X 5443
Y -2.42777 Overlap and Add method.
0
-20 C ONCLUSION
In conclusion, we have seen that it is possible to convolve two
signals in parts instead of the whole signal, thanks to the linearity
-30
0 2000 4000 6000 8000 10000 12000 14000 16000
of this operation. The result is the same and the computational
Samples waiting time is considerably reduced. This method is very useful
for arbitrarily large signals.
Fig. 3: Ground truth obtained using the conv() function.
The difference between the ground truth and the result of the
Overlap and Add method is shown in Figure 5. As expected, the