Pd++  0.01
A pure C++ implementation of Pure Data objects
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
SingleSideBandModulation.h
1 /*
2  SingleSideBandModulation.cpp
3  Pd++
4 
5  Created by Robert Esler on 9/23/14.
6  Copyright (c) 2014 Robert Esler. All rights reserved.
7 */
8 
9 #ifndef __Pd____SingleSideBandModulation__
10 #define __Pd____SingleSideBandModulation__
11 
12 #include <string>
13 #include <iostream>
14 #include <math.h>
15 #include "BiQuad.h"
16 #include "SineWave.h"
17 #include "CosineWave.h"
18 #include "PdMaster.h"
19 
20 namespace rwe {
21 
22 /*! \brief Single Sideband Modulation.
23 
24  This class is based directly the hilbert~ and complex-mod~
25  abstractions in Pure Data. It uses a hilbert filter by cascading
26  a series of biquad filters, which offsets the phase of the signal by 180
27  degrees. Then the real and imaginary parts are modulation using a cosine and
28  sine wave respectively. The input is your signal to be modulated.
29 
30 */
31 
32 class SSB : public PdMaster {
33 
34 public:
35  SSB();
36  ~SSB();
37  void setOscFreq(double input);
38  double getOscFreq();
39  double perform(double input1);
40 
41 private:
42  pd::BiQuad biquad[4];
43  rwe::SineWave sine;
44  rwe::CosineWave cosine;
45  std::string name = "SSB";
46  double phasorFreq = 100;
47 
48  /*Produce our Hilbert filter, outputs should be around 90 deg out of phase.*/
49  double leftPhase(double input);
50  double rightPhase(double input);
51 
52 
53 };
54 
55 } // rwe namespace
56 #endif /* defined(__Pd____SingleSideBandModulation__) */
void setOscFreq(double input)
Definition: SingleSideBandModulation.cpp:90
A two-pole, two-zero filter.
Definition: BiQuad.h:29
A super class inherited by all Pd++ objects.
Definition: PdMaster.h:62
A cosine wave generator.
Definition: CosineWave.h:27
A sine wave generator.
Definition: SineWave.h:23
Personal namespace. Use intials for your own classes.
Definition: CosineWave.cpp:18
Single Sideband Modulation.
Definition: SingleSideBandModulation.h:32