From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 51E62BB84 for ; Fri, 2 Jun 2006 13:07:31 +0200 (CEST) Received: from hotmail.com (bay120-f33.bay120.hotmail.com [207.46.9.241]) by nez-perce.inria.fr (8.13.6/8.13.6) with ESMTP id k52B7U5Q018352 for ; Fri, 2 Jun 2006 13:07:30 +0200 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Fri, 2 Jun 2006 04:07:29 -0700 Message-ID: Received: from 207.46.9.251 by by120fd.bay120.hotmail.msn.com with HTTP; Fri, 02 Jun 2006 11:07:27 GMT X-Originating-IP: [212.198.246.189] X-Originating-Email: [otlore@hotmail.fr] X-Sender: otlore@hotmail.fr From: "otlore dolire" To: caml-list@yquem.inria.fr Subject: building fft Date: Fri, 02 Jun 2006 13:07:27 +0200 Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed X-OriginalArrivalTime: 02 Jun 2006 11:07:29.0473 (UTC) FILETIME=[BD0BDB10:01C68634] X-j-chkmail-Score: MSGID : 44801BF2.000 on nez-perce : j-chkmail score : X : 0/20 1 X-Miltered: at nez-perce with ID 44801BF2.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; fft:01 fft:01 rec:01 a-b:01 testez:98 conflicts:01 int:01 decouvrez:97 defined:02 div:97 hotmail:97 float:03 float:03 let:03 let:03 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.8 required=5.0 tests=DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST,MSGID_FROM_MTA_HEADER autolearn=disabled version=3.0.3 I have a problem with a basic fft function i'm tryin to build. I think it's right, yet it raises conflicts, as if it didn't recognize the "end" at the end of it. Can you please tell me if someone sees something wrong? thx in advance let rec fft N w y = let Y = make_vect N {Re = 0. ; Im = 0.} in if N = 1 then begin Y.(0) <- y.(0) end else begin let m = div_int N 2; let l1 = make_vect m {Re = 0. ; Im = 0. } and l2 = make_vect m {Re = 0. ; Im = 0. } in for k = 0 to m - 1 do l1.(k) <- y.(2*k); l2.(k) <- y.(2*k + 1) done; let L1 = make_vect m {Re = 0. ; Im = 0. } and L2 = make_vect m {Re = 0. ; Im = 0. } in for i = 0 to m - 1 do L1.(i) <- (fft m (prod w w) l1).(i); L2.(i) <- (fft m (prod w w) l2).(i) done; let wk = ref {Re = 1. ; Im = 0. } and P = ref {Re = 0. ; Im = 0. } and I = ref {Re = 0. ; Im = 0. } in for k=0 to m - 1 do P := L1.(k); I := prod !wk L2.(k); Y.(k) <- prod (add !P !I) {Re = 0.5 ; Im = 0. }; Y.(k + m) <- prod (sous !P !I) {Re = 0.5 ; Im = 0. }; wk := prod !wk w done end; Y;; PS: i defined the type cplx by type cplx = {Re : float ; Im : float}, prod, add and sous are respectively product, addition and substraction of cplx numbers _________________________________________________________________ Windows Live Mail : découvrez et testez la version bêta ! http://www.ideas.live.com/programpage.aspx?versionId=5d21c51a-b161-4314-9b0e-4911fb2b2e6d