[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r11610 - in gnuradio/branches/developers/n4hy/pfb_iir2
From: |
n4hy |
Subject: |
[Commit-gnuradio] r11610 - in gnuradio/branches/developers/n4hy/pfb_iir2: gnuradio-core/src/lib/general gnuradio-examples/python/apps/filter_design_tool |
Date: |
Mon, 17 Aug 2009 16:00:47 -0600 (MDT) |
Author: n4hy
Date: 2009-08-17 16:00:47 -0600 (Mon, 17 Aug 2009)
New Revision: 11610
Modified:
gnuradio/branches/developers/n4hy/pfb_iir2/gnuradio-core/src/lib/general/gr_iirdes.cc
gnuradio/branches/developers/n4hy/pfb_iir2/gnuradio-examples/python/apps/filter_design_tool/filter_design_tool.py
gnuradio/branches/developers/n4hy/pfb_iir2/gnuradio-examples/python/apps/filter_design_tool/iirdestest.py
Log:
chebyshev type I order estimation now functional
Modified:
gnuradio/branches/developers/n4hy/pfb_iir2/gnuradio-core/src/lib/general/gr_iirdes.cc
===================================================================
---
gnuradio/branches/developers/n4hy/pfb_iir2/gnuradio-core/src/lib/general/gr_iirdes.cc
2009-08-17 21:17:58 UTC (rev 11609)
+++
gnuradio/branches/developers/n4hy/pfb_iir2/gnuradio-core/src/lib/general/gr_iirdes.cc
2009-08-17 22:00:47 UTC (rev 11610)
@@ -218,8 +218,8 @@
double Rp,
double Rs)
{
- double qs = log(pow(10.,(Rs/10.0)) - 1.0);
- double qp = log(pow(10.,(Rp/10.0)) - 1.0);
+ double qs = pow(10.,(fabs(Rs)/10.0));
+ double qp = pow(10.,(fabs(Rp)/10.0));
switch (fresp) {
case gr_iirdes::LOWPASS: {
vector<double> rtn(2);
@@ -227,22 +227,22 @@
if (Wp[0]>=Ws[0])
throw std::invalid_argument ("For lowpass filter Wp < Ws");
+ rtn[1] = Wp[0];
Ws[0] = tan(M_PI*Ws[0]);
Wp[0] = tan(M_PI*Wp[0]);
Wa = Ws[0]/Wp[0];
rtn[0] = ceil(acosh(sqrt((qs-1)/(qp-1)))/acosh(Wa));
- rtn[1] = Wp[0];
return rtn;
}
case gr_iirdes::HIGHPASS: {
double Wa;
vector<double> rtn(2);
if (Ws[0]>=Wp[0]) throw std::invalid_argument ("For highpass filter Wp >
Ws");
+ rtn[1] = Wp[0];
Ws[0] = tan(M_PI*Ws[0]);
Wp[0] = tan(M_PI*Wp[0]);
Wa = Wp[0]/Ws[0];
rtn[0] = ceil(acosh(sqrt((qs-1)/(qp-1)))/acosh(Wa));
- rtn[1] = Wp[0];
return rtn;
}
case gr_iirdes::BANDPASS: {
@@ -253,16 +253,16 @@
(Wp[1]>=Ws[1])) throw std::invalid_argument
("For bandpass filter Ws[0]<Wp[0]<Wp[1]<Ws[1]");
+ rtn[1] = Wp[0];
+ rtn[2] = Wp[1];
Ws[0] = tan(M_PI*Ws[0]);
Wp[0] = tan(M_PI*Wp[0]);
Ws[1] = tan(M_PI*Ws[1]);
Wp[1] = tan(M_PI*Wp[1]);
for (int i=0;i<2;i++)
Wa[i]=(Ws[i]*Ws[i]-Wp[0]*Wp[1])/(Ws[i]*(Wp[0]-Wp[1]));
- Wa[0]=fmin(Wa[0],Wa[1]);
+ Wa[0]=fmin(fabs(Wa[0]),fabs(Wa[1]));
rtn[0] = ceil(acosh(sqrt((qs-1)/(qp-1)))/acosh(Wa[0]));
- rtn[1]=Wp[0];
- rtn[2]=Wp[1];
return rtn;
}
case gr_iirdes::BANDSTOP: {
Modified:
gnuradio/branches/developers/n4hy/pfb_iir2/gnuradio-examples/python/apps/filter_design_tool/filter_design_tool.py
===================================================================
---
gnuradio/branches/developers/n4hy/pfb_iir2/gnuradio-examples/python/apps/filter_design_tool/filter_design_tool.py
2009-08-17 21:17:58 UTC (rev 11609)
+++
gnuradio/branches/developers/n4hy/pfb_iir2/gnuradio-examples/python/apps/filter_design_tool/filter_design_tool.py
2009-08-17 22:00:47 UTC (rev 11610)
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright 2005,2006,2007 Free Software Foundation, Inc.
+# Copyright 2009 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
Modified:
gnuradio/branches/developers/n4hy/pfb_iir2/gnuradio-examples/python/apps/filter_design_tool/iirdestest.py
===================================================================
---
gnuradio/branches/developers/n4hy/pfb_iir2/gnuradio-examples/python/apps/filter_design_tool/iirdestest.py
2009-08-17 21:17:58 UTC (rev 11609)
+++
gnuradio/branches/developers/n4hy/pfb_iir2/gnuradio-examples/python/apps/filter_design_tool/iirdestest.py
2009-08-17 22:00:47 UTC (rev 11610)
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright 2005,2006,2007 Free Software Foundation, Inc.
+# Copyright 2009 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -29,9 +29,9 @@
60)
print "Butterpass Lowpass design, order and cutoff frequency = ",numbers,"\n"
-numbersC = gr.iirdes.chebyshevord(gr.iirdes.LOWPASS,
- [.3],
- [.4],
+numbersC = gr.iirdes.chebyshevord(gr.iirdes.BANDPASS,
+ [.2, .3],
+ [.1, .4],
.1,
60)
print "Chebyshev Lowpass design, order and cutoff frequency = ",numbersC,"\n"
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r11610 - in gnuradio/branches/developers/n4hy/pfb_iir2: gnuradio-core/src/lib/general gnuradio-examples/python/apps/filter_design_tool,
n4hy <=