50 int main (
int argc,
char *argv[])
53 EST_String in_file(
"-"), out_file(
"-"), op_file(
""), test;
60 EST_String(
"[input file0] -o [output file]\n") +
61 "Summary: filter waveform files\n" 62 "use \"-\" to make input and output files stdin/out\n" 64 "-forder <int> Order of FIR filter. This must be ODD.\n" 65 " Sensible values range \n" 66 " from 19 (quick but with a shallow rolloff) to 199 \n" 67 " (slow but with a steep rolloff). The default is 199.\n\n" 68 "-double Design a filter suitable for double (zero-phase)\n" 70 "-o <ofile> output filter file\n",
78 forder = al.
present(
"-forder") ? al.
ival(
"-forder") : 199;
81 for (
int i = 0; i < fresponse.
length(); i++)
82 fresponse[i] = sqrt(fresponse[i]);
87 int l = fresponse.
length() * 2;
90 for(
int i = 0;i<fresponse.
length();i++)
92 full_fresponse[i] = fresponse(i);
93 full_fresponse[l-1-i] = fresponse(i);
97 filter.
save(out_file,
"est_ascii");
EST_FVector design_FIR_filter(const EST_FVector &freq_response, int filter_order)
EST_read_status load(const EST_String &filename)
load vector from file filename.
A vector class for floating point numbers. EST_FVector x should be used instead of float *x wherever ...
int ival(const EST_String &rkey, int m=1) const
EST_write_status save(const EST_String &filename, const EST_String &type)
save vector to file filename.
INLINE ssize_t length() const
number of items in vector.
int main(int argc, char *argv[])
const T & first() const
return const reference to first item in list
const V & val(const K &rkey, bool m=0) const
return value according to key (const)
int present(const K &rkey) const
Returns true if key is present.
int parse_command_line(int argc, char *argv[], const EST_String &usage, EST_StrList &files, EST_Option &al, int make_stdio=1)