Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I have this program but Im getting this error Index exceeds the number of array elements (1).Could you help me to fix it please. function

I have this program but Im getting this error Index exceeds the number of array elements (1).Could you help me to fix it please.

function y = overlap_add(x,h,lc)

M=length(h); % number of elements in h

N=length(x); % number of elements n x

r=rem(N,lc); % remainder when N is divided by lc

x1=[x zeros(1,lc-r)]; % add lc-r zeros at the end of array x

n1=length(x1)/lc; %length of x1 divided by lc

h1=[h zeros(1,lc-1)]; % add lc-1 zeros at the end of h

for j=1:n1

Matrix1(j,:)=x1(((j-1)*lc+1):j*lc); % Matrix1 is formed by taking lc samples from x1 for each row

Matrix2(j,:)=[Matrix1(j,:) zeros(1,M-1)]; % Matrix2 is formed by adding M-1 zeros at the end of Matrix1 for each row

Matrix3(j,:)=ifft(fft(Matrix2(j,:)).*fft(h1)); % % Circular convolution of Matrix2 and h1 to get Matrix3 row by row

Matrix4(j,:)=[zeros(1,(j-1)*lc) Matrix3(j,:) zeros(1,(n1-j)*lc)]; % adding zero at the beginning and end at each row of Matrix3

end

y =sum(Matrix4); % y is obtained by summing each column of Matrix4

i=1:M+N-1;

y=y(i);

end

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Put Your Data To Work 52 Tips And Techniques For Effectively Managing Your Database

Authors: Wes Trochlil

1st Edition

0880343079, 978-0880343077

More Books

Students also viewed these Databases questions

Question

Explain the meanings of reliability and validity.

Answered: 1 week ago

Question

2. What do you believe is at the root of the problem?

Answered: 1 week ago