USRP_Server  2.0
A flexible, GPU-accelerated radio-frequency readout software.
fir.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <stdint.h>
4 #include <cublas_v2.h>
5 
6 
7 class FIR
8 {
9  public:
10  // M is decimation factor
11  // f should be around 8
12  // M * f is the length of the coefficient vector
13  // nt is the number of input samples the fir will work on
14  FIR(cublasHandle_t handle, cudaStream_t stream, float2 *hcoeff, int M, int f, int nt);
15  ~FIR();
16 
17  cublasHandle_t _handle;
18  cudaStream_t _stream;
19  int _M; // decimation factor
20  int _f; // taps per decimation factor
21  int _ntap; // M * f - number of taps in FIR filter
22  int _nb; // nt / M - output samples per input block
23  int _nt; // nb * M - input samples
24  int _nout; // f + nb - 1 // Length of output storage vector
25  float2 *_dcoeff; // f x M
26  float2 *_dout; // nout
27  float2 *_hout; // nb
28  float2 *_dtrapz; // nb x f
29 
30  void fir_apply(const float2 *din);
31  void fir_shift();
32  void fir_to_host(float2 *hout);
33  void fir_to_dev(float2 *dout);
34 
35  void run_fir(const float2 *din, float2 *hout);
36 
37 };
FIR(cublasHandle_t handle, cudaStream_t stream, float2 *hcoeff, int M, int f, int nt)
Definition: fir.cu:15
float2 * _dout
Definition: fir.hpp:26
~FIR()
Definition: fir.cu:36
float2 * _dtrapz
Definition: fir.hpp:28
void fir_shift()
Definition: fir.cu:64
int _ntap
Definition: fir.hpp:21
float2 * _dcoeff
Definition: fir.hpp:25
int _nb
Definition: fir.hpp:22
Definition: fir.hpp:7
int _M
Definition: fir.hpp:19
int _nout
Definition: fir.hpp:24
int _nt
Definition: fir.hpp:23
cublasHandle_t _handle
Definition: fir.hpp:17
float2 * _hout
Definition: fir.hpp:27
void fir_apply(const float2 *din)
Definition: fir.cu:44
void fir_to_dev(float2 *dout)
Definition: fir.cu:79
int _f
Definition: fir.hpp:20
cudaStream_t _stream
Definition: fir.hpp:18
void fir_to_host(float2 *hout)
Definition: fir.cu:71
void run_fir(const float2 *din, float2 *hout)
Definition: fir.cu:83