Basic Audio Signal Processing Library

Dependents:   unzen_sample_nucleo_f746 skeleton_unzen_nucleo_f746 ifmag_noise_canceller synthesizer_f746

オーディオ信号処理用のライブラリです。

mbed-dspのフィルタ群向けに作ったクラス・ラッパーのほか、以下のクラスを用意しています。

  • ヒステリシス
  • sin/cosオシレータ
  • リミッター

クラスは全て名前空間amakusaに含まれます。

Revision:
0:058daa59980d
Child:
2:fbdf03b330ae
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/oscsincos.h	Sun Dec 11 21:04:06 2016 +0000
@@ -0,0 +1,55 @@
+namespace amakusa
+{
+        /**
+        * \brief Sine & Cosine Oscillator
+        */
+    class OSCSinCos
+    {
+    public:
+            /**
+            * \brief constructor
+            * \param freq Frequency in Hz.
+            * \param Fs Sampling frequency in Hz.
+            */
+        OSCSinCos( float freq, int Fs );
+            /**
+            * \brief wave generator method
+            * \param c Pointer to the buffer to output the sine signal.  
+            * \param s Pointer to the buffer to output the cosine singal. If NULL, cosine signal will be skipped.
+            * \params count Number of sample to be generated.
+            */
+        void run( float *s, float *c , int count );
+            /**
+            * \brief wave generator method
+            * \param c Pointer to the buffer to output the sine signal.  
+            * \params count Number of sample to be generated.
+            */
+        void run( float *s, int count ){run(s, 0, count);}
+            /**
+            * \brief set the oscillation furequncy.
+            * \param freq Frequency in Hz.
+            */
+        void setFrequency( float freq );
+            /**
+            * \brief set the oscillator's internal phase
+            * \param freq phase in radian.
+            */
+        void setPhase( float phase );        
+            /**
+            * \brief get the oscillation furequncy.
+            * \returns Frequency in Hz.
+            */
+        float getFrequency();
+            /**
+            * \brief get the internal phase
+            * \returns Phase in radian
+            */
+        float getPhase();
+    private:
+        float deltaPhase;   // deltaPhase per sample.
+        int sampleFreq;     // in Hz
+        int phaseInSample;  // internal phase [sample]
+    };
+        
+}
+    
\ No newline at end of file