diff --git a/gr-jay/lib/peak_detect_impl.cc b/gr-jay/lib/peak_detect_impl.cc index 10da0c7..70ba6ea 100644 --- a/gr-jay/lib/peak_detect_impl.cc +++ b/gr-jay/lib/peak_detect_impl.cc @@ -53,6 +53,8 @@ namespace gr { memset(m_pPeakCount, 0, vlen*sizeof(int)); memset(m_pXs, 0, vlen*sizeof(float)); memset(m_pXm, 0, vlen*sizeof(float)); + + m_pFile_frames = fopen("/home/jens/frames2.dat", "w"); } /* @@ -60,6 +62,8 @@ namespace gr { */ peak_detect_impl::~peak_detect_impl() { + fclose(m_pFile_frames); + delete [] m_pXm; delete [] m_pXs; delete [] m_pPeakCount; @@ -71,7 +75,6 @@ namespace gr { gr_vector_void_star &output_items) { int k=0; - fprintf(stderr, "Peak at"); for(int i = 0; i < (noutput_items * m_vlen); i++) { float x = ((float*)input_items[k])[i]; @@ -84,12 +87,10 @@ namespace gr { ((float*)output_items[k])[i] = m_pXm[i]; - if (peak > 0.5) - { - fprintf(stderr, " %d", i); - } + fprintf(m_pFile_frames, "%0.3f ", x); + } - fprintf(stderr, "\n"); + fprintf(m_pFile_frames, "\n"); // Tell runtime system how many output items we produced. return noutput_items; diff --git a/gr-jay/lib/peak_detect_impl.h b/gr-jay/lib/peak_detect_impl.h index a589ee3..f742616 100644 --- a/gr-jay/lib/peak_detect_impl.h +++ b/gr-jay/lib/peak_detect_impl.h @@ -24,30 +24,29 @@ #include namespace gr { - namespace jay { +namespace jay { class peak_detect_impl : public peak_detect { - private: - // Nothing to declare in this block. - float m_alpha_s; - float m_alpha_m; - int m_vlen; - int *m_pPeakCount; - float *m_pXs; - float *m_pXm; + private: + // Nothing to declare in this block. + float m_alpha_s; + float m_alpha_m; + int m_vlen; + int *m_pPeakCount; + float *m_pXs; + float *m_pXm; + FILE *m_pFile_frames; - public: - peak_detect_impl(float alpha_s, float alpha_m, int vlen); - ~peak_detect_impl(); + public: + peak_detect_impl(float alpha_s, float alpha_m, int vlen); + ~peak_detect_impl(); - // Where all the action really happens - int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); + // Where all the action really happens + int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); }; - } // namespace jay +} // namespace jay } // namespace gr #endif /* INCLUDED_JAY_PEAK_DETECT_IMPL_H */