You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
634B

  1. #include "standalone_helpers.hpp"
  2. #include "../src/SampleDelay.hpp"
  3. #include <iostream>
  4. int main( int argc, char **argv )
  5. {
  6. typedef SampleDelay< StandaloneModule > SD;
  7. {
  8. SD sd;
  9. int dk = 37;
  10. sd.params[ SD::DELAY_KNOB ].value = dk;
  11. sd.inputs[ SD::SIGNAL_IN ].active = 1;
  12. SD::results_t ov;
  13. int ns = 1000;
  14. for( int i=0; i<ns; ++i )
  15. {
  16. sd.inputs[ SD::SIGNAL_IN ].value = i * 1.0f / ns;
  17. sd.step();
  18. ov.push_back( sd.outputs );
  19. }
  20. for( int i=dk; i<ns; ++i )
  21. std::cout << i << " " << ov[ i-1 ][ SD::SIGNAL_OUT ].value << " " << 1.0f * (i-dk)/ ns << "\n";
  22. }
  23. }