Sign in

username:

password:



Not a member?

Search matlab



Search tips

Subscribe to matlab



matlab by Keywords

Atanh | Autocorrelation | Bandpass Filter | C++ | Conv | Database | Deconv | Excel | FFT | Filter | Filtering | FIR | Fourier Transfrom | FSK | Gaussian Noise | Haykin | IFFT | Image | Java | LFSR | LMS | LPC | MEX | OFDM | QPSK | Radix | Random | Sampling | Segmentation | Simulink | Visual Basic | Waveform | Wavelet

Ads

Discussion Groups

Discussion Groups | Matlab DSP | strange result for filter design

Technical discussion about Matlab and issues related to Digital Signal Processing.

  

Post a new Thread

strange result for filter design - Moshe Malkin - Jan 6 2:24:00 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






(You need to be a member of matlab -- send a blank email to matlab-subscribe@yahoogroups.com )

Re: strange result for filter design - Jeff Brower - Jan 6 15:02:00 2003

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





(You need to be a member of matlab -- send a blank email to matlab-subscribe@yahoogroups.com )

Re: strange result for filter design - c r - Jan 6 15:17:00 2003

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

Yahoo! Groups SponsorADVERTISEMENT

_____________________________________
/groups.php3

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
---------------------------------





(You need to be a member of matlab -- send a blank email to matlab-subscribe@yahoogroups.com )

Re: strange result for filter design - navaneetha krishnan - Jan 6 15:47:00 2003

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 __________________________________________________





(You need to be a member of matlab -- send a blank email to matlab-subscribe@yahoogroups.com )

Re: strange result for filter design - Priyank Saxena - Jan 7 10:27:00 2003

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



(You need to be a member of matlab -- send a blank email to matlab-subscribe@yahoogroups.com )