isce3  0.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
Filter.h
1 // -*- C++ -*-
2 // -*- coding: utf-8 -*-
3 //
4 // Author: Heresh Fattahi, Bryan Riel
5 // Copyright 2018-
6 //
7 
8 #pragma once
9 
10 #include "forward.h"
11 
12 #include <cmath>
13 #include <valarray>
14 
15 #include <isce3/core/Constants.h>
16 #include <isce3/io/Raster.h>
17 #include <isce3/core/LUT1d.h>
18 #include "Signal.h"
19 
20 // Declaration
21 namespace isce3 { namespace signal {
23  void fftfreq(double dt, std::valarray<double> &freq);
24 }}
25 
26 template<class T>
28  public:
29 
30  Filter() {};
31 
32  ~Filter() {};
33 
35  void initiateRangeFilter(std::valarray<std::complex<T>> &signal,
36  std::valarray<std::complex<T>> &spectrum,
37  size_t ncols,
38  size_t nrows);
39 
41  void initiateAzimuthFilter(std::valarray<std::complex<T>> &signal,
42  std::valarray<std::complex<T>> &spectrum,
43  size_t ncols,
44  size_t nrows);
45 
47  //void setFilter(std::valarray<std::complex<T>>);
48 
50  void constructRangeBandpassFilter(double rangeSamplingFrequency,
51  std::valarray<double> subBandCenterFrequencies,
52  std::valarray<double> subBandBandwidths,
53  std::valarray<std::complex<T>> &signal,
54  std::valarray<std::complex<T>> &spectrum,
55  size_t ncols,
56  size_t nrows,
57  std::string filterType);
58 
59  void constructRangeBandpassFilter(double rangeSamplingFrequency,
60  std::valarray<double> subBandCenterFrequencies,
61  std::valarray<double> subBandBandwidths,
62  size_t ncols,
63  size_t nrows,
64  std::string filterType);
65 
67  void constructRangeBandpassBoxcar(std::valarray<double> subBandCenterFrequencies,
68  std::valarray<double> subBandBandwidths,
69  double dt,
70  int fft_size,
71  std::valarray<std::complex<T>> &_filter1D);
72 
73  void constructRangeBandpassCosine(std::valarray<double> subBandCenterFrequencies,
74  std::valarray<double> subBandBandwidths,
75  double dt,
76  std::valarray<double>& frequency,
77  double beta,
78  std::valarray<std::complex<T>>& _filter1D);
79 
80  //T constructRangeCommonbandFilter();
81 
84  const isce3::core::LUT1d<double> & secDoppler,
85  double bandwidth,
86  double prf,
87  double beta,
88  std::valarray<std::complex<T>> &signal,
89  std::valarray<std::complex<T>> &spectrum,
90  size_t ncols,
91  size_t nrows);
92 
94  void filter(std::valarray<std::complex<T>> &signal,
95  std::valarray<std::complex<T>> &spectrum);
96 
98  static void indexOfFrequency(double dt, int N, double f, int& n);
99 
100  void writeFilter(size_t ncols, size_t nrows);
101 
102  private:
103  isce3::signal::Signal<T> _signal;
104  std::valarray<std::complex<T>> _filter;
105 
106 };
void constructRangeBandpassFilter(double rangeSamplingFrequency, std::valarray< double > subBandCenterFrequencies, std::valarray< double > subBandBandwidths, std::valarray< std::complex< T >> &signal, std::valarray< std::complex< T >> &spectrum, size_t ncols, size_t nrows, std::string filterType)
Sets an existing filter to be used by the filter object.
Definition: Filter.cpp:62
static void indexOfFrequency(double dt, int N, double f, int &n)
Find the index of a specific frequency for a signal with a specific sampling rate.
Definition: Filter.h:27
void constructRangeBandpassCosine(std::valarray< double > subBandCenterFrequencies, std::valarray< double > subBandBandwidths, double dt, std::valarray< double > &frequency, double beta, std::valarray< std::complex< T >> &_filter1D)
Definition: Filter.cpp:197
void constructRangeBandpassBoxcar(std::valarray< double > subBandCenterFrequencies, std::valarray< double > subBandBandwidths, double dt, int fft_size, std::valarray< std::complex< T >> &_filter1D)
Construct a box car range band-pass filter for multiple bands.
Definition: Filter.cpp:146
void constructAzimuthCommonbandFilter(const isce3::core::LUT1d< double > &refDoppler, const isce3::core::LUT1d< double > &secDoppler, double bandwidth, double prf, double beta, std::valarray< std::complex< T >> &signal, std::valarray< std::complex< T >> &spectrum, size_t ncols, size_t nrows)
Construct azimuth common band filter.
Definition: Filter.cpp:246
void initiateAzimuthFilter(std::valarray< std::complex< T >> &signal, std::valarray< std::complex< T >> &spectrum, size_t ncols, size_t nrows)
constructs forward abd backward FFT plans for filtering a block of data in azimuth direction...
Definition: Filter.cpp:40
void initiateRangeFilter(std::valarray< std::complex< T >> &signal, std::valarray< std::complex< T >> &spectrum, size_t ncols, size_t nrows)
constructs forward abd backward FFT plans for filtering a block of data in range direction.
Definition: Filter.cpp:21
void filter(std::valarray< std::complex< T >> &signal, std::valarray< std::complex< T >> &spectrum)
Filter a signal in frequency domain.
Definition: Filter.cpp:319

Generated for ISCE3.0 by doxygen 1.8.5.