From ajr@compute.demon.co.uk Mon Jun 26 10:07:28 1995
Received: from spanner.eng.cam.ac.uk
          (via root@spanner.eng.cam.ac.uk [129.169.8.9])
          by dsl.eng.cam.ac.uk with ESMTP id KAA13812
          for <ajr@dsl.eng.cam.ac.uk>; Mon, 26 Jun 1995 10:07:27 +0100
Received: from ppsw3.cam.ac.uk
          (via pp@mauve.csi.cam.ac.uk [131.111.8.38])
          by spanner.eng.cam.ac.uk with ESMTP id KAA04868
          for <ajr4@eng.cam.ac.uk>; Mon, 26 Jun 1995 10:07:26 +0100
Received: from compute.demon.co.uk by mauve.csi.cam.ac.uk 
          with SMTP-UK (XTPP8.1) as ppsw.cam.ac.uk;
          Mon, 26 Jun 1995 10:06:57 +0100
Received: (from ajr@localhost) by compute.demon.co.uk (8.6.9/8.6.9) 
          id HAA02477 for ajr4; Mon, 26 Jun 1995 07:43:40 +0100
Date: Mon, 26 Jun 1995 07:43:40 +0100
From: Tony Robinson <ajr@compute.demon.co.uk>
Message-Id: <199506260643.HAA02477@compute.demon.co.uk>
To: ajr4@compute.demon.co.uk
Status: R

Path: compute.demon.co.uk!news.demon.co.uk!demon!plug.news.pipex.net!pipex!edi.news.pipex.net!pipex!europa.chnt.gtegsc.com!newsxfer.itd.umich.edu!news.cic.net!infoserv.illinois.net!news.wctc.net!spcuna!citicorp.com!maple.cgin.us-md.citicorp.com!rfung
From: robert.fung@citicorp.com (Robert Fung)
Newsgroups: comp.dsp
Subject: Re: Whistle Recognition
Date: 25 Jun 1995 23:45:21 GMT
Organization: Citicorp - CGIN
Lines: 22
Message-ID: <3skseh$rlm@spruce.citicorp.com>
References: <3sji7e$h49@spruce.citicorp.com>
NNTP-Posting-Host: maple.cgin.us-md.citicorp.com
X-Newsreader: TIN [version 1.2 PL2]

Somewhat faster code for retrieving a frequency magnitude used
in whistle.c. The sample size should perhaps be increased to
pervent the output magnitudes from getting too close together
making relative comparions difficult.


double fft2(double hz) /* FASTER FT */
{  /* double real[SAMPSIZE] */
 #define SAMPSIZE 128
 #define SAMPRATE 8000.00
 double creal=0,cimag=0,temp=2.0*M_PI*hz/SAMPRATE,g=-temp;
 double *p=&real;
 int x;
 for (x=0; x<SAMPSIZE; x++)
 {    g+=temp;
      creal+=(*p)  *(cos(g));
      cimag+=(*p++)*(sin(g));
 }
 return(abs(cimag)+abs(creal));
}



