/* ==================================================================== */ /* GFILTER.C */ /* */ /* -------------------------------------------------------------------- */ /*************************************************************************** * * Copyright (c) 1989, 1990, 1991, 1992, 1993 * Rector and Visitors of the University of Virginia * All Rights Reserved * * This file is part of the Mentat system software library. This software * is intended for research and is available free of charge for that * purpose; however, all material is the proprietary source of the * University of Virginia, and may not be disclosed or copied in any * form without the explicit written permission of the Univeristy of * Virginia. * * This software is distributed WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. This software hereunder is provided on an "as is" basis, * and the University of Virginia has no obligation to provide maintenance, * support, updates, enhancements, or modifications. * * Send problems & suggestions to: * mentat@Virginia.EDU * ***************************************************************************/ /*-------------------------------------------------------------------------- * * A synthetic, generic, filter class. * * Note that this is a regular, i.e. stateless, mentat class. * The first argument specifies the delay. The delay must be * a parameter because instances of regular classes have no state. * *------------------------------------------------------------------------*/ #include "gfilter.h" #include // Approx. 1 ms on a sun 3 is 550 FLOPs // Approx. 1 ms on a sparc 3 is 100 FLOPs int gfilter::one_arg(int arg1) { // Delay the right amount by doing FLOPs // The parameter arg1 communicates the amount to delay int count_len = arg1 * 100; float x = arg1; float y = 0.0; for (int i=0; i