Thread Subject: How to reverse the algorithm

Subject: How to reverse the algorithm

From: Neo

Date: 28 Nov, 2008 22:44:02

Message: 1 of 2

N=length(s)
T=1/fs;
t=0:T:(N-1)*T;
fs=fs

L=100; % length of frames
nframes=floor(length(s)/L) % floor gives integer number of frames
energy=zeros(1,nframes); % An energy array of zeros

for i=1:nframes
    index=L*(i-1);
    sum=0;
    for j=1:L;
        sum=sum+s(index+j)*s(index+j); %squaring each frame
    end
    energy(i)=sum;
end

m=max(energy);
c=0.1;
z=energy(1)+c*(m-energy(1));

for i=1:L
    if energy(i)>z
        startindex=i
    end
end

Hi I have this program to find the first frame where energy is above Z, hence found the start of a word. I now need to reverse the energy matrix and perform the algorithm again to find the end of the word.

Can anyone please help with this??

I think using energy(end:-1:1) reverses the energy values.

Any help is much appreciated

Subject: How to reverse the algorithm

From: Jan Simon

Date: 29 Nov, 2008 01:45:04

Message: 2 of 2

Dear Neo!

> for i=1:L
> if energy(i)>z
> startindex=i
> end
> end
>
> Hi I have this program to find the first frame where energy is above Z, hence found the start of a word. I now need to reverse the energy matrix and perform the algorithm again to find the end of the word.

Instead of the loop, you can please FIND to find start and end points:
  Index = find(energy > z);
  startIndex = Index(1);
  endIndex = Index(end);

Jan

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
speech Neo 28 Nov, 2008 17:45:06
noise Neo 28 Nov, 2008 17:45:06
wav Neo 28 Nov, 2008 17:45:06
energy Neo 28 Nov, 2008 17:45:06
algorithm Neo 28 Nov, 2008 17:45:05
reverse Neo 28 Nov, 2008 17:45:05
endpoint Neo 28 Nov, 2008 17:45:05
rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com