# strange result for filter design

Started by January 6, 2003
 Hello, The following code fails completely. Instead of producing the requested filter it returns the filter coefficients as all zeros. Here's the code: % design narrowband filter f = [0.444 0.49 0.51 0.556 ]; a = [0 1 0]; dev = [0.0316 0.05 0.0316]; % estimate order using remezord [n,fo,ao,w] = remezord(f,a,dev) % get filter coefficients b = remez(n,fo,ao,w); % ERROR: the b vector is all zeros. % How is this possible? thanks
 Moshe Malkin- What is the order of the filter returned by remezord? Jeff Brower Signalogic > The following code fails completely. > Instead of producing the requested filter > it returns the filter coefficients as all zeros. > > Here's the code: > > % design narrowband filter > f = [0.444 0.49 0.51 0.556 ]; > a = [0 1 0]; > dev = [0.0316 0.05 0.0316]; > % estimate order using remezord > [n,fo,ao,w] = remezord(f,a,dev) > % get filter coefficients > b = remez(n,fo,ao,w); > > % ERROR: the b vector is all zeros. > % How is this possible? > thanks
 Moshe, what are you design specifications? I think you may have normalized incorrectly, or set up vector dev incorrectly. You might check that, for some stupid reason every filter design program in matlab is different! It annoys me that they did not standardized this aspect of Matlab, it has caused me much headache. Let me know, and I will see what I can do. The following is some sample code I programmed a while ago using the remez exchange algy. You might be able to apply this to help trouble shoot your problem Fs = 48e3 fp1 = 80 fs1 = 70 fp2 = 160 fs2 = 200 fp = [fp1/(Fs) fp2/(Fs)]; %Passband edge frequencies fs = [fs1/Fs fs2/Fs];%Stopband edge frequencies ws = 70; %Stopband attenuation wp = .02; %Passband attenuation %Application of the remez algorithm %Calculate ripple specs in decimal form, see page 725 of Ambardar handout %Eq. 20.9 and 20.10 epb = 10^(wp/20); esb = 10^ (-ws/20); dp = (epb - 1)/(epb + 1) ds = (1 + dp)*esb D = [ds dp ds]; %Deviation vector for remezord [N,fo,mo,w] = remezord( [fs(1) fp(1) fp(2) fs(2)], [0,1,0],D,1) N = 2*floor(N/2 + 1/2); %This assures that N is an even number hz = remez(N,fo,mo,w); Moshe Malkin <> wrote:Hello, The following code fails completely. Instead of producing the requested filter it returns the filter coefficients as all zeros. Here's the code: % design narrowband filter f = [0.444 0.49 0.51 0.556 ]; a = [0 1 0]; dev = [0.0316 0.05 0.0316]; % estimate order using remezord [n,fo,ao,w] = remezord(f,a,dev) % get filter coefficients b = remez(n,fo,ao,w); % ERROR: the b vector is all zeros. % How is this possible? thanks _____________________________________ Note: If you do a simple "reply" with your email client, only the author of this message will receive your answer. You need to do a "reply all" if you want your answer to be distributed to the entire group. _____________________________________ About this discussion group: To Join: To Post: To Leave: Archives: http://www.yahoogroups.com/group/matlab More DSP-Related Groups: http://www.dsprelated.com/groups.php3 ---------------------------------
 Hi, That appears to be a bug in remez. See http://www.mathworks.com/support/solutions/data/31015.shtml Navan --- Moshe Malkin <> wrote: > Hello, > The following code fails completely. > Instead of producing the requested filter > it returns the filter coefficients as all zeros. > > Here's the code: > > % design narrowband filter > f = [0.444 0.49 0.51 0.556 ]; > a = [0 1 0]; > dev = [0.0316 0.05 0.0316]; > % estimate order using remezord > [n,fo,ao,w] = remezord(f,a,dev) > % get filter coefficients > b = remez(n,fo,ao,w); > > % ERROR: the b vector is all zeros. > % How is this possible? > thanks __________________________________________________
thats right. I'm using Matlab version 5.2 and the code runs absolutely fine.
the output of the code is attached.
-priyank

--- navaneetha krishnan <> wrote:
> Hi,
>
> That appears to be a bug in remez.
>
> See
> http://www.mathworks.com/support/solutions/data/31015.shtml
>
> Navan
>
> --- Moshe Malkin <> wrote:
> > Hello,
> >
> >
> > The following code fails completely.
> > Instead of producing the requested filter
> > it returns the filter coefficients as all zeros.
> >
> > Here's the code:
> >
> > % design narrowband filter
> > f = [0.444 0.49 0.51 0.556 ];
> > a = [0 1 0];
> > dev = [0.0316 0.05 0.0316];
> > % estimate order using remezord
> > [n,fo,ao,w] = remezord(f,a,dev)
> > % get filter coefficients
> > b = remez(n,fo,ao,w);
> >
> > % ERROR: the b vector is all zeros.
> > % How is this possible?
> >
> >
> > thanks > __________________________________________________

__________________________________________________

 Attachment (not stored) values.dat Type: application/octet-stream