Luke O. Cartwright 201225242

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Filter.h Source File

Filter.h

00001 #ifndef FILTER_H
00002 #define FILTER_H
00003 
00004 #include "mbed.h"
00005 
00006 /** Filter class
00007  * @author Luke Cartwright, University of Leeds
00008  * @brief Filters Synth Signal
00009  * @date May 2020
00010 */
00011 class Filter
00012 {
00013 public://-----------------------------------------------------------------------
00014 //Methods
00015     /** Constructor */
00016     Filter();
00017 
00018     /** Destructor */
00019     ~Filter();
00020 
00021     /**Runs Main Filter
00022     * @outptus adjusted value due to filter
00023     * @accept input filter type
00024     */
00025     int filter_run(int input, int filter_type, bool init);
00026 
00027     /**Implements Low Pass Filter Algorithm
00028     */
00029     int LPF (int input,bool init);
00030 
00031     /**Implements High Pass Filter Algorithm
00032     */
00033     int HPF (int input,bool init);
00034 
00035     /**Implements Band Pass Filter Algorithm
00036     * @uses LPF and HPF function
00037     */
00038     int BPF (int input,bool init);
00039 
00040 private://----------------------------------------------------------------------
00041     int x; //input value
00042     int y_1; //previous y value
00043     int y; //output value
00044 };
00045 
00046 
00047 #endif