Mercurial > hg > soniczoomios
annotate frequencer.h @ 49:178642d134a7 tip
xtra files
author | Robert Tubb <rt300@eecs.qmul.ac.uk> |
---|---|
date | Wed, 01 May 2013 17:34:33 +0100 |
parents | 7541aeaebcdc |
children |
rev | line source |
---|---|
rt300@4 | 1 // |
rt300@4 | 2 // frequencer.h |
rt300@4 | 3 // oscSenderExample |
rt300@4 | 4 // |
rt300@4 | 5 // Created by Robert Tubb on 27/11/2012. |
rt300@4 | 6 // |
rt300@4 | 7 // This is a C++ version of freqMaster.js max script |
rt300@4 | 8 |
rt300@4 | 9 #ifndef __oscSenderExample__frequencer__ |
rt300@4 | 10 #define __oscSenderExample__frequencer__ |
rt300@4 | 11 |
rt300@4 | 12 #include <iostream> |
rt300@4 | 13 #include "ofMain.h" |
rt300@4 | 14 #include "math.h" |
rt300@4 | 15 |
rt300@4 | 16 |
rt300@4 | 17 class Frequencer{ |
rt300@4 | 18 |
rt300@4 | 19 private: |
rt300@4 | 20 vector<double> timePoints; |
rt300@4 | 21 vector<double> freqMag; |
rt300@4 | 22 vector<double> freqPhase; |
rt300@4 | 23 int N; |
rt300@4 | 24 |
rt300@4 | 25 |
rt300@4 | 26 void dft(); |
rt300@4 | 27 void idft(); |
rt300@4 | 28 public: |
rt300@4 | 29 Frequencer(); |
rt300@4 | 30 void clear(); |
rt300@4 | 31 void timeEdit(int n, double value); |
rt300@4 | 32 void timeEdit(vector<double> allValues); |
rt300@4 | 33 void freqMagEdit(int k, double mag); |
rt300@4 | 34 vector<double> freqMagEdit(vector<int> indexes, vector<double> values); |
rt300@4 | 35 void freqPhaseEdit(int k, double phase); |
rt300@4 | 36 vector<double> freqPhaseEdit(vector<int> indexes, vector<double> values); |
rt300@4 | 37 |
rt300@4 | 38 double getPoint(int idx); |
rt300@4 | 39 //int getPoint(int idx); // rounded |
rt300@4 | 40 }; |
rt300@4 | 41 |
rt300@4 | 42 #endif /* defined(__oscSenderExample__frequencer__) */ |