Luke Cartwright / Mbed 2 deprecated ELEC2645_Project_el18loc_nearlythere

Dependencies:   mbed

Committer:
lukeocarwright
Date:
Thu May 21 22:59:59 2020 +0000
Revision:
18:204cd747b54a
Child:
19:08862f49cd9e
Got attack working with hardware glitch (slew rate issue and distortion likely due to loading and amp module). Generates CSV file to check output with envelope.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
lukeocarwright 18:204cd747b54a 1 #ifndef ENVELOPE_H
lukeocarwright 18:204cd747b54a 2 #define ENVELOPE_H
lukeocarwright 18:204cd747b54a 3
lukeocarwright 18:204cd747b54a 4 #include "mbed.h"
lukeocarwright 18:204cd747b54a 5 #include "N5110.h"
lukeocarwright 18:204cd747b54a 6 #include "Gamepad.h"
lukeocarwright 18:204cd747b54a 7
lukeocarwright 18:204cd747b54a 8 /** Envelope class
lukeocarwright 18:204cd747b54a 9 * @author Luke Cartwright, University of Leeds
lukeocarwright 18:204cd747b54a 10 * @brief converts output to env output
lukeocarwright 18:204cd747b54a 11 * @date May 2020
lukeocarwright 18:204cd747b54a 12 */
lukeocarwright 18:204cd747b54a 13
lukeocarwright 18:204cd747b54a 14 class Envelope
lukeocarwright 18:204cd747b54a 15 {
lukeocarwright 18:204cd747b54a 16 public://-----------------------------------------------------------------------
lukeocarwright 18:204cd747b54a 17 //variables
lukeocarwright 18:204cd747b54a 18
lukeocarwright 18:204cd747b54a 19 //methods
lukeocarwright 18:204cd747b54a 20 //Methods
lukeocarwright 18:204cd747b54a 21 //Constructor
lukeocarwright 18:204cd747b54a 22 Envelope();
lukeocarwright 18:204cd747b54a 23
lukeocarwright 18:204cd747b54a 24 //Destructior
lukeocarwright 18:204cd747b54a 25 ~Envelope();
lukeocarwright 18:204cd747b54a 26
lukeocarwright 18:204cd747b54a 27 //Modifies input to envelope
lukeocarwright 18:204cd747b54a 28 uint16_t env_in(int a, int d, int s, int r, int in, bool init);
lukeocarwright 18:204cd747b54a 29
lukeocarwright 18:204cd747b54a 30
lukeocarwright 18:204cd747b54a 31 private://----------------------------------------------------------------------
lukeocarwright 18:204cd747b54a 32 //variables
lukeocarwright 18:204cd747b54a 33 uint16_t out;
lukeocarwright 18:204cd747b54a 34 int samples;
lukeocarwright 18:204cd747b54a 35 //float time;
lukeocarwright 18:204cd747b54a 36 int av; //a volume
lukeocarwright 18:204cd747b54a 37 int dv;
lukeocarwright 18:204cd747b54a 38 int sv;
lukeocarwright 18:204cd747b54a 39 int rv;
lukeocarwright 18:204cd747b54a 40 int a_vec;
lukeocarwright 18:204cd747b54a 41 int d_vec;
lukeocarwright 18:204cd747b54a 42 int r_vec;
lukeocarwright 18:204cd747b54a 43 int at;
lukeocarwright 18:204cd747b54a 44
lukeocarwright 18:204cd747b54a 45 //methods
lukeocarwright 18:204cd747b54a 46 int a_vector_calc(int av);
lukeocarwright 18:204cd747b54a 47
lukeocarwright 18:204cd747b54a 48 };
lukeocarwright 18:204cd747b54a 49 #endif