LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-18-2007, 01:11 PM   #1
aaabhish
LQ Newbie
 
Registered: Nov 2007
Posts: 5

Rep: Reputation: 0
restructuring the function


hi all,
here i am puttin a code for a function
in which WAV_SIGNAL is an structure.
can any body give me a code that will look like a well professional code and will do the same thing but more efficiently.

Code:
float *EnergyOnset(WAV_SIGNAL *WDat,short *FrameState,float *FramePitch)
{
	int i,j;
	float *Frame;

	int NumFrame=(WDat->DataSize/FRAME_SIZE)+1;
	int SamplingRate=WDat->SampleRate;

	Frame=(float *) malloc(sizeof(float)*FRAME_SIZE);
	 
	for(i=0;i<NumFrame;i++) {
		if(FrameState[i] != 0) {
			for(j=0;j<FRAME_SIZE;j++) Frame[j]=WDat->Data[FRAME_SIZE*i+j];
			FramePitch[i]=PitchACRCalc(Frame,SamplingRate);
		}
		else FramePitch[i]=0;
	}

	free(Frame);
	Frame=(float *)NULL;
	return FramePitch;
}
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Linux Professional Institute's Restructuring Begins with Staff Reductions LXer Syndicated Linux News 0 02-14-2006 03:46 PM
restructuring the menu system? gunnix Debian 4 01-30-2005 03:08 PM
Restructuring DF TPupAZ Linux - Software 0 08-26-2004 02:07 AM
A main can be changed by a function local without passing anything to the function? ananthbv Programming 10 05-04-2004 01:31 PM
Perl exec function in linux (and system-function) nazula Programming 1 04-19-2004 12:21 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:06 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration