StoRC
Autonomous Payload Delivery System
low_pass.pde
Go to the documentation of this file.
00001 /***********************************************************
00002  * StoRC - Search to Rescue Craft
00003  * MEAM Senior Design 2011-2012
00004  * 
00005  * Authors:  Michael Posner (CIS, MEAM '12)
00006  * Timothy Hennelly (ESE '12)
00007  * Jacob Orloff (MEAM '12)
00008  * 
00009  * (some code from ArduPilot Mega project, found here:
00010  * http://code.google.com/p/ardupilot-mega/ )
00011  * 
00012  * Licensing:
00013  * 
00014  * This program is free software: you can redistribute it and/or modify 
00015  * it under the terms of the GNU General Public License as published by 
00016  * the Free Software Foundation, either version 3 of the License, or 
00017  * (at your option) any later version. 
00018  * 
00019  * This program is distributed in the hope that it will be useful, 
00020  * but WITHOUT ANY WARRANTY; without even the implied warranty of 
00021  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
00022  * GNU General Public License for more details. 
00023  * 
00024  * You should have received a copy of the GNU General Public License 
00025  * along with this program. If not, see <http://www.gnu.org/licenses/>.
00026  * 
00027  ***********************************************************/
00028 
00029 /**
00030 *  @file low_pass.pde
00031 *  @brief Discrete-time implementation of a simple RC low-pass filter
00032 *  @author Michael Posner (CIS, MEAM '12)
00033 *  @author Timothy Hennelly (ESE '12)
00034 *  @author Jacob Orloff (MEAM '12)
00035 *  
00036 */
00037 
00038 
00039 
00040 float low_pass(float raw_data, float alpha, float filtered_data){
00041 
00042   filtered_data = (raw_data * alpha) + (filtered_data * (1 - alpha));
00043 
00044   return (float)filtered_data;
00045 }
00046