Question overlap

18 views
Skip to first unread message

zonda rugmiaga

unread,
Jun 9, 2011, 4:30:26 AM6/9/11
to Applied Speech and Audio Processing
Hello. I'm student from indonesian.
I wanted to ask about matlab source code
I want to do the overlap add 50 % two signals with having different
length.
How I do in Matlab?
Thanks very much.

audioeng

unread,
Jun 9, 2011, 11:34:49 AM6/9/11
to Applied Speech and Audio Processing
Hi Zonda,

This is a strange question... why do you want to overlap-add like
this?
Normally you overlap-add a sequence of overlapping frames of data.
Also, you don't mention any Hamming (or other) window you are
applying.

Anyway, after that it's easy:

l1=len(signal1);
l2=len(signal2);

So I assume you want to start 50% of the way through signal1, then add
in signal 2.
So first create a result array, of length L;

L=l2+floor(l1/2)

r=zeros(1,L);

r(1:l1)=signal1;
r(floor(l1/2)+1:L)=r(floor(l1/2)+1:L)+signal2;

Simple! Next, test it out with some test matrices to make sure my
indexing is right. The floor(l1/2) is just in case the length of l1 is
odd, in which case you would get an error without this.

Best Regards,
audioeng
Reply all
Reply to author
Forward
0 new messages