- write frames to files

git-svn-id: http://moon:8086/svn/software/trunk/projects/GnuRadio@438 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
2019-05-21 19:19:15 +00:00
parent 282dfae0d5
commit 0237ce0607
2 changed files with 23 additions and 23 deletions
+7 -6
View File
@@ -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;
+16 -17
View File
@@ -24,30 +24,29 @@
#include <jay/peak_detect.h>
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 */