BogaudioModules

BogaudioModules for VCV Rack
Log | Files | Refs | README | LICENSE

FFTRealUseTrigo.hpp (2107B)


      1 /*****************************************************************************
      2 
      3         FFTRealUseTrigo.hpp
      4         By Laurent de Soras
      5 
      6 --- Legal stuff ---
      7 
      8 This program is free software. It comes without any warranty, to
      9 the extent permitted by applicable law. You can redistribute it
     10 and/or modify it under the terms of the Do What The Fuck You Want
     11 To Public License, Version 2, as published by Sam Hocevar. See
     12 http://sam.zoy.org/wtfpl/COPYING for more details.
     13 
     14 *Tab=3***********************************************************************/
     15 
     16 
     17 
     18 #if defined (ffft_FFTRealUseTrigo_CURRENT_CODEHEADER)
     19 	#error Recursive inclusion of FFTRealUseTrigo code header.
     20 #endif
     21 #define	ffft_FFTRealUseTrigo_CURRENT_CODEHEADER
     22 
     23 #if ! defined (ffft_FFTRealUseTrigo_CODEHEADER_INCLUDED)
     24 #define	ffft_FFTRealUseTrigo_CODEHEADER_INCLUDED
     25 
     26 
     27 
     28 /*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
     29 
     30 #include	"ffft/OscSinCos.h"
     31 
     32 
     33 
     34 namespace ffft
     35 {
     36 
     37 
     38 
     39 /*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
     40 
     41 
     42 
     43 template <int ALGO>
     44 void	FFTRealUseTrigo <ALGO>::prepare (OscType &osc)
     45 {
     46 	osc.clear_buffers ();
     47 }
     48 
     49 template <>
     50 inline void	FFTRealUseTrigo <0>::prepare (OscType &osc)
     51 {
     52 	// Nothing
     53 }
     54 
     55 
     56 
     57 template <int ALGO>
     58 void	FFTRealUseTrigo <ALGO>::iterate (OscType &osc, DataType &c, DataType &s, const DataType cos_ptr [], long index_c, long index_s)
     59 {
     60 	osc.step ();
     61 	c = osc.get_cos ();
     62 	s = osc.get_sin ();
     63 }
     64 
     65 template <>
     66 inline void	FFTRealUseTrigo <0>::iterate (OscType &osc, DataType &c, DataType &s, const DataType cos_ptr [], long index_c, long index_s)
     67 {
     68 	c = cos_ptr [index_c];
     69 	s = cos_ptr [index_s];
     70 }
     71 
     72 
     73 
     74 /*\\\ PROTECTED \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
     75 
     76 
     77 
     78 /*\\\ PRIVATE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
     79 
     80 
     81 
     82 }	// namespace ffft
     83 
     84 
     85 
     86 #endif	// ffft_FFTRealUseTrigo_CODEHEADER_INCLUDED
     87 
     88 #undef ffft_FFTRealUseTrigo_CURRENT_CODEHEADER
     89 
     90 
     91 
     92 /*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/