0% found this document useful (0 votes)
2 views5 pages

DSP Lab Project

The document outlines a lab project focused on the overlap add method for discrete convolution using MATLAB. It describes the theory behind the method, the algorithm for implementation, and provides a MATLAB program for processing input sequences. The results indicate that this method is more efficient than using the FFT function for convolution calculations.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views5 pages

DSP Lab Project

The document outlines a lab project focused on the overlap add method for discrete convolution using MATLAB. It describes the theory behind the method, the algorithm for implementation, and provides a MATLAB program for processing input sequences. The results indicate that this method is more efficient than using the FFT function for convolution calculations.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

DIGITAL SIGNAL PROCESSING

LAB PROJECT

OVERLAP ADD METHOD

AIM : To study overlap add save method using MATLAB code.


THEORY:
The overlap add method is an efficient way to evaluate the discrete convolution
of a very long signal with a finite impulse response (FIR) filter wherr h[m]= 0
for m outside the region [l, M].The concept here is to divide the problem into
multiple convolutions of h[n] with short segments of x[n], where L is an
arbitrary segment length. Because of this y[nl can be written as a sum of short
convolutions.
Algorithm:
The signal is first partitioned into non-overlapping sequences, then the discrete
Fourier transforms of the sequences are evaluated by multiplying the FFT xk[n]
of with the FFT h[n].After recovering of yk[n] by inverse FFT,the resulting output
signal is reconstructed overlapping and adding the yk[n]. Thc overlap arises from
the fact that a linear convolution is always longer than the original sequences. In
the early days of development of the Fourirer transform, L was often choosen to
be a power of 2 for efficiency , but further development revealed efficient
transforms for larger primme factorizations of L, reducing computational
sensitivity to this parameter.

PROGRAM
clc;
clear all;
% Getting the large input x as a row vector from user
x = input("Enter the large sequence to be processed: ");
n = length(x);
% Default impulse response of the system to be assumed
h = input("Enter the impulse response of the system: ");
% Default length of the output convoluted blocks to be considered
N = input("Give a value for length of the block after circular convolution: ");
M = length(h); % Length of impulse response sequence
L = N - M + 1; % Length of each block
% Padding process to impulse response
h = [h, zeros(1, L - 1)]; % Padded with L-1 zeros
% To normalize the array compared to the size of each block in order to perform ease
computation
x1 = [];
if mod(length(x), L) ~= 0
x1 = [x, zeros(1, (L - mod(length(x), L)))];
else
x1 = x;
end
% Using looping structure, the long sequence is split into smaller array of size and padded
with M-1 zeros
a = {}; % A cell is used to store the padded input sequence arrays with length L+M-1
temp = [];
for i = 1:length(x1) / L
temp = x1(1:L);
temp = [temp, zeros(1, M - 1)];
a{end + 1} = temp;
x1(1:L) = [];
end
[r, c] = size(a);
for i = 1:c
a{i};
end
% Cell consisting of circular convoluted outputs of individual blocks in x[n]
y = {};
for i = 1:c
y{end + 1} = cconv(a{i}, h, N);
end
[r1, c1] = size(y);
for i = 1:c1
y{i};
end
temp1 = [];
intemp = [];
temp3 = [];
addtemp = [];
for i = 1:c1 - 1
if i == 1
temp1 = y{i};
intemp = temp1(M + 1:end);
temp1 = temp1(1:M);
j = i + 1;
temp3 = y{j};
temp3 = temp3(1:M - 1);
addtemp = intemp + temp3;
temp1 = [temp1, addtemp];
y{i} = temp1;
else
temp1 = y{i};
intemp = temp1(M + 1:end);
temp1 = temp1(M);
j = i + 1;
temp3 = y{j};
temp3 = temp3(1:M - 1);
addtemp = intemp + temp3;
temp1 = [temp1, addtemp];
y{i} = temp1;
end
end
temp1 = y{c1};
temp1 = temp1(M:end);
y{c1} = temp1;
sample = cell2mat(y);
output = "Output sequence";
l = length(sample); % Length of the final output sequence
disp(output);
disp(sample);
% Adjust plotting lengths
% Ensure n and l (length of output) are the same for proper plotting
if l < n
n = l; % Adjust n if it's larger than the output length
end

subplot(2,1,1);
stem(1:n, x(1:n)); % Plot only up to the smaller length
xlabel('No of samples');
ylabel('Amplitude');
title('Input sequence');

subplot(2,1,2);
stem(1:n, sample(1:n)); % Plot output sequence with adjusted length
xlabel('No of samples');
ylabel('Amplitude');
title('Overlap add method ');
OUTPUT:

RESULT:
Reducing the length of Input sequence to certian specified block and performing
the overlap methods is efficient than using FFT function .This method is much
easier manual calculation.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy