Commits

Aleksey Kunitskiy committed 3e4e391

Remove depracated files

Comments (0)

Files changed (2)

src/main.cxx

-#include <memory>
-#include <iostream>
-#include <map>
-#include <stdexcept>
-
-#include "SineGenerator.h"
-#include "BufferManager.h"
-#include "Window.h"
-#include "Spectro.h"
-#include "FftwWrapper.h"
-
-#include "tclap/CmdLine.h"
-#include "tclap/Constraint.h"
-
-typedef double float_tt;
-
-class WindowTypeConstraint : public TCLAP::Constraint<std::string>
-{
-  typedef JackPipe::Window<float_tt> window_t;
-  typedef std::pair< std::string, window_t::window_t > pair_t;
-  typedef std::map< std::string, window_t::window_t > map_t;
-public:
-  WindowTypeConstraint () {
-    _wf_supported.insert(pair_t("rect", window_t::WINDOW_RECT));
-    _wf_supported.insert(pair_t("hann", window_t::WINDOW_HANN));
-    _wf_supported.insert(pair_t("hamming", window_t::WINDOW_HAMMING));
-    _wf_supported.insert(pair_t("nuttall", window_t::WINDOW_NUTTALL));
-  };
-
-  std::string 	description () const
-  { return "supported windowing functions: hann, hamming, nuttall, rect."; };
-
-  std::string 	shortID () const
-  { return "window name"; } ;
-
-  bool check (const std::string& value) const
-  {
-    return ! (_wf_supported.find(value) == _wf_supported.end());
-  };
-
-  window_t::window_t getWindowID(const std::string& name) const
-  {
-    map_t::const_iterator it = _wf_supported.find(name);
-    if(it != _wf_supported.end()) return it->second;
-    else throw std::range_error("unknown window name");
-  };
-
-private:
-  map_t _wf_supported;
-
-};
-
-int main(int argc, char* argv[]){
-  //std::auto_ptr<JackPipe::Spectro> s;
-  try {
-    WindowTypeConstraint wc;
-
-    TCLAP::CmdLine cmd("Jackpipe spectro analizer", ' ', "0.1");
-    TCLAP::ValueArg<double> f_base("b", "base", "Base frequency (e.g 20 = 20Hz)", false, 20.0, "double");
-    TCLAP::ValueArg<double> f_upperlimit("u", "upperlimit", "Limit frequency", false, 20000.0, "double");
-    TCLAP::ValueArg<unsigned> nblocks("n", "nblocks", "Number of analizer blocks", false, 8, "integer");
-    TCLAP::ValueArg<std::string> window("w", "window", "Windowing function", false, "rect", &wc);
-    TCLAP::ValueArg<std::string> fr_filename("o", "output", "Frequency response output file name", false, "jackpipe_fr.dat", "path");
-    TCLAP::SwitchArg approx_f_base("a", "approx", "Approximate base frequency to make buffer power of two sizes for faster FFT computation", false);
-
-    cmd.add( f_base );
-    cmd.add( f_upperlimit );
-    cmd.add( nblocks );
-    cmd.add( window );
-    cmd.add( fr_filename );
-    cmd.add( approx_f_base );
-    cmd.parse( argc, argv );
-
-    //s = std::auto_ptr<JackPipe::Spectro>(new JackPipe::Spectro(f_base.getValue(), f_upperlimit.getValue(), nblocks.getValue(), wc.getWindowID(window.getValue()), fr_filename.getValue(), approx_f_base.getValue()));
-
-  } catch (TCLAP::ArgException &e)  // catch any exceptions
-	{
-    std::cerr << "error: " << e.error() << " for arg " << e.argId() << std::endl;
-    return 1;
-  }
-
-  //std::auto_ptr<Spectro> s(new Spectro());
-
-
-  //s->start(); 
-
- // s->connectToPhysical(0,0);   
-  //s->connectFromPhysical(0,0); 
-
-  //s->wait();
-
-  //s->close();
-
-  //s->analize();
-
-  JackPipe::FftwWrapper v;
-  JackPipe::FftwWrapper::vec16f_t *in = new JackPipe::FftwWrapper::vec16f_t(100001, 0.1f);
-  JackPipe::FftwWrapper::vec16fc_t *out = new JackPipe::FftwWrapper::vec16fc_t(100001, 0.1f);
-
-  v.init_1d(in, out, 0, JackPipe::FftwWrapper::conf::input_ready);
-  v.execute();
-
-  delete in;
-  delete out;
-
-  return 0;
-}
-
-// vim:set ts=2 sw=2 expandtab tw=78:

src/main_test.cxx

-#include <iostream>
-#include <fstream>
-
-#include "Window.h"
-#include "SineGenerator.h"
-#include "FftAnalizer.h"
-
-#include "fftw3.h"
-
-#define SG_RAPAMS_RESTORE 0
-
-using namespace JackPipe;
-
-typedef double T;
-
-int main(){
-
-  SineGenerator<T>::SineGeneratorParams p;
-  
-  unsigned int nblocks = 10;
-
-#if SG_RAPAMS_RESTORE == 1
-  std::ifstream params_file("sinegenerator_params.dat", std::ios::in | std::ios::binary);
-  params_file.read(reinterpret_cast<char*>(&p), sizeof(p));
-  params_file.close();
-  SineGenerator<T> sg(p);
-  nblocks = p.u_nblocks;
-
-  std::cout << "Params:" << std::endl;
-  std::cout << "f_base = " << p.f_base << std::endl;
-  std::cout << "f_upperlimit = " << p.f_upperlimit << std::endl;
-  std::cout << "l_srand = " << p.l_srand << std::endl;
-  std::cout << "f_samplefreq = " << p.f_samplefreq << std::endl;
-  std::cout << "c_normfactor = " << p.c_normfactor << std::endl;
-  std::cout << "u_nblocks = " << p.u_nblocks << std::endl;
-  std::cout << "window_type = " << Window<T>::getDescription(p.window_type) << std::endl;
-#elif SG_RAPAMS_RESTORE == 0
-  SineGenerator<T> sg(20.0, 24000.0, 48000.0, nblocks, Window<T>::WINDOW_RECT);
-  sg.save(p);
-  std::cout << "Params:" << std::endl;
-  std::cout << "f_base = " << p.f_base << std::endl;
-  std::cout << "f_upperlimit = " << p.f_upperlimit << std::endl;
-  std::cout << "l_srand = " << p.l_srand << std::endl;
-  std::cout << "f_samplefreq = " << p.f_samplefreq << std::endl;
-  std::cout << "c_normfactor = " << p.c_normfactor << std::endl;
-  std::cout << "u_nblocks = " << p.u_nblocks << std::endl;
-  std::ofstream params_file("sinegenerator_params.dat", std::ios::out | std::ios::binary);
-  params_file.write(reinterpret_cast<char*>(&p), sizeof(p));
-  params_file.close();
-#endif
-
-  std::vector<T> b;
-  std::vector<T> c(10500, 0.0);
-  sg.fillBuffer(b);
-  std::cout << "b.size() = " << b.size() << std::endl;
-  unsigned int s = b.size();
-  b.insert(b.begin(), c.begin(), c.end());
-  b.insert(b.end(), c.begin(), c.end());
-  FftAnalizer<T> a(p.f_base, p.f_samplefreq, sg.getNormFactor() / sg.getWindowDensityFactor(), s, b);
-  a.analize();
-
-  return 0;
-}
-
-// vim:set ts=2 sw=2 expandtab tw=78: