[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r8226 - gnuradio/branches/developers/eb/gcell/gcell/sr
From: |
eb |
Subject: |
[Commit-gnuradio] r8226 - gnuradio/branches/developers/eb/gcell/gcell/src/lib/wrapper |
Date: |
Sat, 19 Apr 2008 19:58:22 -0600 (MDT) |
Author: eb
Date: 2008-04-19 19:58:21 -0600 (Sat, 19 Apr 2008)
New Revision: 8226
Modified:
gnuradio/branches/developers/eb/gcell/gcell/src/lib/wrapper/gcp_fft_1d_r2.cc
gnuradio/branches/developers/eb/gcell/gcell/src/lib/wrapper/gcp_fft_1d_r2.h
gnuradio/branches/developers/eb/gcell/gcell/src/lib/wrapper/qa_gcp_fft_1d_r2.cc
Log:
additional refactoring
Modified:
gnuradio/branches/developers/eb/gcell/gcell/src/lib/wrapper/gcp_fft_1d_r2.cc
===================================================================
---
gnuradio/branches/developers/eb/gcell/gcell/src/lib/wrapper/gcp_fft_1d_r2.cc
2008-04-20 01:36:25 UTC (rev 8225)
+++
gnuradio/branches/developers/eb/gcell/gcell/src/lib/wrapper/gcp_fft_1d_r2.cc
2008-04-20 01:58:21 UTC (rev 8226)
@@ -66,10 +66,10 @@
}
-static gc_job_desc *
-gcp_fft_1d_r2_submit(const std::string &proc_name,
- gc_job_manager_sptr mgr,
+gc_job_desc *
+gcp_fft_1d_r2_submit(gc_job_manager_sptr mgr,
unsigned int log2_fft_length,
+ bool forward,
bool shift,
std::complex<float> *out,
const std::complex<float> *in,
@@ -89,6 +89,12 @@
if ((intptr_t)window & 0xf)
throw gc_bad_align("window");
+ std::string proc_name;
+ if (forward)
+ proc_name = "fwd_fft_1d_r2";
+ else
+ proc_name = "inv_fft_1d_r2";
+
gc_proc_id_t fft_id = mgr->lookup_proc(proc_name);
gc_job_desc *jd = mgr->alloc_job_desc();
init_jd(jd, fft_id, log2_fft_length, shift, out, in, twiddle, window);
@@ -100,33 +106,6 @@
return jd;
}
-
-gc_job_desc *
-gcp_fwd_fft_1d_r2_submit(gc_job_manager_sptr mgr,
- unsigned int log2_fft_length,
- bool shift,
- std::complex<float> *out,
- const std::complex<float> *in,
- const std::complex<float> *twiddle,
- const float *window)
-{
- return gcp_fft_1d_r2_submit("fwd_fft_1d_r2", mgr, log2_fft_length, shift,
- out, in, twiddle, window);
-}
-
-gc_job_desc *
-gcp_inv_fft_1d_r2_submit(gc_job_manager_sptr mgr,
- unsigned int log2_fft_length,
- bool shift,
- std::complex<float> *out,
- const std::complex<float> *in,
- const std::complex<float> *twiddle,
- const float *window)
-{
- return gcp_fft_1d_r2_submit("inv_fft_1d_r2", mgr, log2_fft_length, shift,
- out, in, twiddle, window);
-}
-
void
gcp_fft_1d_r2_twiddle(unsigned int log2_fft_length, std::complex<float>
*twiddle)
{
Modified:
gnuradio/branches/developers/eb/gcell/gcell/src/lib/wrapper/gcp_fft_1d_r2.h
===================================================================
--- gnuradio/branches/developers/eb/gcell/gcell/src/lib/wrapper/gcp_fft_1d_r2.h
2008-04-20 01:36:25 UTC (rev 8225)
+++ gnuradio/branches/developers/eb/gcell/gcell/src/lib/wrapper/gcp_fft_1d_r2.h
2008-04-20 01:58:21 UTC (rev 8226)
@@ -25,10 +25,11 @@
#include <complex>
/*!
- * \brief Submit a job that computes the forward FFT.
+ * \brief Submit a job that computes the forward or inverse FFT.
*
* \param mgr is the job manager instance
* \param log2_fft_length is the log2 of the fft_length (4 <= x <= 12).
+ * \param forward is true to compute the forward transform, else the inverse.
* \param shift indicates if an "fftshift" should be applied to the output data
* \param out is the fft_length output from FFT (must be 16-byte aligned).
* \param in is the fft_length input to FFT (must be 16-byte aligned).
@@ -38,41 +39,20 @@
*
* Returns a job descriptor which should be passed to wait_job*.
* Throws an exception in the event of a problem.
+ * This uses the FFTW conventions for scaling. That is, neither the forward
nor inverse
+ * are scaled by 1/fft_length.
*/
gc_job_desc *
-gcp_fwd_fft_1d_r2_submit(gc_job_manager_sptr mgr,
- unsigned int log2_fft_length,
- bool shift,
- std::complex<float> *out,
- const std::complex<float> *in,
- const std::complex<float> *twiddle,
- const float *window);
+gcp_fft_1d_r2_submit(gc_job_manager_sptr mgr,
+ unsigned int log2_fft_length,
+ bool forward,
+ bool shift,
+ std::complex<float> *out,
+ const std::complex<float> *in,
+ const std::complex<float> *twiddle,
+ const float *window);
-
/*!
- * \brief Submit a job that computes the inverse FFT.
- *
- * \param mgr is the job manager instance
- * \param log2_fft_length is the log2 of the fft_length (4 <= x <= 12).
- * \param shift indicates if an "fftshift" should be applied to the input data
- * \param out is the fft_length output from FFT (must be 16-byte aligned).
- * \param in is the fft_length input to FFT (must be 16-byte aligned).
- * \param twiddle is fft_length/4 twiddle factor input to FFT (must be 16-byte
aligned).
- * \param window is the fft_length window to be applied to the input data or a
NULL pointer (must be 16-byte aligned).
- *
- * Returns a job descriptor which should be passed to wait_job*.
- * Throws an exception in the event of a problem.
- */
-gc_job_desc *
-gcp_inv_fft_1d_r2_submit(gc_job_manager_sptr mgr,
- unsigned int log2_fft_length,
- bool shift,
- std::complex<float> *out,
- const std::complex<float> *in,
- const std::complex<float> *twiddle,
- const float *window);
-
-/*!
* \brief Compute twiddle factors
*
* \param log2_fft_length is the log2 of the fft_length.
Modified:
gnuradio/branches/developers/eb/gcell/gcell/src/lib/wrapper/qa_gcp_fft_1d_r2.cc
===================================================================
---
gnuradio/branches/developers/eb/gcell/gcell/src/lib/wrapper/qa_gcp_fft_1d_r2.cc
2008-04-20 01:36:25 UTC (rev 8225)
+++
gnuradio/branches/developers/eb/gcell/gcell/src/lib/wrapper/qa_gcp_fft_1d_r2.cc
2008-04-20 01:58:21 UTC (rev 8226)
@@ -180,14 +180,8 @@
// ------------------------------------------------------------------------
// compute the answer on the cell
- gc_job_desc *jd;
-
- if (forward)
- jd = gcp_fwd_fft_1d_r2_submit(mgr, log2_fft_size, false,
- cell_out, cell_in, cell_twiddle, 0);
- else
- jd = gcp_inv_fft_1d_r2_submit(mgr, log2_fft_size, false,
- cell_out, cell_in, cell_twiddle, 0);
+ gc_job_desc *jd = gcp_fft_1d_r2_submit(mgr, log2_fft_size, forward, false,
+ cell_out, cell_in, cell_twiddle, 0);
if (!mgr->wait_job(jd)){
fprintf(stderr, "wait_job failed: %s\n",
gc_job_status_string(jd->status).c_str());
mgr->free_job_desc(jd);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r8226 - gnuradio/branches/developers/eb/gcell/gcell/src/lib/wrapper,
eb <=