Hello all...I'm new to the group and relatively new to Scilab. I'm trying to convert a section of code from Matlab to Scilab (please don't ask "why?" as I'm still trying to figure that one out myself...suffice it to say it is "because I have to"), and I'm completely stuck on converting the following Matlab code: % y is a (1500,1) matrix of numbers (floats) x = remez(16,[0 .5],[0 pi/2],'d'); x1 = filter(x,1,y(1:length(y))); x2 = filter(x,1,x1); The above works just fine in Matlab, but not at all in Scilab. The help feature in Scilab is not really helping. "remez" and "filter" both seem to exist in Scilab, but don't do the same thing as in Matlab. Any help would be appreciated. Chris

# Help with Remez function in Scilab...

Started by ●March 21, 2007

Posted by ●March 22, 2007

ctulk wrote:> Hello all...I'm new to the group and relatively new to Scilab. I'm trying > to convert a section of code from Matlab to Scilab (please don't ask > "why?" as I'm still trying to figure that one out myself...suffice it to > say it is "because I have to"), and I'm completely stuck on converting the > following Matlab code: > > % y is a (1500,1) matrix of numbers (floats) > x = remez(16,[0 .5],[0 pi/2],'d'); > x1 = filter(x,1,y(1:length(y))); > x2 = filter(x,1,x1); > > The above works just fine in Matlab, but not at all in Scilab. The help > feature in Scilab is not really helping. "remez" and "filter" both seem to > exist in Scilab, but don't do the same thing as in Matlab.I think you should try eqfir. eqfir designs all standard filters (Low/ High/Band pass and band stop) pretty well. However, if you are looking to design a differentiator, you would be much better off using the scilab remez with the concept of designing an equripple differentiator (weight = 1 / frequency et al). See Oppenheim and Schafer, Rabiner and Gold or Proakis and Manolakis for why this works. Once you do that, you should be able to make sense of the "frequency grid" and "weight" for a differentiator, and use scilabs remez (which, by the way, is NOT like Matlab's) to get a differentiator. For a Hilbert transformer, you could also consider doing it the half band filter way, but I don't know if that's what you want. HTH. Kumar

Posted by ●March 22, 2007

> >I think you should try eqfir. eqfir designs all standard filters (Low/ >High/Band pass and band stop) pretty well. However, if you are looking >to design a differentiator, you would be much better off using the >scilab remez with the concept of designing an equripple differentiator >(weight = 1 / frequency et al). See Oppenheim and Schafer, Rabiner and >Gold or Proakis and Manolakis for why this works. > >Once you do that, you should be able to make sense of the "frequency >grid" and "weight" for a differentiator, and use scilabs remez (which, >by the way, is NOT like Matlab's) to get a differentiator. > >For a Hilbert transformer, you could also consider doing it the half >band filter way, but I don't know if that's what you want. > >HTH. > >Kumar > >Thanks! I'll try playing around with eqfir.